mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
first cut at adding MyAvatar.xxxHandPose
This commit is contained in:
parent
30b44d1e33
commit
71dfff7c35
3 changed files with 45 additions and 4 deletions
|
@ -596,6 +596,34 @@ glm::vec3 MyAvatar::getRightHandTipPosition() const {
|
|||
return palmData ? palmData->getTipPosition() : glm::vec3(0.0f);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void MyAvatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||
// don't render if we've been asked to disable local rendering
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include <DynamicCharacterController.h>
|
||||
#include <Rig.h>
|
||||
|
||||
#include <controllers/Pose.h>
|
||||
|
||||
#include "Avatar.h"
|
||||
#include "AtRestDetector.h"
|
||||
|
||||
|
@ -64,10 +66,15 @@ class MyAvatar : public Avatar {
|
|||
//TODO: make gravity feature work Q_PROPERTY(glm::vec3 gravity READ getGravity WRITE setGravity)
|
||||
|
||||
|
||||
Q_PROPERTY(glm::vec3 leftHandPosition READ getLeftHandPosition)
|
||||
Q_PROPERTY(glm::vec3 rightHandPosition READ getRightHandPosition)
|
||||
Q_PROPERTY(glm::vec3 leftHandTipPosition READ getLeftHandTipPosition)
|
||||
Q_PROPERTY(glm::vec3 rightHandTipPosition READ getRightHandTipPosition)
|
||||
Q_PROPERTY(glm::vec3 leftHandPosition READ getLeftHandPosition)
|
||||
Q_PROPERTY(glm::vec3 rightHandPosition READ getRightHandPosition)
|
||||
Q_PROPERTY(glm::vec3 leftHandTipPosition READ getLeftHandTipPosition)
|
||||
Q_PROPERTY(glm::vec3 rightHandTipPosition READ getRightHandTipPosition)
|
||||
|
||||
Q_PROPERTY(controller::Pose leftHandPose READ getLeftHandPose)
|
||||
Q_PROPERTY(controller::Pose rightHandPose READ getRightHandPose)
|
||||
Q_PROPERTY(controller::Pose leftHandTipPose READ getLeftHandTipPose)
|
||||
Q_PROPERTY(controller::Pose rightHandTipPose READ getRightHandTipPose)
|
||||
|
||||
public:
|
||||
MyAvatar(RigPointer rig);
|
||||
|
@ -160,6 +167,11 @@ public:
|
|||
Q_INVOKABLE glm::vec3 getLeftHandTipPosition() const;
|
||||
Q_INVOKABLE glm::vec3 getRightHandTipPosition() const;
|
||||
|
||||
Q_INVOKABLE controller::Pose getLeftHandPose() const;
|
||||
Q_INVOKABLE controller::Pose getRightHandPose() const;
|
||||
Q_INVOKABLE controller::Pose getLeftHandTipPose() const;
|
||||
Q_INVOKABLE controller::Pose getRightHandTipPose() const;
|
||||
|
||||
AvatarWeakPointer getLookAtTargetAvatar() const { return _lookAtTargetAvatar; }
|
||||
void updateLookAtTargetAvatar();
|
||||
void clearLookAtTargetAvatar();
|
||||
|
|
|
@ -103,6 +103,7 @@ public:
|
|||
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 addToPosition(const glm::vec3& delta);
|
||||
|
||||
void addToPenetration(const glm::vec3& penetration) { _totalPenetration += penetration; }
|
||||
|
|
Loading…
Reference in a new issue