MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / initialize

Method initialize

src/Gui/Navigation/NavigationAnimation.cpp:71–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void FixedTimeAnimation::initialize()
72{
73#if (COIN_MAJOR_VERSION * 100 + COIN_MINOR_VERSION * 10 + COIN_MICRO_VERSION < 403)
74 navigation->findBoundingSphere();
75#endif
76
77 prevAngle = 0;
78 prevTranslation = SbVec3f(0, 0, 0);
79
80 // Find an axis and angle to rotate from the camera orientation to the target orientation using
81 // post-multiplication
82 SbVec3f rotationAxisPost;
83 float angle;
84 SbRotation(navigation->getCamera()->orientation.getValue().inverse() * targetOrientation)
85 .getValue(rotationAxisPost, angle);
86 if (angle > std::numbers::pi) {
87 angle -= float(2 * std::numbers::pi);
88 }
89
90 // Convert post-multiplication axis to a pre-multiplication axis
91 navigation->getCamera()->orientation.getValue().inverse().multVec(rotationAxisPost, rotationAxis);
92
93 angularVelocity = angle / duration();
94 linearVelocity = targetTranslation / duration();
95}
96
97/**
98 * @param value The elapsed time

Callers

nothing calls this directly

Calls 9

findBoundingSphereMethod · 0.80
setViewingModeMethod · 0.80
SbVec3fClass · 0.50
SbRotationClass · 0.50
getValueMethod · 0.45
inverseMethod · 0.45
getCameraMethod · 0.45
multVecMethod · 0.45
setViewingMethod · 0.45

Tested by

no test coverage detected