MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / SetPosition

Method SetPosition

src/engine/SceneTypes.cpp:77–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void Light::SetPosition(const dm::double3& position) const
78{
79 auto node = GetNode();
80 if (!node)
81 {
82 assert(!"Lights must be attached in order to set their position");
83 return;
84 }
85
86 SceneGraphNode* parent = node->GetParent();
87 dm::daffine3 parentToWorld = dm::daffine3::identity();
88 if (parent)
89 parentToWorld = parent->GetLocalToWorldTransform();
90
91 dm::double3 translation = inverse(parentToWorld).transformPoint(position);
92 node->SetTranslation(translation);
93}
94
95void Light::SetDirection(const dm::double3& direction) const
96{

Callers

nothing calls this directly

Calls 4

GetParentMethod · 0.80
SetTranslationMethod · 0.80
inverseFunction · 0.50
transformPointMethod · 0.45

Tested by

no test coverage detected