mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 22:36:57 +02:00
PalmDataA::getPalmDirection --> getNormal()
This commit is contained in:
parent
d2d9ca8788
commit
366e9c7d34
5 changed files with 5 additions and 6 deletions
|
@ -622,7 +622,7 @@ bool Avatar::findParticleCollisions(const glm::vec3& particleCenter, float parti
|
||||||
|
|
||||||
glm::vec3 fingerAxis = palm->getFingerDirection();
|
glm::vec3 fingerAxis = palm->getFingerDirection();
|
||||||
glm::vec3 diskCenter = handPosition + HAND_PADDLE_OFFSET * fingerAxis;
|
glm::vec3 diskCenter = handPosition + HAND_PADDLE_OFFSET * fingerAxis;
|
||||||
glm::vec3 diskNormal = palm->getPalmDirection();
|
glm::vec3 diskNormal = palm->getNormal();
|
||||||
const float DISK_THICKNESS = 0.08f;
|
const float DISK_THICKNESS = 0.08f;
|
||||||
|
|
||||||
// collide against the disk
|
// collide against the disk
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const float FINGERTIP_COLLISION_RADIUS = 0.01f;
|
|
||||||
const float PALM_COLLISION_RADIUS = 0.03f;
|
const float PALM_COLLISION_RADIUS = 0.03f;
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,7 +200,7 @@ void Hand::renderHandTargets(bool isMine) {
|
||||||
glm::vec3 root = palm.getPosition();
|
glm::vec3 root = palm.getPosition();
|
||||||
Avatar::renderJointConnectingCone(root, tip, PALM_FINGER_ROD_RADIUS, PALM_FINGER_ROD_RADIUS);
|
Avatar::renderJointConnectingCone(root, tip, PALM_FINGER_ROD_RADIUS, PALM_FINGER_ROD_RADIUS);
|
||||||
// Render sphere at palm/finger root
|
// Render sphere at palm/finger root
|
||||||
glm::vec3 offsetFromPalm = root + palm.getPalmDirection() * PALM_DISK_THICKNESS;
|
glm::vec3 offsetFromPalm = root + palm.getNormal() * PALM_DISK_THICKNESS;
|
||||||
Avatar::renderJointConnectingCone(root, offsetFromPalm, PALM_DISK_RADIUS, 0.0f);
|
Avatar::renderJointConnectingCone(root, offsetFromPalm, PALM_DISK_RADIUS, 0.0f);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(root.x, root.y, root.z);
|
glTranslatef(root.x, root.y, root.z);
|
||||||
|
|
|
@ -198,7 +198,7 @@ glm::vec3 ControllerScriptingInterface::getSpatialControlNormal(int controlIndex
|
||||||
if (palmData) {
|
if (palmData) {
|
||||||
switch (controlOfPalm) {
|
switch (controlOfPalm) {
|
||||||
case PALM_SPATIALCONTROL:
|
case PALM_SPATIALCONTROL:
|
||||||
return palmData->getPalmDirection();
|
return palmData->getNormal();
|
||||||
case TIP_SPATIALCONTROL:
|
case TIP_SPATIALCONTROL:
|
||||||
return palmData->getFingerDirection();
|
return palmData->getFingerDirection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ glm::vec3 PalmData::getFingerDirection() const {
|
||||||
return _owningHandData->localToWorldDirection(_rawRotation * LOCAL_FINGER_DIRECTION);
|
return _owningHandData->localToWorldDirection(_rawRotation * LOCAL_FINGER_DIRECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 PalmData::getPalmDirection() const {
|
glm::vec3 PalmData::getNormal() const {
|
||||||
const glm::vec3 LOCAL_PALM_DIRECTION(0.0f, -1.0f, 0.0f);
|
const glm::vec3 LOCAL_PALM_DIRECTION(0.0f, -1.0f, 0.0f);
|
||||||
return _owningHandData->localToWorldDirection(_rawRotation * LOCAL_PALM_DIRECTION);
|
return _owningHandData->localToWorldDirection(_rawRotation * LOCAL_PALM_DIRECTION);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ public:
|
||||||
// return world-frame:
|
// return world-frame:
|
||||||
glm::vec3 getFingerTipPosition() const;
|
glm::vec3 getFingerTipPosition() const;
|
||||||
glm::vec3 getFingerDirection() const;
|
glm::vec3 getFingerDirection() const;
|
||||||
glm::vec3 getPalmDirection() const;
|
glm::vec3 getNormal() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
glm::quat _rawRotation;
|
glm::quat _rawRotation;
|
||||||
|
|
Loading…
Reference in a new issue