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

Method SetWorldRotation

include/RavEngine/Transform.hpp:184–196  ·  view source on GitHub ↗

Overwrite the rotation of this transform in world space @param newRot the new rotation in world space */

Source from the content-addressed store, hash-verified

182 @param newRot the new rotation in world space
183 */
184 inline void Transform::SetWorldRotation(const quaternion& newRot) {
185 if (!HasParent()) {
186 SetLocalRotation(newRot);
187 }
188 else {
189 //get world rotation
190 auto worldRot = GetWorldRotation();
191 //get the relative world offset
192 auto relative = glm::inverse(worldRot) * newRot;
193 //apply the rotation
194 LocalRotateDelta(relative);
195 }
196 }
197
198 /**
199 Overwrite the scale of this object with a new scale

Callers 2

ResetCamMethod · 0.80
TickMethod · 0.80

Calls

no outgoing calls

Tested by 1

ResetCamMethod · 0.64