Skip to content

Commit 365fcd0

Browse files
authored
Use untransformed orientation for velocity (CelestiaProject#2356)
Does not affect frontends here. The direction of traveling should depend on the untransformed orientation so that change of posture does not affect it.
1 parent ffcb20c commit 365fcd0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/celengine/observer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,10 +1209,10 @@ Observer::setTargetSpeed(float s)
12091209
s = -s;
12101210
if (trackObject.empty())
12111211
{
1212-
trackingOrientation = getOrientation();
1212+
trackingOrientation = originalOrientationUniv;
12131213
// Generate vector for velocity using current orientation
12141214
// and specified speed.
1215-
v = getOrientation().conjugate() * Eigen::Vector3d(0, 0, -s);
1215+
v = trackingOrientation.conjugate() * Eigen::Vector3d(0, 0, -s);
12161216
}
12171217
else
12181218
{

src/celestia/celestiacore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ void CelestiaCore::tick(double dt)
18841884
sim->setTargetSpeed(currentSpeed / std::exp(static_cast<float>(dt) * 3.0f * decelerationCoefficient));
18851885
}
18861886
}
1887-
if (!bSetTargetSpeed && av.norm() > 0.0f)
1887+
if (!bSetTargetSpeed && av.norm() > 1.0e-10)
18881888
{
18891889
// Force observer velocity vector to align with observer direction if an observer
18901890
// angular velocity still exists.

0 commit comments

Comments
 (0)