Merge pull request #19719 from Rexbas/navicube-accumulative-animation

Gui: Accumulate orientation for NaviCube flat button animations
This commit is contained in:
Chris Hennes
2025-02-24 17:15:45 +00:00
committed by GitHub
7 changed files with 62 additions and 41 deletions

View File

@@ -3216,9 +3216,9 @@ void View3DInventorViewer::pubSeekToPoint(const SbVec3f& pos)
this->seekToPoint(pos);
}
void View3DInventorViewer::setCameraOrientation(const SbRotation& orientation, bool moveToCenter)
std::shared_ptr<NavigationAnimation> View3DInventorViewer::setCameraOrientation(const SbRotation& orientation, const bool moveToCenter) const
{
navigation->setCameraOrientation(orientation, moveToCenter);
return navigation->setCameraOrientation(orientation, moveToCenter);
}
void View3DInventorViewer::setCameraType(SoType type)
@@ -3629,12 +3629,14 @@ bool View3DInventorViewer::isSpinning() const
* @param translation An additional translation on top of the translation caused by the rotation around the rotation center
* @param duration The duration in milliseconds
* @param wait When false, start the animation and continue (asynchronous). When true, start the animation and wait for the animation to finish (synchronous)
*
* @return The started @class NavigationAnimation
*/
void View3DInventorViewer::startAnimation(const SbRotation& orientation,
std::shared_ptr<NavigationAnimation> View3DInventorViewer::startAnimation(const SbRotation& orientation,
const SbVec3f& rotationCenter,
const SbVec3f& translation,
int duration,
bool wait)
const bool wait) const
{
// Currently starts a FixedTimeAnimation. If there is going to be an additional animation like
// FixedVelocityAnimation, check the animation type from a parameter and start the right animation
@@ -3654,6 +3656,8 @@ void View3DInventorViewer::startAnimation(const SbRotation& orientation,
navigation, orientation, rotationCenter, translation, duration, easingCurve);
navigation->startAnimating(animation, wait);
return animation;
}
/**