예제 #1
0
        public Vec3 GetPivotPoint(Vec3 center, AABB bounds, Pivot pivot)
        {
            Vec3 vec = center;
            switch (pivot)
            {
                case Pivot.Left:
                    return (vec + ((Vec3)(this.axisX * bounds.min.X)));

                case Pivot.Right:
                    return (vec + ((Vec3)(this.axisX * bounds.max.X)));

                case Pivot.Down:
                    return (vec + ((Vec3)(this.axisY * bounds.min.Y)));

                case Pivot.Up:
                    return (vec + ((Vec3)(this.axisY * bounds.max.Y)));
            }
            return vec;
        }
예제 #2
0
 public Vec3 GetPivotPoint(Pivot pivot)
 {
     AABB localBounds;
     if (this.IsLoaded)
     {
         localBounds = this.LocalBounds;
     }
     else
     {
         localBounds = new AABB();
     }
     return this.Axis.GetPivotPoint(this.Position, localBounds, pivot);
 }