I have added things into the physics Space to form the worlds obstacles, like walls and floor. They are all put into an Entity as elements of a compoundShapes with mass 0.0f.
And I have a box which I can move around by applying forces upon it (similar to the characterController).
This works fine on these objects.
But then I add some more objects in the same manner and on those objects the box gets very 'sticky'.
I checked the debug draw and everything seems to be fine (no out of place/overlapping).
This is how I add the things, which work fine:
Code: Select all
using Microsoft.Xna.Framework;
using BEPUphysics.CollisionShapes;
using BEPUphysics.CollisionShapes.ConvexShapes;
using BEPUphysics.Entities;
...
var shapes = new List<CompoundShapeEntry>();
for (each of some 'size' and 'trans' I defined)
{
Vector3 pos = trans.Translation;
Quaternion orientation = Quaternion.CreateFromRotationMatrix(trans);
var box = new BoxShape(size.X, size.Y, size.Z);
shapes.Add(new CompoundShapeEntry(box, new BEPUutilities.RigidTransform(pos, orientation)));
}
Xna.Vector3 centerOffset;
CompoundShape compoundShape = new CompoundShape(shapes, out centerOffset);
var rigidBody = new Entity(compoundShape, 0.0f);
rigidBody.Position = centerOffset;
_physicSpace.Add(rigidBody);
DebugDrawer.Add(rigidBody);
the only difference is that they are put into other lists of shapes and added afterwords, but again by the very same code. Is there any restriction that there can only be one object with mass 0.0f?
What else can mess up the contact/friction behavior?
Best regards,
Nablabla
== Edit ==
my box slides over all of the compoundShape entity, very slippery, but on some it seems to be glued to
To define "sticky": It does turn a bit (so the force is defenitely present) but it hangs on its edges, which are not moving at all, not even drifting.