public virtual void UpdatePhysicalParameters()
{
if (!PhysBody.HasPhysicalBody)
{
// This would only happen if updates are called for during initialization when the body is not set up yet.
DetailLog("{0},BSPrim.UpdatePhysicalParameters,taint,calledWithNoPhysBody", LocalID);
return;
}
// Mangling all the physical properties requires the object not be in the physical world.
// This is a NOOP if the object is not in the world (BulletSim and Bullet ignore objects not found).
PhysicsScene.PE.RemoveObjectFromWorld(PhysicsScene.World, PhysBody);
// Set up the object physicalness (does gravity and collisions move this object)
MakeDynamic(IsStatic);
// Update vehicle specific parameters (after MakeDynamic() so can change physical parameters)
PhysicalActors.Refresh();
// Arrange for collision events if the simulator wants them
EnableCollisions(SubscribedEvents());
// Make solid or not (do things bounce off or pass through this object).
MakeSolid(IsSolid);
AddObjectToPhysicalWorld();
//Force selection properties
SelectObject(IsSelected);
// Rebuild its shape
PhysicsScene.PE.UpdateSingleAabb(PhysicsScene.World, PhysBody);
DetailLog(
"{0},BSPrim.UpdatePhysicalParameters,taintExit,static={1},solid={2},mass={3},collide={4},cf={5:X},cType={6},body={7},shape={8},pos={9}",
LocalID, IsStatic, IsSolid, Mass, SubscribedEvents(), CurrentCollisionFlags, PhysBody.collisionType,
PhysBody, PhysShape, PhysicsScene.PE.GetPosition(PhysBody));
}