Help me

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
maxONN
Posts: 3
Joined: Thu Mar 31, 2011 7:57 pm

Help me

Post 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
Attachments
MyProject.rar
My File
(269.35 KiB) Downloaded 226 times
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Help me

Post 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.
maxONN
Posts: 3
Joined: Thu Mar 31, 2011 7:57 pm

Re: Help me

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Help me

Post 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.
maxONN
Posts: 3
Joined: Thu Mar 31, 2011 7:57 pm

Re: Help me

Post 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?
Attachments
Demo.rar
file
(312.37 KiB) Downloaded 214 times
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Help me

Post 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.
Post Reply