SharpDx / Bepu integration
SharpDx / Bepu integration
I'm having some problem with sharpdx and bepu. Do you have any idea how to convert the worltransform value properly the object keep rotation in a weird way. Maybe it's a problem with the static object because at the beginning of the simulation everything works just fine. Basically I spawn 40 cubes in a random position over a static mesh which is 60 by 60, with a height of 10. I use for the surface ( floor) and the box a simple entity prefab box. So when the first collision occurs nothing seems weird but then the box start floating around and I really don't know what's wrong. I basically followed the basic example and use a box created in the code to draw the boxes.
Re: SharpDx / Bepu integration
The 'box floating around' thing sounds like the graphic is offset from the collision shape. This will happen if, for example, the box model's origin is at the bottom of the box. Since the box shape's origin is in the center, the graphical model will be misaligned by half of the width of the box. To fix that, ensure that the graphical model has the same origin as the physics shape. This can be done either at content building time or by using a local graphics offset to bring it into alignment with the local space of the physics shape before applying the world transform.
Re: SharpDx / Bepu integration
Ok, I'll try to look into it. But the problem is that I did try with both importer model ( using a one to one model) and a generated model with vertices matching the size of the box so I'm not sure if the problem lies in this area. I'll try to keep looking. But basically the problem is not coming from the conversion bepu to sharpDx. That's a good news.
Re: SharpDx / Bepu integration
I did try the bepu drawer helper but the result is the same. So I still don't understand what could be the problem. I just follow the basic setup example. But I got the weird swimming behavior from the box shape.
Re: SharpDx / Bepu integration
Unfortunately, I don't have enough information to provide much more assistance; I am not sure if what I am visualizing is even close to what you see.