15 #ifdef DEBUG_INTERNAL_EDGE
19 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
24 gDebugDrawer = debugDrawer;
68 int sharedVertsA[3] = {-1, -1, -1};
69 int sharedVertsB[3] = {-1, -1, -1};
82 printf(
"triangle A[0] = (%f,%f,%f)\ntriangle A[1] = (%f,%f,%f)\ntriangle A[2] = (%f,%f,%f)\n",
87 printf(
"partId=%d, triangleIndex=%d\n",partId,triangleIndex);
88 printf(
"triangle B[0] = (%f,%f,%f)\ntriangle B[1] = (%f,%f,%f)\ntriangle B[2] = (%f,%f,%f)\n",
89 triangle[0].
getX(),triangle[0].
getY(),triangle[0].
getZ(),
90 triangle[1].
getX(),triangle[1].
getY(),triangle[1].
getZ(),
91 triangle[2].
getX(),triangle[2].
getY(),triangle[2].
getZ());
94 for (
int i = 0; i < 3; i++)
96 for (
int j = 0; j < 3; j++)
100 sharedVertsA[numshared] = i;
101 sharedVertsB[numshared] = j;
127 if (sharedVertsA[0] == 0 && sharedVertsA[1] == 2)
131 int tmp = sharedVertsB[1];
132 sharedVertsB[1] = sharedVertsB[0];
133 sharedVertsB[0] = tmp;
146 int sumvertsA = sharedVertsA[0] + sharedVertsA[1];
147 int otherIndexA = 3 - sumvertsA;
152 int otherIndexB = 3 - (sharedVertsB[0] + sharedVertsB[1]);
154 btTriangleShape tB(triangle[sharedVertsB[1]], triangle[sharedVertsB[0]], triangle[otherIndexB]);
159 tA.calcNormal(normalA);
160 tB.calcNormal(normalB);
162 btVector3 edgeCrossA = edge.cross(normalA).normalize();
166 if (edgeCrossA.dot(tmp) < 0)
172 btVector3 edgeCrossB = edge.cross(normalB).normalize();
175 btVector3 tmp = triangle[otherIndexB] - triangle[sharedVertsB[0]];
176 if (edgeCrossB.dot(tmp) < 0)
185 btVector3 calculatedEdge = edgeCrossA.cross(edgeCrossB);
186 btScalar len2 = calculatedEdge.length2();
192 if (len2 < m_triangleInfoMap->m_planarEpsilon)
199 calculatedEdge.normalize();
200 btVector3 calculatedNormalA = calculatedEdge.cross(edgeCrossA);
201 calculatedNormalA.normalize();
202 angle2 =
btGetAngle(calculatedNormalA, edgeCrossA, edgeCrossB);
204 btScalar dotA = normalA.dot(edgeCrossB);
208 correctedAngle =
isConvex ? ang4 : -ang4;
221 btScalar bla = computedNormalB.dot(normalB);
224 computedNormalB *= -1;
227 #ifdef DEBUG_INTERNAL_EDGE
228 if ((computedNormalB - normalB).
length() > 0.0001)
230 printf(
"warning: normals not identical\n");
245 if (computedNormalB.dot(normalB) < 0)
247 computedNormalB *= -1;
251 #ifdef DEBUG_INTERNAL_EDGE
252 if ((computedNormalB - normalB).
length() > 0.0001)
254 printf(
"warning: normals not identical\n");
267 if (computedNormalB.dot(normalB) < 0)
270 computedNormalB *= -1;
272 #ifdef DEBUG_INTERNAL_EDGE
273 if ((computedNormalB - normalB).
length() > 0.0001)
275 printf(
"warning: normals not identical\n");
311 connectivityProcessor.
m_partIdA = partId;
318 aabbMin.setMin(triangle[0]);
319 aabbMax.setMax(triangle[0]);
320 aabbMin.setMin(triangle[1]);
321 aabbMax.setMax(triangle[1]);
322 aabbMin.setMin(triangle[2]);
323 aabbMax.setMax(triangle[2]);
334 if (trimeshShape->getTriangleInfoMap())
337 trimeshShape->setTriangleInfoMap(triangleInfoMap);
340 const btVector3& meshScaling = meshInterface->getScaling();
342 for (
int partId = 0; partId < meshInterface->getNumSubParts(); partId++)
344 const unsigned char* vertexbase = 0;
348 const unsigned char* indexbase = 0;
355 meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase, numverts,
type,
stride, &indexbase, indexstride, numfaces, indicestype, partId);
358 for (
int triangleIndex = 0; triangleIndex < numfaces; triangleIndex++)
360 unsigned int* gfxbase = (
unsigned int*)(indexbase + triangleIndex * indexstride);
362 for (
int j = 2; j >= 0; j--)
365 switch (indicestype) {
366 case PHY_INTEGER: graphicsindex = gfxbase[j];
break;
367 case PHY_SHORT: graphicsindex = ((
unsigned short*)gfxbase)[j];
break;
368 case PHY_UCHAR: graphicsindex = ((
unsigned char*)gfxbase)[j];
break;
373 float* graphicsbase = (
float*)(vertexbase + graphicsindex *
stride);
375 graphicsbase[0] * meshScaling.getX(),
376 graphicsbase[1] * meshScaling.getY(),
377 graphicsbase[2] * meshScaling.getZ());
381 double* graphicsbase = (
double*)(vertexbase + graphicsindex *
stride);
382 triangleVerts[j] =
btVector3(
btScalar(graphicsbase[0] * meshScaling.getX()),
btScalar(graphicsbase[1] * meshScaling.getY()),
btScalar(graphicsbase[2] * meshScaling.getZ()));
387 aabbMin.setMin(triangleVerts[0]);
388 aabbMax.setMax(triangleVerts[0]);
389 aabbMin.setMin(triangleVerts[1]);
390 aabbMax.setMax(triangleVerts[1]);
391 aabbMin.setMin(triangleVerts[2]);
392 aabbMax.setMax(triangleVerts[2]);
395 connectivityProcessor.
m_partIdA = partId;
400 trimeshShape->processAllTriangles(&connectivityProcessor, aabbMin, aabbMax);
410 if (heightfieldShape->getTriangleInfoMap())
413 heightfieldShape->setTriangleInfoMap(triangleInfoMap);
423 heightfieldShape->processAllTriangles(&processHeightfield, aabbMin, aabbMax);
434 if (lineDelta.fuzzyZero())
436 nearestPoint = line0;
448 nearestPoint = line0 + lineDelta * delta;
458 btVector3 edgeCross = edge.cross(tri_normal).normalize();
461 if (correctedEdgeAngle < 0)
463 if (curAngle < correctedEdgeAngle)
465 btScalar diffAngle = correctedEdgeAngle - curAngle;
467 clampedLocalNormal =
btMatrix3x3(rotation) * localContactNormalOnB;
472 if (correctedEdgeAngle >= 0)
474 if (curAngle > correctedEdgeAngle)
476 btScalar diffAngle = correctedEdgeAngle - curAngle;
478 clampedLocalNormal =
btMatrix3x3(rotation) * localContactNormalOnB;
498 triangleInfoMapPtr = heightfield->getTriangleInfoMap();
501 #ifdef USE_HEIGHTFIELD_TRIANGLES
506 tri_shape->calcNormal(tri_normal);
507 newNormal = tri_normal;
537 if (!triangleInfoMapPtr)
550 tri_shape->getVertex(0, v0);
551 tri_shape->getVertex(1,
v1);
552 tri_shape->getVertex(2,
v2);
556 btVector3 red(1, 0, 0),
green(0, 1, 0),
blue(0, 0, 1), white(1, 1, 1), black(0, 0, 0);
558 tri_shape->calcNormal(tri_normal);
565 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
566 const btTransform& tr = colObj0->getWorldTransform();
570 bool isNearEdge =
false;
572 int numConcaveEdgeHits = 0;
573 int numConvexEdgeHits = 0;
576 localContactNormalOnB.normalize();
589 if (
len < disttobestedge)
592 disttobestedge =
len;
602 if (
len < disttobestedge)
605 disttobestedge =
len;
615 if (
len < disttobestedge)
618 disttobestedge =
len;
622 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
624 btDebugDrawLine(tr * v0 + upfix, tr *
v1 + upfix,
red);
628 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
629 btDebugDrawLine(tr * contact, tr * (contact + cp.
m_normalWorldOnB * 10), black);
632 if (len < triangleInfoMapPtr->m_edgeDistanceThreshold)
640 numConcaveEdgeHits++;
646 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
647 btDebugDrawLine(tr * nearest, tr * (nearest + swapFactor * tri_normal * 10), white);
655 computedNormalB *= -1;
656 btVector3 nB = swapFactor * computedNormalB;
658 btScalar NdotA = localContactNormalOnB.dot(nA);
659 btScalar NdotB = localContactNormalOnB.dot(nB);
660 bool backFacingNormal = (NdotA < triangleInfoMapPtr->
m_convexEpsilon) && (NdotB < triangleInfoMapPtr->m_convexEpsilon);
662 #ifdef DEBUG_INTERNAL_EDGE
668 if (backFacingNormal)
670 numConcaveEdgeHits++;
695 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
699 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
700 btDebugDrawLine(tr *
v1 + upfix, tr *
v2 + upfix,
green);
705 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
706 btDebugDrawLine(tr * contact, tr * (contact + cp.
m_normalWorldOnB * 10), black);
710 if (len < triangleInfoMapPtr->m_edgeDistanceThreshold)
714 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
715 btDebugDrawLine(tr * nearest, tr * (nearest + tri_normal * 10), white);
724 numConcaveEdgeHits++;
730 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
731 btDebugDrawLine(tr * nearest, tr * (nearest + swapFactor * tri_normal * 10), white);
739 computedNormalB *= -1;
740 btVector3 nB = swapFactor * computedNormalB;
742 #ifdef DEBUG_INTERNAL_EDGE
748 btScalar NdotA = localContactNormalOnB.dot(nA);
749 btScalar NdotB = localContactNormalOnB.dot(nB);
750 bool backFacingNormal = (NdotA < triangleInfoMapPtr->
m_convexEpsilon) && (NdotB < triangleInfoMapPtr->m_convexEpsilon);
752 if (backFacingNormal)
754 numConcaveEdgeHits++;
780 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
783 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
784 btDebugDrawLine(tr *
v2 + upfix, tr * v0 + upfix,
blue);
789 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
790 btDebugDrawLine(tr * contact, tr * (contact + cp.
m_normalWorldOnB * 10), black);
794 if (len < triangleInfoMapPtr->m_edgeDistanceThreshold)
798 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
799 btDebugDrawLine(tr * nearest, tr * (nearest + tri_normal * 10), white);
806 numConcaveEdgeHits++;
812 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
813 btDebugDrawLine(tr * nearest, tr * (nearest + swapFactor * tri_normal * 10), white);
820 computedNormalB *= -1;
821 btVector3 nB = swapFactor * computedNormalB;
823 #ifdef DEBUG_INTERNAL_EDGE
829 btScalar NdotA = localContactNormalOnB.dot(nA);
830 btScalar NdotB = localContactNormalOnB.dot(nB);
831 bool backFacingNormal = (NdotA < triangleInfoMapPtr->
m_convexEpsilon) && (NdotB < triangleInfoMapPtr->m_convexEpsilon);
833 if (backFacingNormal)
835 numConcaveEdgeHits++;
862 #ifdef DEBUG_INTERNAL_EDGE
871 if (numConcaveEdgeHits > 0)
876 if (tri_normal.dot(localContactNormalOnB) < 0)
884 btVector3 newNormal = tri_normal * frontFacing;
886 btScalar d = newNormal.dot(localContactNormalOnB);
_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 type
_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 blue
_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 stride
_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 green
_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 v1
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 Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its red
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 Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert * v2
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TRIANGLE_SHAPE_PROXYTYPE
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TERRAIN_SHAPE_PROXYTYPE
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
SIMD_FORCE_INLINE bool isConvex() const
btCollisionShape * getChildShape(int index)
btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength, const void *heightfieldData, btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis, PHY_ScalarType heightDataType, bool flipQuadEdges)
preferred constructor
static btScalar btGetAngle(const btVector3 &edgeA, const btVector3 &normalA, const btVector3 &normalB)
bool btClampNormal(const btVector3 &edge, const btVector3 &tri_normal_org, const btVector3 &localContactNormalOnB, btScalar correctedEdgeAngle, btVector3 &clampedLocalNormal)
void btAdjustInternalEdgeContacts(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, const btCollisionObjectWrapper *colObj1Wrap, int partId0, int index0, int normalAdjustFlags)
Changes a btManifoldPoint collision normal to the normal from the mesh.
static int btGetHash(int partId, int triangleIndex)
void btGenerateInternalEdgeInfo(btBvhTriangleMeshShape *trimeshShape, btTriangleInfoMap *triangleInfoMap)
Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo'.
void btNearestPointInLineSegment(const btVector3 &point, const btVector3 &line0, const btVector3 &line1, btVector3 &nearestPoint)
@ BT_TRIANGLE_CONVEX_DOUBLE_SIDED
@ BT_TRIANGLE_CONVEX_BACKFACE_MODE
@ BT_TRIANGLE_CONCAVE_DOUBLE_SIDED
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
SIMD_FORCE_INLINE const btScalar & getZ() const
Return the z value.
SIMD_FORCE_INLINE const btScalar & getX() const
Return the x value.
SIMD_FORCE_INLINE const btScalar & getY() const
Return the y value.
#define MAX_NUM_PARTS_IN_BITS
SIMD_FORCE_INLINE btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
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 btAtan2(btScalar x, btScalar y)
btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape *childShape, const btVector3 &localScaling)
#define TRI_INFO_V1V2_CONVEX
#define TRI_INFO_V0V1_CONVEX
for btTriangleInfo m_flags
#define TRI_INFO_V2V0_CONVEX
#define TRI_INFO_V2V0_SWAP_NORMALB
#define TRI_INFO_V1V2_SWAP_NORMALB
#define TRI_INFO_V0V1_SWAP_NORMALB
SIMD_FORCE_INLINE btScalar length2() const
Return the length of the vector squared.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
btScalar m_equalVertexThreshold
void insert(const Key &key, const Value &value)
const Value * find(const Key &key) const
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
const btVector3 & getPositionWorldOnB() const
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
btVector3 m_normalWorldOnB
btVector3 m_positionWorldOnB
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
T length(const vec_base< T, Size > &a)
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
b3ProcessAllTrianglesHeightfield(btHeightfieldTerrainShape *heightFieldShape, btTriangleInfoMap *triangleInfoMap)
btHeightfieldTerrainShape * m_heightfieldShape
btTriangleInfoMap * m_triangleInfoMap
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
SIMD_FORCE_INLINE const btTransform & getWorldTransform() const
SIMD_FORCE_INLINE const btCollisionObject * getCollisionObject() const
btTriangleInfoMap * m_triangleInfoMap
btVector3 * m_triangleVerticesA
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
btScalar m_maxEdgeAngleThreshold
used to determine edge contacts: if the closest distance between a contact point and an edge is small...
btScalar m_equalVertexThreshold
used to determine if a triangle edge is planar with zero angle