Esempio n. 1
0
        public Vector3 GetWorldPosition()
        {
            Vector3    pos;
            Quaternion rot;
            Vector3    scl;

            WorldTransformations.Decompose(out scl, out rot, out pos);
            return(pos);
        }
Esempio n. 2
0
        /// <summary>
        /// Determine if the world point falls within the sprite's bounds.
        /// </summary>
        public bool Contains(Vector2 point)
        {
            point = WorldTransformations.Localize(point);

            Vector2 origin = new Vector2(Size.X * Origin.X, Size.Y * Origin.Y);

            point += origin;

            if (point.X >= 0 && point.X <= Size.X && point.Y >= 0 && point.Y <= Size.Y)
            {
                return(true);
            }

            return(false);
        }