29 using System.Collections.Generic;
33 using OpenSim.Region.PhysicsModules.SharedBase;
35 using OMV = OpenMetaverse;
37 namespace OpenSim.Region.PhysicsModule.BulletS
44 : base(physicsScene, pObj, actorName)
47 m_physicsScene.DetailLog(
"{0},BSActorSetTorque,constructor", m_controllingPrim.LocalID);
51 public override bool isActive
53 get {
return Enabled && m_controllingPrim.IsPhysicallyActive; }
61 DeactivateSetTorque();
69 m_physicsScene.DetailLog(
"{0},BSActorSetTorque,refresh,torque={1}", m_controllingPrim.LocalID, m_controllingPrim.RawTorque);
72 if (m_controllingPrim.RawTorque ==
OMV.Vector3.Zero)
74 m_physicsScene.DetailLog(
"{0},BSActorSetTorque,refresh,notSetTorque,disabling={1}", m_controllingPrim.LocalID, ActorName);
86 DeactivateSetTorque();
100 private void ActivateSetTorque()
102 if (m_torqueMotor == null)
105 m_torqueMotor =
new BSFMotor(
"setTorque", 1f, 1f, 1f);
107 m_physicsScene.BeforeStep += Mover;
111 private void DeactivateSetTorque()
113 if (m_torqueMotor != null)
115 m_physicsScene.BeforeStep -= Mover;
116 m_torqueMotor = null;
121 private void Mover(
float timeStep)
127 m_physicsScene.DetailLog(
"{0},BSActorSetTorque,preStep,force={1}", m_controllingPrim.LocalID, m_controllingPrim.RawTorque);
128 if (m_controllingPrim.PhysBody.HasPhysicalBody)
130 m_controllingPrim.AddAngularForce(
true , m_controllingPrim.RawTorque);
131 m_controllingPrim.ActivateIfPhysical(
false);
BSActorSetTorque(BSScene physicsScene, BSPhysObject pObj, string actorName)
Each physical object can have 'actors' who are pushing the object around. This can be used for hover...
override void RemoveDependencies()