i have a box entity, it free fall,
but when it collision with land, position still always change a little
i set bounciness = 0 for both box and land, but i think it still have elastic
how to remove elastic when free fall? how to position dont change when collision land?
thanks
Code: Select all
Space.ForceUpdater.Gravity = new Vector3(0, -10f, 0);
var box = new Box(new Vector(0, 5, 0), 0.5f, 0.5f, 0.5f, 1);
box.Material = new BEPUphysics.Materials.Material(1, 1, 0);
Space.Add(box);
var ground = new Box(new Vector3(0, -0.5f, 0f), 100, 1, 100, 1);
ground.BecomeKinematic();
ground.Material = new BEPUphysics.Materials.Material(1, 1, 0);
Space.Add(ground);
public override void Update(float dt)
{
oldPos3 = box.Position;
base.Update(dt);
if (oldPos3 != box.Position)
Console.WriteLine(" oldPos3:" + oldPos3 + " box.Position:" + box.Position + " box.LinearVelocity:" + box.LinearVelocity);
}