willing to make kind of "ball in a maze" game, instead of using constraint (as explained in another thread) to force the ball to stay on the plane (with here plane = a wide and flat BEPU box), I cheat a little by adding a second plane on top of the first, a bit higher than the ball diameter, so the ball can bounce but not very much and is not allowed to jump but is not blocked.
My issue is planes didn't stay parallel after applied to them the exact same angular velocity:
Code: Select all
//creation (sphere radius is 2.0)
ground = new Box(new BEPUutilities.Vector3(0, 0, 0), 100, 1, 100);
top_wall = new Box(new BEPUutilities.Vector3(0, 6f, 0), 100, 1, 100);
// in update:
//rotate them, x and z angles are two float inc/decremented by 0.5f increment
// angle are set only when key are pressed, otherwise angles = 0
ground.AngularVelocity = new BEPUutilities.Vector3(xangle, 0, zangle);
top_wall.AngularVelocity = new BEPUutilities.Vector3(xangle, 0, zangle);
What am I doing wrong ? What I've missed ?
I guess it could be some kind of center of rotation issue, where it is applied on both planes or something close.
Thanks.