MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / ViewMatrix

Function ViewMatrix

core/maths.h:497–506  ·  view source on GitHub ↗

todo: sort out rotations

Source from the content-addressed store, hash-verified

495
496// todo: sort out rotations
497inline Mat44 ViewMatrix(const Point3& pos)
498{
499
500 float view[4][4] = { { 1.0f, 0.0f, 0.0f, 0.0f },
501 { 0.0f, 1.0f, 0.0f, 0.0f },
502 { 0.0f, 0.0f, 1.0f, 0.0f },
503 { -pos.x, -pos.y, -pos.z, 1.0f } };
504
505 return Mat44(&view[0][0]);
506}
507
508
509inline Mat44 LookAtMatrix(const Point3& viewer, const Point3& target)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected