Exemplo n.º 1
0
        /// <summary>
        /// Gets the AABB of the camera
        /// </summary>
        /// <returns></returns>
        public virtual gxtAABB GetViewAABB()
        {
            Vector2 r = halfWidthScreenExtents;
            float s = 1.0f / (screenScale + zoom);
            r *= s;
            gxtAABB scaledAABB = new gxtAABB(position, r);

            scaledAABB = scaledAABB.GetRotatedAABB(rotation);
            return scaledAABB;
        }
Exemplo n.º 2
0
 public gxtAABB GetAABB(Vector2 position, float rotation, Vector2 scale)
 {
     float rX = gxtMath.Abs(Origin.X * scale.X);
     float rY = gxtMath.Abs(Origin.Y * scale.Y);
     gxtAABB aabb = new gxtAABB(Vector2.Zero, new Vector2(rX, rY));
     aabb = aabb.GetRotatedAABB(rotation);
     aabb.Translate(position);
     return aabb;
 }