| 99 | } |
| 100 | |
| 101 | bool CollisionMesh::GetWorldTriangle(size_t t, Triangle3<float>& worldTriangle) const |
| 102 | { |
| 103 | std::array<int32_t, 3> indices{}; |
| 104 | if (GetTriangle(t, indices)) |
| 105 | { |
| 106 | Matrix4x4<float> const& hmatrix = GetWorldTransform(); |
| 107 | Vector3<float> modelVertex{}; |
| 108 | for (size_t j = 0; j < 3; ++j) |
| 109 | { |
| 110 | modelVertex = GetPosition(indices[j]); |
| 111 | worldTriangle.v[j] = HProject(hmatrix * HLift(modelVertex, 1.0f)); |
| 112 | } |
| 113 | return true; |
| 114 | } |
| 115 | return false; |
| 116 | } |
| 117 | |
| 118 | Matrix4x4<float> const& CollisionMesh::GetWorldTransform() const |
| 119 | { |