15#ifdef DEBUG_INTERNAL_EDGE
19#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
82 printf(
"triangle A[0] = (%f,%f,%f)\ntriangle A[1] = (%f,%f,%f)\ntriangle A[2] = (%f,%f,%f)\n",
88 printf(
"triangle B[0] = (%f,%f,%f)\ntriangle B[1] = (%f,%f,%f)\ntriangle B[2] = (%f,%f,%f)\n",
94 for (
int i = 0; i < 3; i++)
96 for (
int j = 0;
j < 3;
j++)
190 bool isConvex =
false;
206 isConvex = (
dotA < 0.);
227#ifdef DEBUG_INTERNAL_EDGE
230 printf(
"warning: normals not identical\n");
251#ifdef DEBUG_INTERNAL_EDGE
254 printf(
"warning: normals not identical\n");
272#ifdef DEBUG_INTERNAL_EDGE
275 printf(
"warning: normals not identical\n");
344 const unsigned char* vertexbase = 0;
348 const unsigned char* indexbase = 0;
355 meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase, numverts, type, stride, &indexbase, indexstride, numfaces, indicestype,
partId);
362 for (
int j = 2;
j >= 0;
j--)
365 switch (indicestype) {
501#ifdef USE_HEIGHTFIELD_TRIANGLES
511 cp.m_positionWorldOnB =
cp.m_positionWorldOnA -
cp.m_normalWorldOnB *
cp.m_distance1;
512 cp.m_localPointB =
colObj0Wrap->getWorldTransform().invXform(
cp.m_positionWorldOnB);
556 btVector3 red(1, 0, 0),
green(0, 1, 0),
blue(0, 0, 1),
white(1, 1, 1),
black(0, 0, 0);
565#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
622#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
628#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
646#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
662#ifdef DEBUG_INTERNAL_EDGE
685 cp.m_positionWorldOnB =
cp.m_positionWorldOnA -
cp.m_normalWorldOnB *
cp.m_distance1;
686 cp.m_localPointB =
colObj0Wrap->getWorldTransform().invXform(
cp.m_positionWorldOnB);
695#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
699#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
705#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
714#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
730#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
742#ifdef DEBUG_INTERNAL_EDGE
770 cp.m_positionWorldOnB =
cp.m_positionWorldOnA -
cp.m_normalWorldOnB *
cp.m_distance1;
771 cp.m_localPointB =
colObj0Wrap->getWorldTransform().invXform(
cp.m_positionWorldOnB);
780#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
783#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
789#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
798#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
812#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
823#ifdef DEBUG_INTERNAL_EDGE
853 cp.m_positionWorldOnB =
cp.m_positionWorldOnA -
cp.m_normalWorldOnB *
cp.m_distance1;
854 cp.m_localPointB =
colObj0Wrap->getWorldTransform().invXform(
cp.m_positionWorldOnB);
862#ifdef DEBUG_INTERNAL_EDGE
896 cp.m_positionWorldOnB =
cp.m_positionWorldOnA -
cp.m_normalWorldOnB *
cp.m_distance1;
897 cp.m_localPointB =
colObj0Wrap->getWorldTransform().invXform(
cp.m_positionWorldOnB);
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TRIANGLE_SHAPE_PROXYTYPE
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TERRAIN_SHAPE_PROXYTYPE
PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.
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
const T & btMax(const T &a, const T &b)
#define MAX_NUM_PARTS_IN_BITS
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
btScalar length(const btQuaternion &q)
Return the length of a quaternion.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btAtan2(btScalar x, btScalar y)
btScalar btFabs(btScalar x)
#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
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
const btTriangleInfoMap * getTriangleInfoMap() const
void insert(const Key &key, const Value &value)
const Value * find(const Key &key) const
btHeightfieldTerrainShape simulates a 2D heightfield terrain
const struct btTriangleInfoMap * getTriangleInfoMap() const
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
process all triangles within the provided axis-aligned bounding box
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
ManifoldContactPoint collects and maintains persistent contactpoints.
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
btVector3 can be used to represent 3D points and vectors.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btScalar length2() const
Return the length of the vector squared.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
b3ProcessAllTrianglesHeightfield(btHeightfieldTerrainShape *heightFieldShape, btTriangleInfoMap *triangleInfoMap)
btHeightfieldTerrainShape * m_heightfieldShape
btTriangleInfoMap * m_triangleInfoMap
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_equalVertexThreshold
used to determine if a triangle edge is planar with zero angle
The btTriangleInfo structure stores information to adjust collision normals to avoid collisions again...