13template <
typename ConvexObject>
30 template <
class VERTEX_ARRAY>
35 for (
Vec3 &v : outVertices)
44template <
typename ConvexObject>
56 float length = inDirection.
Length();
57 return length > 0.0f ?
mObject.GetSupport(inDirection) + (
mRadius / length) * inDirection :
mObject.GetSupport(inDirection);
65template <
typename ConvexObjectA,
typename ConvexObjectB>
111 float d1 =
mV1.
Dot(inDirection);
112 float d2 =
mV2.
Dot(inDirection);
113 float d3 =
mV3.
Dot(inDirection);
133 template <
class VERTEX_ARRAY>
136 outVertices.push_back(
mV1);
137 outVertices.push_back(
mV2);
138 outVertices.push_back(
mV3);
148template <
class VERTEX_ARRAY>
161 float best_dot =
mVertices[0].Dot(inDirection);
163 for (
typename VERTEX_ARRAY::const_iterator v =
mVertices.begin() + 1; v <
mVertices.end(); ++v)
165 float dot = v->Dot(inDirection);
173 return support_point;
177 template <
class VERTEX_ARRAY_ARG>
181 outVertices.push_back(v);
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
JPH_INLINE Vec3 Multiply3x3Transposed(Vec3Arg inV) const
Multiply vector by only 3x3 part of the transpose of the matrix ( )
Definition: Mat44.inl:336
JPH_INLINE float Dot(Vec3Arg inV2) const
Dot product.
Definition: Vec3.inl:649
JPH_INLINE float Length() const
Length of vector.
Definition: Vec3.inl:681
Structure that adds a convex radius.
Definition: ConvexSupport.h:46
const ConvexObject & mObject
Definition: ConvexSupport.h:60
AddConvexRadius(const ConvexObject &inObject, float inRadius)
Definition: ConvexSupport.h:47
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition: ConvexSupport.h:54
float mRadius
Definition: ConvexSupport.h:61
Structure that performs a Minkowski difference A - B.
Definition: ConvexSupport.h:67
MinkowskiDifference(const ConvexObjectA &inObjectA, const ConvexObjectB &inObjectB)
Definition: ConvexSupport.h:68
const ConvexObjectA & mObjectA
Definition: ConvexSupport.h:80
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition: ConvexSupport.h:75
const ConvexObjectB & mObjectB
Definition: ConvexSupport.h:81
Class that wraps a point so that it can be used with convex collision detection.
Definition: ConvexSupport.h:86
Vec3 mPoint
Definition: ConvexSupport.h:93
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition: ConvexSupport.h:88
Class that wraps a polygon so that it can used with convex collision detection.
Definition: ConvexSupport.h:150
void GetSupportingFace(Vec3Arg inDirection, VERTEX_ARRAY_ARG &outVertices) const
Get the vertices of the face that faces inDirection the most.
Definition: ConvexSupport.h:178
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition: ConvexSupport.h:158
PolygonConvexSupport(const VERTEX_ARRAY &inVertices)
Constructor.
Definition: ConvexSupport.h:152
const VERTEX_ARRAY & mVertices
The vertices of the polygon.
Definition: ConvexSupport.h:185
Class that wraps a triangle so that it can used with convex collision detection.
Definition: ConvexSupport.h:98
Vec3 mV1
The three vertices of the triangle.
Definition: ConvexSupport.h:142
Vec3 mV3
Definition: ConvexSupport.h:144
void GetSupportingFace(Vec3Arg inDirection, VERTEX_ARRAY &outVertices) const
Get the vertices of the face that faces inDirection the most.
Definition: ConvexSupport.h:134
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition: ConvexSupport.h:108
Vec3 mV2
Definition: ConvexSupport.h:143
TriangleConvexSupport(Vec3Arg inV1, Vec3Arg inV2, Vec3Arg inV3)
Constructor.
Definition: ConvexSupport.h:100