Bounding Boxes resizing and sliding

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
mos
Posts: 12
Joined: Sat Sep 17, 2016 3:21 am

Bounding Boxes resizing and sliding

Post by mos »

Is it normal for the bounding boxes to resize as you move/jump? For example, when I jump the bounding box increases in size downwards then goes back to normal when it collides with something. It also becomes bigger when I rotate. For example, when I do this:

Code: Select all

Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(-45f))]
This will make my model face a different direction but the bounding box will double in size for some reason. Is this supposed to happen?

I draw the build/bounding boxes like this: https://gist.github.com/anonymous/a9794 ... baaffb6bb8
(I never call that update method there).

I do this at the end of my Player.update:

Code: Select all

worldMatrix = Matrix.CreateScale(this.scale) * ConvertTo.XNAMatrix(body.Box.WorldTransform);
Then to draw:

Code: Select all

effect.World = worldMatrix;
Another issue I'm having is my models slide too much. I move them by adding or subtracting from the Linear Velocity. Is there a way to just move them without sliding? Any help would be appreciated!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bounding Boxes resizing and sliding

Post by Norbo »

s it normal for the bounding boxes to resize as you move/jump? For example, when I jump the bounding box increases in size downwards then goes back to normal when it collides with something.
Yup, the bounding box contains the motion of the object over a timestep. It helps with collision detection.
This will make my model face a different direction but the bounding box will double in size for some reason. Is this supposed to happen?
The bounding box is axis aligned, so rotating an object can indeed make the bounding box significantly larger- it has to contain the extreme points of the rotated object along the three world axes.
Another issue I'm having is my models slide too much. I move them by adding or subtracting from the Linear Velocity. Is there a way to just move them without sliding?
There are all sorts of options- it just depends on what you you want. For example, you could just set the LinearVelocity directly to some value rather than adding to it.
Post Reply