mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 18:13:35 +02:00
remove JointState::applyRotationDelta()
(use JointState::applyRotationDeltaInModelFrame()) instead)
This commit is contained in:
parent
7f46e9d514
commit
a1afcfd42c
2 changed files with 0 additions and 21 deletions
|
@ -2112,26 +2112,6 @@ void JointState::clearTransformTranslation() {
|
||||||
_transformInModelFrame[3][2] = 0.0f;
|
_transformInModelFrame[3][2] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JointState::applyRotationDelta(const glm::quat& delta, bool constrain, float priority) {
|
|
||||||
assert(_fbxJoint != NULL);
|
|
||||||
if (priority < _animationPriority) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_animationPriority = priority;
|
|
||||||
if (!constrain || (_fbxJoint->rotationMin == glm::vec3(-PI, -PI, -PI) &&
|
|
||||||
_fbxJoint->rotationMax == glm::vec3(PI, PI, PI))) {
|
|
||||||
// no constraints
|
|
||||||
_rotation = _rotation * glm::inverse(_combinedRotation) * delta * _combinedRotation;
|
|
||||||
_combinedRotation = delta * _combinedRotation;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
glm::quat targetRotation = delta * _combinedRotation;
|
|
||||||
glm::vec3 eulers = safeEulerAngles(_rotation * glm::inverse(_combinedRotation) * targetRotation);
|
|
||||||
glm::quat newRotation = glm::quat(glm::clamp(eulers, _fbxJoint->rotationMin, _fbxJoint->rotationMax));
|
|
||||||
_combinedRotation = _combinedRotation * glm::inverse(_rotation) * newRotation;
|
|
||||||
_rotation = newRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void JointState::applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain, float priority) {
|
void JointState::applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain, float priority) {
|
||||||
assert(_fbxJoint != NULL);
|
assert(_fbxJoint != NULL);
|
||||||
if (priority < _animationPriority) {
|
if (priority < _animationPriority) {
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
/// \return rotation from bind to model frame
|
/// \return rotation from bind to model frame
|
||||||
glm::quat getRotationFromBindToModelFrame() const;
|
glm::quat getRotationFromBindToModelFrame() const;
|
||||||
|
|
||||||
void applyRotationDelta(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
|
|
||||||
void applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
|
void applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
|
||||||
|
|
||||||
const glm::vec3& getDefaultTranslationInParentFrame() const;
|
const glm::vec3& getDefaultTranslationInParentFrame() const;
|
||||||
|
|
Loading…
Reference in a new issue