Blender V4.5
btInternalEdgeUtility.cpp File Reference

Go to the source code of this file.

Classes

struct  btConnectivityProcessor
struct  b3ProcessAllTrianglesHeightfield

Functions

static int btGetHash (int partId, int triangleIndex)
static btScalar btGetAngle (const btVector3 &edgeA, const btVector3 &normalA, const btVector3 &normalB)
void btGenerateInternalEdgeInfo (btBvhTriangleMeshShape *trimeshShape, btTriangleInfoMap *triangleInfoMap)
 Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo'.
void btGenerateInternalEdgeInfo (btHeightfieldTerrainShape *heightfieldShape, btTriangleInfoMap *triangleInfoMap)
void btNearestPointInLineSegment (const btVector3 &point, const btVector3 &line0, const btVector3 &line1, btVector3 &nearestPoint)
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.

Function Documentation

◆ btAdjustInternalEdgeContacts()

void btAdjustInternalEdgeContacts ( btManifoldPoint & cp,
const btCollisionObjectWrapper * trimeshColObj0Wrap,
const btCollisionObjectWrapper * otherColObj1Wrap,
int partId0,
int index0,
int normalAdjustFlags = 0 )

Changes a btManifoldPoint collision normal to the normal from the mesh.

Call the btFixMeshNormal to adjust the collision normal, using the triangle info map (generated using btGenerateInternalEdgeInfo) If this info map is missing, or the triangle is not store in this map, nothing will be done

Definition at line 486 of file btInternalEdgeUtility.cpp.

References BT_LARGE_FLOAT, BT_TRIANGLE_CONCAVE_DOUBLE_SIDED, BT_TRIANGLE_CONVEX_BACKFACE_MODE, BT_TRIANGLE_CONVEX_DOUBLE_SIDED, btAdjustInternalEdgeContacts(), btBvhTriangleMeshShape(), btClampNormal(), btFabs(), btGetHash(), btHeightfieldTerrainShape(), btNearestPointInLineSegment(), btScaledBvhTriangleMeshShape(), btTransform, btTriangleShape(), btVector3, btHashMap< Key, Value >::find(), btCollisionObjectWrapper::getCollisionObject(), btCollisionObjectWrapper::getCollisionShape(), btManifoldPoint::getPositionWorldOnB(), btCollisionObjectWrapper::getWorldTransform(), hash, len(), length(), btTriangleInfoMap::m_convexEpsilon, btManifoldPoint::m_distance1, btTriangleInfo::m_edgeV0V1Angle, btTriangleInfo::m_edgeV1V2Angle, btTriangleInfo::m_edgeV2V0Angle, btTriangleInfo::m_flags, btManifoldPoint::m_localPointB, btTriangleInfoMap::m_maxEdgeAngleThreshold, btManifoldPoint::m_normalWorldOnB, btManifoldPoint::m_positionWorldOnA, btManifoldPoint::m_positionWorldOnB, quatRotate(), SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE, TERRAIN_SHAPE_PROXYTYPE, TRI_INFO_V0V1_CONVEX, TRI_INFO_V0V1_SWAP_NORMALB, TRI_INFO_V1V2_CONVEX, TRI_INFO_V1V2_SWAP_NORMALB, TRI_INFO_V2V0_CONVEX, TRI_INFO_V2V0_SWAP_NORMALB, TRIANGLE_MESH_SHAPE_PROXYTYPE, TRIANGLE_SHAPE_PROXYTYPE, and v2.

Referenced by btAdjustInternalEdgeContacts().

◆ btClampNormal()

bool btClampNormal ( const btVector3 & edge,
const btVector3 & tri_normal_org,
const btVector3 & localContactNormalOnB,
btScalar correctedEdgeAngle,
btVector3 & clampedLocalNormal )

◆ btGenerateInternalEdgeInfo() [1/2]

◆ btGenerateInternalEdgeInfo() [2/2]

void btGenerateInternalEdgeInfo ( btHeightfieldTerrainShape * heightfieldShape,
btTriangleInfoMap * triangleInfoMap )

◆ btGetAngle()

btScalar btGetAngle ( const btVector3 & edgeA,
const btVector3 & normalA,
const btVector3 & normalB )
static

◆ btGetHash()

int btGetHash ( int partId,
int triangleIndex )
static

◆ btNearestPointInLineSegment()

void btNearestPointInLineSegment ( const btVector3 & point,
const btVector3 & line0,
const btVector3 & line1,
btVector3 & nearestPoint )