MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / support

Method support

Engine/source/forest/forestCollision.cpp:101–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101Point3F ForestConvex::support(const VectorF& v) const
102{
103 TSShapeInstance *si = mData->getShapeInstance();
104
105 TSShape::ConvexHullAccelerator* pAccel =
106 si->getShape()->getAccelerator(mData->getCollisionDetails()[hullId]);
107 AssertFatal(pAccel != NULL, "Error, no accel!");
108
109 F32 currMaxDP = mDot(pAccel->vertexList[0], v);
110 U32 index = 0;
111 for (U32 i = 1; i < pAccel->numVerts; i++)
112 {
113 F32 dp = mDot(pAccel->vertexList[i], v);
114 if (dp > currMaxDP)
115 {
116 currMaxDP = dp;
117 index = i;
118 }
119 }
120
121 return pAccel->vertexList[index];
122}
123
124void ForestConvex::getFeatures( const MatrixF &mat, const VectorF &n, ConvexFeature *cf )
125{

Callers

nothing calls this directly

Calls 4

getAcceleratorMethod · 0.80
mDotFunction · 0.50
getShapeInstanceMethod · 0.45
getShapeMethod · 0.45

Tested by

no test coverage detected