mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 19:34:02 +02:00
starting the c++ version of shoulder rotation
This commit is contained in:
parent
874d9251e7
commit
30ef544c6d
2 changed files with 16 additions and 0 deletions
|
@ -801,6 +801,17 @@ void MyAvatar::updateFromHMDSensorMatrix(const glm::mat4& hmdSensorMatrix) {
|
|||
}
|
||||
}
|
||||
|
||||
void MyAvatar::computeHandAzimuth() {
|
||||
controller::Pose leftHandPoseAvatarSpace = getLeftHandPose();
|
||||
controller::Pose rightHandPoseAvatarSpace = getRightHandPose();
|
||||
glm::vec3 localLookat(0.0f, 0.0f, 1.0f);
|
||||
glm::vec3 rightHandRigSpace = rightHandPoseAvatarSpace.rotation * localLookat;
|
||||
glm::vec3 lefttHandRigSpace = leftHandPoseAvatarSpace.rotation * localLookat;
|
||||
|
||||
_hipToHandController = glm::vec2(rightHandRigSpace.x, rightHandRigSpace.z);
|
||||
|
||||
}
|
||||
|
||||
void MyAvatar::updateJointFromController(controller::Action poseKey, ThreadSafeValueCache<glm::mat4>& matrixCache) {
|
||||
assert(QThread::currentThread() == thread());
|
||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||
|
|
|
@ -320,6 +320,9 @@ public:
|
|||
// as it moves through the world.
|
||||
void updateFromHMDSensorMatrix(const glm::mat4& hmdSensorMatrix);
|
||||
|
||||
// compute the hip to hand average azimuth.
|
||||
void computeHandAzimuth();
|
||||
|
||||
// read the location of a hand controller and save the transform
|
||||
void updateJointFromController(controller::Action poseKey, ThreadSafeValueCache<glm::mat4>& matrixCache);
|
||||
|
||||
|
@ -1658,6 +1661,8 @@ private:
|
|||
glm::vec2 _headControllerFacingMovingAverage { 0.0f, 0.0f }; // facing vector in xz plane (sensor space)
|
||||
glm::quat _averageHeadRotation { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
|
||||
glm::vec2 _hipToHandController; // facing vector in xz plane (sensor space)
|
||||
|
||||
float _currentStandingHeight { 0.0f };
|
||||
bool _resetMode { true };
|
||||
RingBufferHistory<int> _recentModeReadings;
|
||||
|
|
Loading…
Reference in a new issue