Page 1 of 1
Help me in physics for animated model !
Posted: Sat Jul 02, 2011 4:25 am
by huyetsat
I used your engine and I enjoyed it. but I have a problem. that I do not know how to apply physics in a model with animation (I know how to use this animated model in nine engine, you can find it here:nine.codeplex.com)
We hope you can help me at this stage, I sincerely thank you. I send you the source code that I've done in XNAPLus your project, thisproject is a completely free game for development community in my country. You can see my work at the site xnavn.com.
If you do a physical space have animation with model animation is so good, if not the physical space should not have animated the model, I just want to have a physical space in accordance with the design of the model to add it to the space object
thank you for reading my topic
link down my project:
http://www.mediafire.com/?gre7q8fi0ckay2e
Re: Help me in physics for animated model !
Posted: Sat Jul 02, 2011 5:34 pm
by Norbo
Sorry, I don't understand the specific question, so here's a scattershot bunch of possible answers:
-If you just want a simple bounding shape around your character that can be used for moving around the environment, then you need a character controller. I'd recommend looking into the SimpleCharacterController in the BEPUphysicsDemos project, which is available in the main source download:
http://bepuphysics.codeplex.com/SourceC ... changesets
-If you want a ragdoll, check out the RagdollDemo:
http://bepuphysics.codeplex.com/wikipag ... umentation
More information about constructing physical representations of skeletons can be found here:
http://www.bepu-games.com/forums/viewto ... f=4&t=1218
-If you want to control the position of kinematic entities rigidly with the animation, then you'll need to construct a physics representation (like in the above links), and then decide what animation bones control what physics bones. Then, set the entities to the state defined by the animation bone. To make it work properly, the velocities of the objects should be set instead of just positions/orientations.
-If you want to have partially physical, partially controlled system, you'll have to create a ragdoll representation and also motorization to physically control the objects. This is the most difficult.
Re: Help me in physics for animated model !
Posted: Sun Jul 03, 2011 12:24 pm
by huyetsat
Sorry for my bad English. I mean I need my skinned model in project can interact with other physical objects, can you help me? I need very urgently. you can use any way to help me also. please!
Re: Help me in physics for animated model !
Posted: Sun Jul 03, 2011 12:31 pm
by huyetsat
or just add a static bounding surrounding the skinned model so that model can interact in the physical environment
Re: Help me in physics for animated model !
Posted: Sun Jul 03, 2011 4:00 pm
by Norbo
or just add a static bounding surrounding the skinned model so that model can interact in the physical environment
If that will work, then I'd recommend looking into the SimpleCharacterController I mentioned above:
-If you just want a simple bounding shape around your character that can be used for moving around the environment, then you need a character controller. I'd recommend looking into the SimpleCharacterController in the BEPUphysicsDemos project, which is available in the main source download:
http://bepuphysics.codeplex.com/SourceC ... changesets
You can use the character controller's body position to translate the skinned model around to match.
Re: Help me in physics for animated model !
Posted: Mon Jul 04, 2011 7:40 am
by huyetsat
I have tried , but i failed, can you make me a sample on my project which i uploaded? please! you can see my skinned model in file AnimatedModelPeon.cs
Re: Help me in physics for animated model !
Posted: Mon Jul 04, 2011 4:47 pm
by Norbo
Not right now, but I will try to answer any specific questions you have
Was the trouble in integrating the SimpleCharacterController? If so, look at the BEPUphysicsDemos implementation. There's three involved areas: the SimpleCharacterController itself, the SimpleCharacterControllerInput which just looks at keyboard input and tells the character to move, and the StandardDemo where the SimpleCharacterControllerInput is used. Technically, in v0.16.0, the non-simple CharacterControllerInput is used in the StandardDemo, but they can be switched out.
If the problem was with aligning the graphical model to the character, note that the world transform for the character can be created from the gameplay logic 'facing angle' rotation matrix multiplied by the Matrix.CreateTranslation(Body.Position).