Page 1 of 1

How are entities drawn in BEPU?

Posted: Tue Dec 09, 2014 6:21 am
by jaja1
I use BEPU for physics calculations in an mmo server, so I never actually see how my shapes are being drawn. I have to imagine it some what in my head based on precisely determined positions and proportions. So my question is are 3D shapes drawn from their geometric center outward (and evenly in all directions) or from a single 2D point and then upward? I need to know this because it is critical to determining where my "ground" actually is. If my objects are being drawn from the center and outward in all directions then I need to compensate by moving the shape upward based on half its height. If they are being drawn from a grid and then upward (or downward depending your perspective) then I do not need to compensate. I can not use an actual ground plane (or gravity for that matter) because it is not needed in my space. All my calculations are based on head on collisions and I do not need real world physics determining what happens to the objects. I am simply using them as triggers. (I gave all of the gory details because I am open to suggestions by anyone as to improving my current method :) ).

Re: How are entities drawn in BEPU?

Posted: Tue Dec 09, 2014 10:45 pm
by Norbo
All entity shapes are centered on their center of mass by default. That is, the shape's center is at the owning entity.Position. (The shape's center can be offset from the position by setting the entity.CollisionInformation.LocalOffset, but it defaults to Vector3.Zero.)

Notably, this is true even for things like ConvexHullShapes, which can cause some confusion. The non-raw constructor actually moves the supplied vertices such that they're centered properly. Hence the shape recentering documentation. (Non-entities like the StaticMesh, in contrast, do not do any recentering.)

Re: How are entities drawn in BEPU?

Posted: Wed Dec 10, 2014 12:22 am
by jaja1
Thanks Norbo!
Think I have the information I need to set my objects in the correct positions now :)