Page 1 of 1
Help me
Posted: Thu Mar 31, 2011 8:14 pm
by maxONN
Help! I'm still learning XNA .... how do I change the position of boxing in my project used pure keyboard ......
Here is my project
Re: Help me
Posted: Thu Mar 31, 2011 8:39 pm
by Norbo
If you need to teleport an Entity, you can set its Position property. If you want to move it around like a character, teleporting it from spot to spot all the time isn't a good idea, since it will go through walls. Instead, change its LinearVelocity so that it moves how you want. If you don't want the 'character' to fall over, set its LocalInertiaTensorInverse = new Matrix3X3(). This effectively gives it infinite inertia so it cannot rotate, but it will still move linearly.
For XNA help/learning in general, your best bet is to use other resources on the web.
http://create.msdn.com/en-US is a good start. There's lots of educational material and samples on that website, along with the main forums for xna.
Re: Help me
Posted: Sun Apr 03, 2011 12:02 pm
by maxONN
I made a moving object ... how to do what he would have repelled from the walls of my model? Help ... is very necessary
Re: Help me
Posted: Sun Apr 03, 2011 4:58 pm
by Norbo
I'm not quite sure what you mean, but it might be that you are using a kinematic entity. Kinematic entities will go through everything since they have infinite mass and inertia ("unstoppable force"). A dynamic entity will respond to collisions. To make a dynamic entity, just pass some mass value into the entity's constructor or call BecomeDynamic later.
Re: Help me
Posted: Sun Apr 03, 2011 6:29 pm
by maxONN
Here is my project ... I do not understand how to use BEPUphysics do collision of a moving object ........ sorry for my english .. I'm from Russia .... hard to understand the implementation of the Coliseum with the engine .... . help me code?
Re: Help me
Posted: Sun Apr 03, 2011 6:44 pm
by Norbo
The first step is just to make an entity and add it to the space.
Code: Select all
Box box = new Box(new Vector3(0, 0, 0), 1, 1, 1, 1);
space.Add(box);
That box is dynamic since it was given a mass in its constructor. It will fall and respond to collisions.
If you wanted to treat the box as a sort of character, you could control his linear velocity using the LinearVelocity property. If you wanted to stop the box from rotating and falling over as you moved around, set:
Code: Select all
box.LocalInertiaTensorInverse = new Matrix3X3();
There's also a SimpleCharacterController in the BEPUphysicsDemos project (in the main source code repository). That would be a good option if you wanted a character.