public BSActorAvatarMove(BSScene physicsScene, BSPhysObject pObj, string actorName) : base(physicsScene, pObj, actorName) { m_velocityMotor = null; m_walkingUpStairs = 0; m_physicsScene.DetailLog("{0},BSActorAvatarMove,constructor", m_controllingPrim.LocalID); }
// If a hover motor has not been created, create one and start the hovering. private void ActivateMoveToTarget() { if (m_targetMotor == null) { // We're taking over after this. m_controllingPrim.ZeroMotion(true); /* TODO !!!!! * m_targetMotor = new BSPIDVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString()); * m_targetMotor.TimeScale = m_controllingPrim.MoveToTargetTau; * m_targetMotor.Efficiency = 1f; */ m_targetMotor = new BSVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString(), m_controllingPrim.MoveToTargetTau, BSMotor.Infinite, 1f); m_targetMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG so motor will output detail log messages. m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget); m_targetMotor.SetCurrent(m_controllingPrim.RawPosition); m_physicsScene.BeforeStep += Mover; // m_phsyicsScene.BeforStep += Mover2; // Mover2 not possible with BulletSim 2.80 } else { // If already allocated, make sure the target and other parameters are current m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget); m_targetMotor.SetCurrent(m_controllingPrim.RawPosition); } }
private void DeactivateMoveToTarget() { if (m_targetMotor != null) { m_physicsScene.BeforeStep -= Mover; m_targetMotor = null; } }
private void DeactivateAvatarMove() { if (m_velocityMotor != null) { m_physicsScene.BeforeStep -= Mover; m_velocityMotor = null; } }
// If a hover motor has not been created, create one and start the hovering. private void ActivateAvatarMove() { if (m_velocityMotor == null) { // Infinite decay and timescale values so motor only changes current to target values. m_velocityMotor = new BSVMotor("BSCharacter.Velocity", 0.2f, // time scale BSMotor.Infinite, // decay time scale 1f // efficiency ); // BSParam.AvatarStopZeroThreshold not included in BulletSim 2.80 :( // _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages. SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */, 0); m_physicsScene.BeforeStep += Mover; // Process_OnPreUpdateProperty not included in BulletSim 2.80 :( m_walkingUpStairs = 0; } }
public BSActorMoveToTarget(BSScene physicsScene, BSPhysObject pObj, string actorName) : base(physicsScene, pObj, actorName) { m_targetMotor = null; m_physicsScene.DetailLog("{0},BSActorMoveToTarget,constructor", m_controllingPrim.LocalID); }
// If a hover motor has not been created, create one and start the hovering. private void ActivateMoveToTarget() { if (m_targetMotor == null) { // We're taking over after this. m_controllingPrim.ZeroMotion(true); /* TODO !!!!! m_targetMotor = new BSPIDVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString()); m_targetMotor.TimeScale = m_controllingPrim.MoveToTargetTau; m_targetMotor.Efficiency = 1f; */ m_targetMotor = new BSVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString(), m_controllingPrim.MoveToTargetTau, BSMotor.Infinite, 1f); m_targetMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG so motor will output detail log messages. m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget); m_targetMotor.SetCurrent(m_controllingPrim.RawPosition); m_physicsScene.BeforeStep += Mover; // m_phsyicsScene.BeforStep += Mover2; // Mover2 not possible with BulletSim 2.80 } else { // If already allocated, make sure the target and other parameters are current m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget); m_targetMotor.SetCurrent(m_controllingPrim.RawPosition); } }