Ejemplo n.º 1
0
		public void SetLocalPosition (long x, long y)
		{
			if (HasParent)
			{
				LocalPosition = Position - _parent.Position;
				LocalPosition.RotateInverse(_parent.Rotation.x,_parent.Rotation.y);
				PositionChanged = true;
			}
		}
Ejemplo n.º 2
0
 public void UpdateRotation()
 {
     if (HasParent)
     {
         Rotation = LocalRotation;
         Rotation.RotateInverse(_parent.Rotation.x, _parent.Rotation.y);
         RotationChanged = true;
     }
 }
Ejemplo n.º 3
0
 public void UpdatePosition()
 {
     if (HasParent)
     {
         Position = LocalPosition;
         Position.RotateInverse(_parent.Rotation.x, _parent.Rotation.y);
         Position       += _parent.Position;
         PositionChanged = true;
     }
 }
Ejemplo n.º 4
0
        void Reset()
        {
            LSBody body = this.GetComponent <LSBody> ();

            if (body.Shape == ColliderType.Polygon)
            {
                this._points = new Vector2d[body.Vertices.Length];
                for (int i = 0; i < _points.Length; i++)
                {
                    Vector2d point = body.Vertices[i];
                    point.RotateInverse(0, FixedMath.One);
                    _points[i] = point;
                }
            }
        }
Ejemplo n.º 5
0
 public void SetPosition(long x, long y)
 {
     Position.x = x;
     Position.y = y;
     PositionChanged = true;
     if (HasParent)
     {
         LocalPosition = Position - _parent.Position;
         LocalPosition.RotateInverse(_parent.Rotation.x,_parent.Rotation.y);
     }
 }
Ejemplo n.º 6
0
 public Vector2d TransformDirection(Vector2d worldPos)
 {
     worldPos -= _position;
     worldPos.RotateInverse(_rotation.x, _rotation.y);
     return(worldPos);
 }