Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.SetPos C# (CSharp) Method

SetPos() protected method

protected SetPos ( ISceneChildEntity part, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 targetPos, bool checkPos ) : void
part ISceneChildEntity
targetPos Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
checkPos bool
return void
        protected void SetPos(ISceneChildEntity part, LSL_Vector targetPos, bool checkPos)
        {
            // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
            LSL_Vector currentPos = GetPartLocalPos(part);
            float ground = 0;
            bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true);

            ITerrainChannel heightmap = World.RequestModuleInterface<ITerrainChannel>();
            if (heightmap != null)
                ground = heightmap.GetNormalizedGroundHeight((int)(float)targetPos.x, (int)(float)targetPos.y);
            if (part.ParentEntity == null)
                return;
            if (part.ParentEntity.RootChild == part)
            {
                ISceneEntity parent = part.ParentEntity;
                if (!part.IsAttachment)
                {
                    if (ground != 0 && (targetPos.z < ground) && disable_underground_movement)
                        targetPos.z = ground;
                }
                LSL_Vector real_vec = checkPos ? SetPosAdjust(currentPos, targetPos) : targetPos;
                parent.UpdateGroupPosition(new Vector3((float)real_vec.x, (float)real_vec.y, (float)real_vec.z), true);
            }
            else
            {
                LSL_Vector rel_vec = checkPos ? SetPosAdjust(currentPos, targetPos) : targetPos;
                part.FixOffsetPosition((new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z)), true);
            }
        }
LSL_Api