BulletSim: move the creation of the avatar movement actor creating to

taint time. Attempt to fix a problem of teleporting within the same
region where the remove and addition of the physical avatar occasionally
ends up with a non-moving avatar.
0.7.6-extended
Robert Adams 2013-08-13 21:06:24 -07:00
parent 5933f9448d
commit 0feb5da31e
1 changed files with 7 additions and 7 deletions

View File

@ -89,13 +89,6 @@ public sealed class BSCharacter : BSPhysObject
// set _avatarVolume and _mass based on capsule size, _density and Scale // set _avatarVolume and _mass based on capsule size, _density and Scale
ComputeAvatarVolumeAndMass(); ComputeAvatarVolumeAndMass();
// The avatar's movement is controlled by this motor that speeds up and slows down
// the avatar seeking to reach the motor's target speed.
// This motor runs as a prestep action for the avatar so it will keep the avatar
// standing as well as moving. Destruction of the avatar will destroy the pre-step action.
m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName);
PhysicalActors.Add(AvatarMoveActorName, m_moveActor);
DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5},pos={6}", DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5},pos={6}",
LocalID, _size, Scale, Density, _avatarVolume, RawMass, pos); LocalID, _size, Scale, Density, _avatarVolume, RawMass, pos);
@ -106,6 +99,13 @@ public sealed class BSCharacter : BSPhysObject
// New body and shape into PhysBody and PhysShape // New body and shape into PhysBody and PhysShape
PhysScene.Shapes.GetBodyAndShape(true, PhysScene.World, this); PhysScene.Shapes.GetBodyAndShape(true, PhysScene.World, this);
// The avatar's movement is controlled by this motor that speeds up and slows down
// the avatar seeking to reach the motor's target speed.
// This motor runs as a prestep action for the avatar so it will keep the avatar
// standing as well as moving. Destruction of the avatar will destroy the pre-step action.
m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName);
PhysicalActors.Add(AvatarMoveActorName, m_moveActor);
SetPhysicalProperties(); SetPhysicalProperties();
}); });
return; return;