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

Method GetWorldPosition

src/Transform.cpp:55–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55vector3 Transform::GetWorldPosition()
56{
57 if (!HasParent()) {
58 return GetLocalPosition();
59 }
60
61 //the list of transformations to apply
62 list<matrix4> translations;
63 GetParentMatrixStack(translations);
64
65 //apply all the transforms
66 matrix4 finalMatrix(1);
67 for (auto& transform : translations) {
68 finalMatrix *= transform;
69 }
70 finalMatrix *= GenerateLocalMatrix();
71
72 //finally apply the local matrix
73 return finalMatrix * vector4(GetLocalPosition(), 1);
74}
75
76quaternion Transform::GetWorldRotation()
77{

Callers 4

TickMethod · 0.80
AddHookMethod · 0.80
TickMethod · 0.80
GenerateViewMatrixMethod · 0.80

Calls

no outgoing calls

Tested by 1

TickMethod · 0.64