| 99 | } |
| 100 | |
| 101 | Point3F 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 | |
| 124 | void ForestConvex::getFeatures( const MatrixF &mat, const VectorF &n, ConvexFeature *cf ) |
| 125 | { |
nothing calls this directly
no test coverage detected