// If a hover motor has not been created, create one and start the hovering. 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, m_controllingPrim.MoveToTargetTau, // timeScale BSMotor.Infinite, // decay time scale 1f // efficiency ); 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_physicsScene.BeforeStep += Mover2; } 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); } }
void SetVelocityAndTargetInternal(OMV.Vector3 vel, OMV.Vector3 targ, bool inTaintTime, int targetValueDecayTimeScale) { m_physicsScene.TaintedObject(inTaintTime, m_controllingPrim.LocalID, "BSActorAvatarMove.setVelocityAndTarget", delegate() { if (m_velocityMotor != null) { m_velocityMotor.Reset(); m_velocityMotor.SetTarget(targ); m_velocityMotor.SetCurrent(vel); m_velocityMotor.TargetValueDecayTimeScale = targetValueDecayTimeScale; m_velocityMotor.Enabled = true; } }); }
// If a hover motor has not been created, create one and start the hovering. 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, m_controllingPrim.MoveToTargetTau, // timeScale BSMotor.Infinite, // decay time scale 1f // efficiency ); 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_physicsScene.BeforeStep += Mover2; } 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); } }