Universe.Region.SceneObjectGroup.GrabMovement C# (CSharp) Method

GrabMovement() public method

If object is physical, apply force to move it around If object is not physical, just put it at the resulting location
public GrabMovement ( System.Vector3 offset, System.Vector3 pos, IClientAPI remoteClient ) : void
offset System.Vector3 Always seems to be 0,0,0, so ignoring
pos System.Vector3 New position. We do the math here to turn it into a force
remoteClient IClientAPI
return void
        public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient)
        {
            if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
            {
                if (m_rootPart.PhysActor != null)
                {
                    if (m_rootPart.PhysActor.IsPhysical)
                    {
                        if (!m_rootPart.BlockGrab && !m_rootPart.BlockGrabObject)
                        {
                            Vector3 grabforce = pos - AbsolutePosition;
                            grabforce = grabforce*m_rootPart.PhysActor.Mass;
                            m_rootPart.PhysActor.AddForce(grabforce, true);
                            // This is outside the above permissions condition
                            // so that if the object is locked the client moving the object
                            // get's it's position on the simulator even if it was the same as before
                            // This keeps the moving user's client in sync with the rest of the world.
                            ScheduleGroupTerseUpdate();
                        }
                    }
                }
            }
        }
SceneObjectGroup