Example #1
0
        public override void ComputeAABB(ref Transform transform, int childIndex, out AABB aabb)
        {
            Debug.Assert(childIndex < Vertices.Count);

            int i1 = childIndex;
            int i2 = childIndex + 1;

            if (i2 == Vertices.Count)
            {
                i2 = 0;
            }

            Vector2 v1 = Vertices[i1];
            Vector2 v2 = Vertices[i2];

            AABBHelper.ComputeEdgeAABB(ref v1, ref v2, ref transform, out aabb);
        }
Example #2
0
 public override void ComputeAABB(ref Transform transform, int childIndex, out AABB aabb)
 {
     AABBHelper.ComputeEdgeAABB(ref _vertex1, ref _vertex2, ref transform, out aabb);
 }
Example #3
0
 /// <summary>
 /// Given a transform, compute the associated axis aligned bounding box for a child shape.
 /// </summary>
 /// <param name="transform">The world transform of the shape.</param>
 /// <param name="childIndex">The child shape index.</param>
 /// <param name="aabb">The AABB results.</param>
 public override void ComputeAABB(ref Transform transform, int childIndex, out AABB aabb)
 {
     AABBHelper.ComputePolygonAABB(_vertices, ref transform, out aabb);
 }
Example #4
0
 public override void ComputeAABB(ref Transform transform, int childIndex, out AABB aabb)
 {
     AABBHelper.ComputeCircleAABB(ref _position, _radius, ref transform, out aabb);
 }