This is what I am using based on the CharacterController method:
Code: Select all
Vector3 position = Parent.Position;
position.X = value;
Parent.Entity.Position = position;
var orientation = Parent.Entity.Orientation;
// The re-do of contacts won't do anything unless we update the collidable's world transform
Parent.Entity.CollisionInformation.UpdateWorldTransform(ref position, ref orientation);
// Refresh all the narrow phase collisions
int numPairs = Parent.Entity.CollisionInformation.Pairs.Count;
for (int i = 0; i < numPairs; ++i)
{
// Clear out the old contacts
// This prevents contacts in persistent manifolds from surviving the step
// Old contacts might still have old normals which block motion
Parent.Entity.CollisionInformation.Pairs[i].ClearContacts();
Parent.Entity.CollisionInformation.Pairs[i].UpdateCollision((float)gameTime.ElapsedGameTime.TotalSeconds);
}