MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / GetWorldRotation

Method GetWorldRotation

src/Transform.cpp:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76quaternion Transform::GetWorldRotation()
77{
78 if (!HasParent()) {
79 return GetLocalRotation();
80 }
81
82 //the list of transformations to apply
83 list<matrix4> rotations;
84 GetParentMatrixStack(rotations);
85
86 matrix4 finalRot = matrix4(1.0); //construct identity matrix
87 //apply all the transforms
88 for (auto& transform : rotations) {
89 finalRot *= transform;
90 }
91
92 //apply local rotation
93 finalRot *= glm::toMat4(GetLocalRotation());
94
95 //return the result as a quaternion
96 return glm::toQuat(finalRot);
97}
98
99void RavEngine::Transform::Apply()
100{

Callers 3

AddHookMethod · 0.80
TickMethod · 0.80
GenerateViewMatrixMethod · 0.80

Calls 1

toQuatFunction · 0.85

Tested by

no test coverage detected