public Vector3 GetTorque()
{
// We check if rootpart is null here because scripts don't delete if you delete the host.
// This means that unfortunately, we can pass a null physics actor to Simulate!
// Make sure we don't do that!
SceneObjectPart rootpart = m_rootPart;
if (rootpart != null)
{
if (rootpart.PhysActor != null)
{
if (!IsAttachment)
{
Vector3 torque = rootpart.PhysActor.Torque;
return torque;
}
}
}
return Vector3.Zero;
}