mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:24:22 +02:00
expose deltaRotation as part of MyAvatar.xxxHandPose
This commit is contained in:
parent
71dfff7c35
commit
4a58eeb810
3 changed files with 11 additions and 5 deletions
|
@ -4851,8 +4851,10 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de
|
|||
angularVelocity = glm::normalize(glm::axis(deltaRotation));
|
||||
angularVelocity *= (rotationAngle / deltaTime);
|
||||
palm->setRawAngularVelocity(angularVelocity);
|
||||
palm->setRawDeltaRotation(deltaRotation); // FIXME - do we really want both RawAngularVelocity and RawDeltaRotation
|
||||
} else {
|
||||
palm->setRawAngularVelocity(glm::vec3(0.0f));
|
||||
palm->setRawDeltaRotation(glm::quat());
|
||||
}
|
||||
|
||||
if (controller::InputDevice::getLowVelocityFilter()) {
|
||||
|
|
|
@ -600,28 +600,28 @@ controller::Pose MyAvatar::getLeftHandPose() const {
|
|||
const int LEFT_HAND = 0;
|
||||
auto palmData = getActivePalm(LEFT_HAND);
|
||||
return palmData ? controller::Pose(palmData->getPosition(), palmData->getRotation(),
|
||||
palmData->getVelocity(), palmData->getRawAngularVelocityAsQuat()) : controller::Pose();
|
||||
palmData->getVelocity(), palmData->getRawDeltaRotation()) : controller::Pose();
|
||||
}
|
||||
|
||||
controller::Pose MyAvatar::getRightHandPose() const {
|
||||
const int RIGHT_HAND = 1;
|
||||
auto palmData = getActivePalm(RIGHT_HAND);
|
||||
return palmData ? controller::Pose(palmData->getPosition(), palmData->getRotation(),
|
||||
palmData->getVelocity(), palmData->getRawAngularVelocityAsQuat()) : controller::Pose();
|
||||
palmData->getVelocity(), palmData->getRawDeltaRotation()) : controller::Pose();
|
||||
}
|
||||
|
||||
controller::Pose MyAvatar::getLeftHandTipPose() const {
|
||||
const int LEFT_HAND = 0;
|
||||
auto palmData = getActivePalm(LEFT_HAND);
|
||||
return palmData ? controller::Pose(palmData->getTipPosition(), palmData->getRotation(),
|
||||
palmData->getTipVelocity(), palmData->getRawAngularVelocityAsQuat()) : controller::Pose();
|
||||
palmData->getTipVelocity(), palmData->getRawDeltaRotation()) : controller::Pose();
|
||||
}
|
||||
|
||||
controller::Pose MyAvatar::getRightHandTipPose() const {
|
||||
const int RIGHT_HAND = 1;
|
||||
auto palmData = getActivePalm(RIGHT_HAND);
|
||||
return palmData ? controller::Pose(palmData->getTipPosition(), palmData->getRotation(),
|
||||
palmData->getTipVelocity(), palmData->getRawAngularVelocityAsQuat()) : controller::Pose();
|
||||
palmData->getTipVelocity(), palmData->getRawDeltaRotation()) : controller::Pose();
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
@ -101,9 +101,12 @@ public:
|
|||
void setRawPosition(const glm::vec3& pos) { _rawPosition = pos; }
|
||||
void setRawVelocity(const glm::vec3& velocity) { _rawVelocity = velocity; }
|
||||
const glm::vec3& getRawVelocity() const { return _rawVelocity; }
|
||||
|
||||
void setRawAngularVelocity(const glm::vec3& angularVelocity) { _rawAngularVelocity = angularVelocity; }
|
||||
const glm::vec3& getRawAngularVelocity() const { return _rawAngularVelocity; }
|
||||
glm::quat getRawAngularVelocityAsQuat() const { return glm::quat(); } // FIXME
|
||||
void setRawDeltaRotation(glm::quat rawDeltaRotation) { _rawDeltaRotation = rawDeltaRotation; } // FIXME, is this really what we want?
|
||||
glm::quat getRawDeltaRotation() const { return _rawDeltaRotation; }
|
||||
|
||||
void addToPosition(const glm::vec3& delta);
|
||||
|
||||
void addToPenetration(const glm::vec3& penetration) { _totalPenetration += penetration; }
|
||||
|
@ -156,6 +159,7 @@ private:
|
|||
glm::vec3 _rawPosition;
|
||||
glm::vec3 _rawVelocity;
|
||||
glm::vec3 _rawAngularVelocity;
|
||||
glm::quat _rawDeltaRotation;
|
||||
glm::quat _lastRotation;
|
||||
|
||||
glm::vec3 _tipPosition;
|
||||
|
|
Loading…
Reference in a new issue