CureCure / bulletsharp

Automatically exported from code.google.com/p/bulletsharp
0 stars 0 forks source link

Moving Kinematic object destroys collision relationships #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create some dynamic bodies
2. Create a kinematic floor (I used a  box)
3. Move the floor up by some small amount every frame.

What is the expected output? What do you see instead?

I expect to see the dynamic bodies move up with the floor, once they have 
landed on it. Instead, the all fall through. After some research on the Bullet 
forums, it seems that you need to use the getWorldTransform() and the 
setWorldTransfrom() methods. However, the setWorldTransform() method does not 
exist. Also, while BulletSharp allows you to write to the WorldTransform 
property, it doesn't seem to work (i.e. next frame it forgets that it was 
written to). Attached is a sample file.

What version of the product are you using? On what operating system?

Bullet 2.82, BulletSharp r567, Windows 7, VS2012.

Please provide any additional information below.

Original issue reported on code.google.com by daniel.h...@meshconsultants.ca on 4 Dec 2013 at 2:52

Attachments:

GoogleCodeExporter commented 9 years ago
Ah! You have to multiply the WorldTransforms i.e.

rbody.MotionState.WorldTransfrom *= Matrix.Translation(0.1*Vector3.Up);

then it works great.

Original comment by daniel.h...@meshconsultants.ca on 4 Dec 2013 at 3:58