| 75 | } |
| 76 | |
| 77 | void 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 | |
| 95 | void Light::SetDirection(const dm::double3& direction) const |
| 96 | { |
nothing calls this directly
no test coverage detected