MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SetTransformationMatrix

Method SetTransformationMatrix

Source/Objects/object.cpp:482–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482void Object::SetTransformationMatrix(const mat4 &transform) {
483 if (transform_ != transform) {
484 translation_ = transform.GetTranslationPart();
485 rotation_ = QuaternionFromMat4(transform);
486 LOG_ASSERT(!IsNan(rotation_[0]));
487 scale_[0] = length(transform * vec4(1, 0, 0, 0));
488 scale_[1] = length(transform * vec4(0, 1, 0, 0));
489 scale_[2] = length(transform * vec4(0, 0, 1, 0));
490 UpdateTransform();
491 Moved(Object::kAll);
492 }
493}
494
495void Object::GetDisplayName(char *buf, int buf_size) {
496 if (GetName().empty()) {

Callers 1

DrawMethod · 0.80

Calls 5

QuaternionFromMat4Function · 0.85
IsNanFunction · 0.85
GetTranslationPartMethod · 0.80
lengthFunction · 0.50
vec4Class · 0.50

Tested by

no test coverage detected