MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / GetWorldTriangle

Method GetWorldTriangle

GTE/Graphics/CollisionMesh.cpp:101–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool 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
118Matrix4x4<float> const& CollisionMesh::GetWorldTransform() const
119{

Callers 2

TestIntersectionMethod · 0.80
FindIntersectionMethod · 0.80

Calls 2

HProjectFunction · 0.50
HLiftFunction · 0.50

Tested by 1

TestIntersectionMethod · 0.64