mirror of
https://github.com/overte-org/overte.git
synced 2025-08-17 19:22:45 +02:00
hand holding
This commit is contained in:
parent
1921e23c4c
commit
eb49a9e4f2
1 changed files with 18 additions and 3 deletions
|
@ -95,6 +95,18 @@ void AvatarTouch::render(glm::vec3 cameraPosition) {
|
|||
|
||||
// show is we are golding hands...
|
||||
if (_weAreHoldingHands) {
|
||||
renderBeamBetweenHands();
|
||||
|
||||
/*
|
||||
glPushMatrix();
|
||||
glTranslatef(_yourHandPosition.x, _yourHandPosition.y, _yourHandPosition.z);
|
||||
glColor4f(1.0, 0.0, 0.0, 0.7); glutSolidSphere(0.020f, 10.0f, 10.0f);
|
||||
glColor4f(1.0, 0.0, 0.0, 0.7); glutSolidSphere(0.025f, 10.0f, 10.0f);
|
||||
glColor4f(1.0, 0.0, 0.0, 0.7); glutSolidSphere(0.030f, 10.0f, 10.0f);
|
||||
glPopMatrix();
|
||||
*/
|
||||
|
||||
/*
|
||||
glColor4f(0.9, 0.3, 0.3, 0.5);
|
||||
renderSphereOutline(_myHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP * 0.3f, 20, cameraPosition);
|
||||
renderSphereOutline(_myHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP * 0.2f, 20, cameraPosition);
|
||||
|
@ -103,15 +115,16 @@ void AvatarTouch::render(glm::vec3 cameraPosition) {
|
|||
renderSphereOutline(_yourHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP * 0.3f, 20, cameraPosition);
|
||||
renderSphereOutline(_yourHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP * 0.2f, 20, cameraPosition);
|
||||
renderSphereOutline(_yourHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP * 0.1f, 20, cameraPosition);
|
||||
*/
|
||||
}
|
||||
|
||||
//render the beam between our hands indicting that we can reach out and grasp hands...
|
||||
renderBeamBetweenHands();
|
||||
//renderBeamBetweenHands();
|
||||
|
||||
//show that our hands are close enough to grasp..
|
||||
if (_handsCloseEnoughToGrasp) {
|
||||
glColor4f(0.9, 0.3, 0.3, 0.5);
|
||||
renderSphereOutline(_myHandPosition, HANDS_CLOSE_ENOUGH_TO_GRASP / 3.0f, 20, cameraPosition);
|
||||
renderSphereOutline(_myHandPosition, 0.030f, 20, cameraPosition);
|
||||
}
|
||||
|
||||
// if your hand is grasping, show it...
|
||||
|
@ -143,14 +156,16 @@ void AvatarTouch::renderBeamBetweenHands() {
|
|||
glm::vec3 v1(_myHandPosition);
|
||||
glm::vec3 v2(_yourHandPosition);
|
||||
|
||||
/*
|
||||
glLineWidth(2.0);
|
||||
glColor4f(0.9f, 0.9f, 0.1f, 0.7);
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex3f(v1.x, v1.y, v1.z);
|
||||
glVertex3f(v2.x, v2.y, v2.z);
|
||||
glEnd();
|
||||
*/
|
||||
|
||||
glColor3f(1.0f, 1.0f, 1.0f);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
for (int p=0; p<NUM_POINTS; p++) {
|
||||
|
||||
_point[p] = _myHandPosition + _vectorBetweenHands * ((float)p / (float)NUM_POINTS);
|
||||
|
|
Loading…
Reference in a new issue