34 int numVerts = pVtxIn.
size();
41 ds = planeNormalWS.dot(firstVertex) + planeEqWS;
43 for (ve = 0; ve < numVerts; ve++)
45 endVertex = pVtxIn[ve];
47 de = planeNormalWS.dot(endVertex) + planeEqWS;
71 firstVertex = endVertex;
83 hullA.project(transA, sep_axis, Min0, Max0, witnesPtMinA, witnesPtMaxA);
84 hullB.project(transB, sep_axis, Min1, Max1, witnesPtMinB, witnesPtMaxB);
86 if (Max0 < Min1 || Max1 < Min0)
96 witnessPointA = witnesPtMaxA;
97 witnessPointB = witnesPtMinB;
102 witnessPointA = witnesPtMinA;
103 witnessPointB = witnesPtMaxB;
117 #ifdef TEST_INTERNAL_OBJECTS
125 p[0] = sv[0] < 0.0f ? -extents[0] : extents[0];
126 p[1] = sv[1] < 0.0f ? -extents[1] : extents[1];
127 p[2] = sv[2] < 0.0f ? -extents[2] : extents[2];
137 const btScalar x = r0.x() * in.x() + r1.x() * in.y() + r2.x() * in.z();
138 const btScalar y = r0.y() * in.x() + r1.y() * in.y() + r2.y() * in.z();
139 const btScalar z = r0.z() * in.x() + r1.z() * in.y() + r2.z() * in.z();
146 const btScalar dp = delta_c.dot(axis);
149 InverseTransformPoint3x3(localAxis0, axis, trans0);
151 InverseTransformPoint3x3(localAxis1, axis, trans1);
154 BoxSupport(convex0.m_extents, localAxis0, p0);
156 BoxSupport(convex1.m_extents, localAxis1, p1);
158 const btScalar Radius0 = p0[0] * localAxis0.x() + p0[1] * localAxis0.y() + p0[2] * localAxis0.z();
159 const btScalar Radius1 = p1[0] * localAxis1.x() + p1[1] * localAxis1.y() + p1[2] * localAxis1.z();
161 const btScalar MinRadius = Radius0 > convex0.m_radius ? Radius0 : convex0.m_radius;
162 const btScalar MaxRadius = Radius1 > convex1.m_radius ? Radius1 : convex1.m_radius;
164 const btScalar MinMaxRadius = MaxRadius + MinRadius;
165 const btScalar d0 = MinMaxRadius + dp;
166 const btScalar d1 = MinMaxRadius - dp;
168 const btScalar depth = d0 < d1 ? d0 : d1;
190 btScalar denom = 1.0f - dirA_dot_dirB * dirA_dot_dirB;
198 tA = (dirA_dot_trans - dirB_dot_trans * dirA_dot_dirB) / denom;
205 tB = tA * dirA_dot_dirB - dirB_dot_trans;
210 tA = tB * dirA_dot_dirB + dirA_dot_trans;
220 tA = tB * dirA_dot_dirB + dirA_dot_trans;
233 ptsVector = translation - offsetA + offsetB;
241 const btVector3 c0 = transA * hullA.m_localCenter;
242 const btVector3 c1 = transB * hullB.m_localCenter;
247 int curPlaneTests = 0;
249 int numFacesA = hullA.m_faces.size();
251 for (
int i = 0; i < numFacesA; i++)
253 const btVector3 Normal(hullA.m_faces[i].m_plane[0], hullA.m_faces[i].m_plane[1], hullA.m_faces[i].m_plane[2]);
255 if (DeltaC2.dot(faceANormalWS) < 0)
256 faceANormalWS *= -1.f;
259 #ifdef TEST_INTERNAL_OBJECTS
261 if (
gUseInternalObject && !TestInternalObjects(transA, transB, DeltaC2, faceANormalWS, hullA, hullB, dmin))
268 if (!
TestSepAxis(hullA, hullB, transA, transB, faceANormalWS, d, wA, wB))
278 int numFacesB = hullB.m_faces.size();
280 for (
int i = 0; i < numFacesB; i++)
282 const btVector3 Normal(hullB.m_faces[i].m_plane[0], hullB.m_faces[i].m_plane[1], hullB.m_faces[i].m_plane[2]);
284 if (DeltaC2.dot(WorldNormal) < 0)
288 #ifdef TEST_INTERNAL_OBJECTS
290 if (
gUseInternalObject && !TestInternalObjects(transA, transB, DeltaC2, WorldNormal, hullA, hullB, dmin))
297 if (!
TestSepAxis(hullA, hullB, transA, transB, WorldNormal, d, wA, wB))
307 btVector3 edgeAstart, edgeAend, edgeBstart, edgeBend;
312 btVector3 witnessPointA(0, 0, 0), witnessPointB(0, 0, 0);
316 for (
int e0 = 0; e0 < hullA.m_uniqueEdges.size(); e0++)
318 const btVector3 edge0 = hullA.m_uniqueEdges[e0];
319 const btVector3 WorldEdge0 = transA.getBasis() * edge0;
320 for (
int e1 = 0; e1 < hullB.m_uniqueEdges.size(); e1++)
322 const btVector3 edge1 = hullB.m_uniqueEdges[e1];
323 const btVector3 WorldEdge1 = transB.getBasis() * edge1;
330 if (DeltaC2.dot(
Cross) < 0)
333 #ifdef TEST_INTERNAL_OBJECTS
351 worldEdgeA = WorldEdge0;
352 worldEdgeB = WorldEdge1;
360 if (edgeA >= 0 && edgeB >= 0)
371 btVector3 translation = witnessPointB - witnessPointA;
384 btScalar nlSqrt = ptsVector.length2();
388 ptsVector *= 1.f / nl;
389 if (ptsVector.dot(DeltaC2) < 0.f)
393 btVector3 ptOnB = witnessPointB + offsetB;
399 if ((DeltaC2.dot(sep)) < 0.0f)
412 int closestFaceA = -1;
415 for (
int face = 0; face < hullA.m_faces.size(); face++)
417 const btVector3 Normal(hullA.m_faces[face].m_plane[0], hullA.m_faces[face].m_plane[1], hullA.m_faces[face].m_plane[2]);
420 btScalar d = faceANormalWS.dot(separatingNormal);
428 if (closestFaceA < 0)
431 const btFace& polyA = hullA.m_faces[closestFaceA];
435 for (
int e0 = 0; e0 < numVerticesA; e0++)
440 const btVector3 WorldEdge0 = transA.getBasis() * edge0;
443 btVector3 planeNormalWS1 = -WorldEdge0.cross(worldPlaneAnormal1);
445 btScalar planeEqWS1 = -worldA1.dot(planeNormalWS1);
449 int otherFace = polyA.m_connectedFaces[e0];
450 btVector3 localPlaneNormal(hullA.m_faces[otherFace].m_plane[0], hullA.m_faces[otherFace].m_plane[1], hullA.m_faces[otherFace].m_plane[2]);
451 btScalar localPlaneEq = hullA.m_faces[otherFace].m_plane[3];
453 btVector3 planeNormalWS = transA.getBasis() * localPlaneNormal;
454 btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.getOrigin());
456 btVector3 planeNormalWS = planeNormalWS1;
462 clipFace(*pVtxIn, *pVtxOut, planeNormalWS, planeEqWS);
475 btVector3 planeNormalWS = transA.getBasis() * localPlaneNormal;
476 btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.getOrigin());
477 for (
int i = 0; i < pVtxIn->
size(); i++)
480 btScalar depth = planeNormalWS.dot(vtx) + planeEqWS;
481 if (depth <= minDist)
487 if (depth <= maxDist)
490 #ifdef ONLY_REPORT_DEEPEST_POINT
496 printf(
"error in btPolyhedralContactClipping depth = %f\n", depth);
497 printf(
"likely wrong separatingNormal passed in\n");
505 #ifdef ONLY_REPORT_DEEPEST_POINT
506 if (curMaxDist < maxDist)
515 btVector3 separatingNormal = separatingNormal1.normalized();
520 int closestFaceB = -1;
523 for (
int face = 0; face < hullB.m_faces.size(); face++)
525 const btVector3 Normal(hullB.m_faces[face].m_plane[0], hullB.m_faces[face].m_plane[1], hullB.m_faces[face].m_plane[2]);
527 btScalar d = WorldNormal.dot(separatingNormal);
537 const btFace& polyB = hullB.m_faces[closestFaceB];
546 if (closestFaceB >= 0)
547 clipFaceAgainstHull(separatingNormal, hullA, transA, worldVertsB1, worldVertsB2, minDist, maxDist, resultOut);
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Normal
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
SIMD_FORCE_INLINE btScalar btFabs(btScalar x)
SIMD_FORCE_INLINE btScalar btSqrt(btScalar y)
#define SIMD_FORCE_INLINE
SIMD_FORCE_INLINE void btSwap(T &a, T &b)
static btMatrix3x3 Cross(const btVector3 &v)
SIMD_FORCE_INLINE btScalar btDot(const btVector3 &v1, const btVector3 &v2)
Return the dot product between two vectors.
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE void reserve(int _Count)
SIMD_FORCE_INLINE const T & at(int n) const
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
T distance(const T &a, const T &b)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)=0
btAlignedObjectArray< int > m_indices