mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 04:31:08 -06:00
FixedRotation rerequests a missing attached node or target node every frame to prevent incorrect initialization order
This commit is contained in:
@@ -21,7 +21,7 @@ local ArtemisModel = {
|
||||
Attached = "ArtemisModel",
|
||||
XAxis = { 1.0, 0.0, 0.0 },
|
||||
XAxisOrthogonal = true,
|
||||
YAxis = "Sun",
|
||||
YAxis = sun.SunCenter.Identifier,
|
||||
YAxisInvert = true
|
||||
}
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ local Euclid = {
|
||||
Rotation = {
|
||||
Type = "FixedRotation",
|
||||
Attached = "Euclid",
|
||||
ZAxis = "Sun",
|
||||
ZAxis = sun.SunCenter.Identifier,
|
||||
YAxis = { 0.0, 1.0, 0.0 },
|
||||
YAxisOrthogonal = true
|
||||
}
|
||||
|
||||
@@ -505,6 +505,22 @@ void FixedRotation::update(const UpdateData& data) {
|
||||
_zAxis.type == Axis::Type::Object
|
||||
);
|
||||
|
||||
// @TODO (2024-06-15, abock) None of the following four checks should be necessary
|
||||
// as the nodes are retrieved whenever the property value is changed, but we
|
||||
// had an initialization issue and this was the fastest way to fix the bug
|
||||
if (!_attachedNode) {
|
||||
_attachedNode = sceneGraphNode(_attachedObject);
|
||||
}
|
||||
if (_xAxis.type == Axis::Type::Object && !_xAxis.node) {
|
||||
_xAxis.node = sceneGraphNode(_xAxis.object);
|
||||
}
|
||||
if (_yAxis.type == Axis::Type::Object && !_yAxis.node) {
|
||||
_yAxis.node = sceneGraphNode(_yAxis.object);
|
||||
}
|
||||
if (_zAxis.type == Axis::Type::Object && !_zAxis.node) {
|
||||
_zAxis.node = sceneGraphNode(_zAxis.object);
|
||||
}
|
||||
|
||||
if (_attachedNode || anyAxisIsObjectType) {
|
||||
requireUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user