mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:24:22 +02:00
fix angular velocity
This commit is contained in:
parent
4a58eeb810
commit
f90844449d
3 changed files with 5 additions and 8 deletions
|
@ -4851,10 +4851,8 @@ 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->getRawDeltaRotation()) : controller::Pose();
|
||||
palmData->getVelocity(), palmData->getRawAngularVelocityAsQuat()) : 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->getRawDeltaRotation()) : controller::Pose();
|
||||
palmData->getVelocity(), palmData->getRawAngularVelocityAsQuat()) : 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->getRawDeltaRotation()) : controller::Pose();
|
||||
palmData->getTipVelocity(), palmData->getRawAngularVelocityAsQuat()) : 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->getRawDeltaRotation()) : controller::Pose();
|
||||
palmData->getTipVelocity(), palmData->getRawAngularVelocityAsQuat()) : controller::Pose();
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
@ -104,8 +104,7 @@ public:
|
|||
|
||||
void setRawAngularVelocity(const glm::vec3& angularVelocity) { _rawAngularVelocity = angularVelocity; }
|
||||
const glm::vec3& getRawAngularVelocity() const { return _rawAngularVelocity; }
|
||||
void setRawDeltaRotation(glm::quat rawDeltaRotation) { _rawDeltaRotation = rawDeltaRotation; } // FIXME, is this really what we want?
|
||||
glm::quat getRawDeltaRotation() const { return _rawDeltaRotation; }
|
||||
glm::quat getRawAngularVelocityAsQuat() const { return glm::quat(_rawAngularVelocity); }
|
||||
|
||||
void addToPosition(const glm::vec3& delta);
|
||||
|
||||
|
|
Loading…
Reference in a new issue