BEPUphsysics checklist for devs

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Ardev
Posts: 2
Joined: Wed Apr 24, 2013 11:21 am

BEPUphsysics checklist for devs

Post by Ardev »

I am trying to complete a checklist for everything I need to do in an existing XNA project to get BEPUphsyics running.
(Since my first try didn't work)

This checklist is only to get BEPUphsysics running properly,
based on an existing XNA project, with 3D-Models and SkinnedAnimations.

And I didn't leave out some points, because they obvious to pros with BEPUphsysic.
This is what I did so far step for step (and it didn't draw anything)
  • I added the BEPUphysic-Files to my projects references
    I added a Space to my gameScene and initialized it
    I added the space.Update() to the update-method of my gameScene
    I generated a StaticMesh out of my Model (Which animates)
    I added that staticMesh to the Space
This is all I did. Nothing else.
I am pretty sure I missed something, but I don't know what.
Even after I added the StaticMesh to the Space, the count of the Space's entities
didn't rise.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: BEPUphsysics checklist for devs

Post by Norbo »

This is what I did so far step for step (and it didn't draw anything)
BEPUphysics is solely a physics engine has no concept of graphics; all rendering must be handled externally. The BEPUphysicsDrawer is a debug visualization library used by the BEPUphysicsDemos which could be used for testing purposes.

If you're using the BEPUphysicsDrawer, make sure that the object has been added to the drawer, that the drawer is being updated, and that the drawer is being drawn. None of it is automatic.
I generated a StaticMesh out of my Model (Which animates)
Using a StaticMesh for this purpose is probably not what you want; it will not automatically deform to match the animation and is likely not suitable for collision purposes. Graphical meshes are often far more complex than needed for physics and will degrade performance.

For example, if you wanted character physics, you'd probably want to use a CharacterController for it (source in the BEPUphysicsDemos). The actual physical body of a CharacterController is just a cylinder.
Even after I added the StaticMesh to the Space, the count of the Space's entities didn't rise.
StaticMeshes are not Entity objects. Entities are capable of velocity or force based movement. StaticMeshes, along with other StaticCollidables like InstancedMeshes, Terrains, and StaticGroups, are incapable of simulated motion.

To make the distinction clearer: static collidables are Collidables. An Entity is not a Collidable. An Entity does, however, own an EntityCollidable (a child type of Collidable, accessible in the Entity.CollisionInformation property) which acts as the entity's proxy in the collision detection pipeline.

For deeper examples of how entities and static objects are set up, I would recommend checking out the EntityConstructionDemo and StaticMeshDemo in the BEPUphysicsDemos.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: BEPUphsysics checklist for devs

Post by Norbo »

A general addendum:

Beyond checking the source only for the mentioned demos, I would recommend playing around in the BEPUphysicsDemos project a while, just to get a feel for how simulations are set up. You can grab the source here. Try modifying the demos to load different content, create different shapes, make new robots, construct new simulations, and so on. This is usually a pretty effective learning tool, and it's pretty fun to boot since you get to watch multicolored cubes flying around at your whim.
Ardev
Posts: 2
Joined: Wed Apr 24, 2013 11:21 am

Re: BEPUphsysics checklist for devs

Post by Ardev »

Great! Thank you very much, man!
I'll check that out
Post Reply