mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 21:59:49 +02:00
adjusted avatar height and camera up to compensate - improves navigation
This commit is contained in:
parent
99c2480642
commit
fc8c0498cf
2 changed files with 31 additions and 13 deletions
|
@ -110,11 +110,11 @@ Head::Head() {
|
|||
//--------------------------------------------------
|
||||
// test... just slam them into random positions...
|
||||
//--------------------------------------------------
|
||||
DEBUG_otherAvatarListPosition[ 0 ] = glm::vec3( 0.0, 0.1, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 1 ] = glm::vec3( 4.0, 0.1, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 2 ] = glm::vec3( 2.0, 0.1, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 3 ] = glm::vec3( 1.0, 0.1, -4.0 );
|
||||
DEBUG_otherAvatarListPosition[ 4 ] = glm::vec3( -2.0, 0.1, -2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 0 ] = glm::vec3( 0.0, 0.3, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 1 ] = glm::vec3( 4.0, 0.3, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 2 ] = glm::vec3( 2.0, 0.3, 2.0 );
|
||||
DEBUG_otherAvatarListPosition[ 3 ] = glm::vec3( 1.0, 0.3, -4.0 );
|
||||
DEBUG_otherAvatarListPosition[ 4 ] = glm::vec3( -2.0, 0.3, -2.0 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -871,7 +871,7 @@ void Head::initializeAvatar() {
|
|||
//----------------------------------------------------------
|
||||
// specify the default pose position
|
||||
//----------------------------------------------------------
|
||||
bone[ AVATAR_BONE_PELVIS_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||
bone[ AVATAR_BONE_PELVIS_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.3, 0.0 );
|
||||
bone[ AVATAR_BONE_MID_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||
bone[ AVATAR_BONE_CHEST_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||
bone[ AVATAR_BONE_NECK ].defaultPosePosition = glm::vec3( 0.0, 0.06, 0.0 );
|
||||
|
@ -1062,7 +1062,7 @@ void Head::updateHandMovement() {
|
|||
transformedHandMovement
|
||||
= avatar.orientation.getRight() * -movedHandOffset.x
|
||||
+ avatar.orientation.getUp() * -movedHandOffset.y
|
||||
+ avatar.orientation.getFront() * -movedHandOffset.y * 0.4f;
|
||||
+ avatar.orientation.getFront() * -movedHandOffset.y * 1.0f;
|
||||
|
||||
bone[ AVATAR_BONE_RIGHT_HAND ].position += transformedHandMovement;
|
||||
|
||||
|
@ -1084,12 +1084,15 @@ void Head::updateHandMovement() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// determine the arm vector
|
||||
//-------------------------------------------------------------------------------
|
||||
glm::vec3 armVector = bone[ AVATAR_BONE_RIGHT_HAND ].position;
|
||||
armVector -= bone[ AVATAR_BONE_RIGHT_SHOULDER ].position;
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// test to see if right hand is being dragged beyond maximum arm length
|
||||
//-------------------------------------------------------------------------------
|
||||
|
@ -1111,6 +1114,21 @@ void Head::updateHandMovement() {
|
|||
bone[ AVATAR_BONE_RIGHT_HAND ].position = constrainedPosition;
|
||||
}
|
||||
|
||||
/*
|
||||
//-------------------------------------------------------------------------------
|
||||
// keep arm from going through av body...
|
||||
//-------------------------------------------------------------------------------
|
||||
glm::vec3 adjustedArmVector = bone[ AVATAR_BONE_RIGHT_HAND ].position;
|
||||
adjustedArmVector -= bone[ AVATAR_BONE_RIGHT_SHOULDER ].position;
|
||||
|
||||
float rightComponent = glm::dot( adjustedArmVector, avatar.orientation.getRight() );
|
||||
|
||||
if ( rightComponent < 0.0 )
|
||||
{
|
||||
bone[ AVATAR_BONE_RIGHT_HAND ].position -= avatar.orientation.getRight() * rightComponent;
|
||||
}
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// set elbow position
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1159,7 +1177,7 @@ void Head::renderBody()
|
|||
// Render lines connecting the bone positions
|
||||
//-----------------------------------------------------
|
||||
if ( usingSprings ) {
|
||||
glColor3f( 0.2f, 0.3f, 0.4f );
|
||||
glColor3f( 0.4f, 0.5f, 0.6f );
|
||||
glLineWidth(3.0);
|
||||
|
||||
for (int b=1; b<NUM_AVATAR_BONES; b++) {
|
||||
|
|
|
@ -698,7 +698,7 @@ void display(void)
|
|||
myCamera.setYaw ( - myAvatar.getBodyYaw() );
|
||||
myCamera.setPitch ( 0.0 );
|
||||
myCamera.setRoll ( 0.0 );
|
||||
myCamera.setUp ( 0.4 );
|
||||
myCamera.setUp ( 0.53 );
|
||||
myCamera.setDistance ( 0.03 );
|
||||
myCamera.setTightness ( 100.0f );
|
||||
myCamera.update ( 1.f/FPS );
|
||||
|
@ -708,9 +708,9 @@ void display(void)
|
|||
//----------------------------------------------------
|
||||
myCamera.setTargetPosition ( myAvatar.getPos() );
|
||||
myCamera.setYaw ( 180.0 - myAvatar.getBodyYaw() );
|
||||
myCamera.setPitch ( 0.0 );
|
||||
myCamera.setPitch ( 10.0 );
|
||||
myCamera.setRoll ( 0.0 );
|
||||
myCamera.setUp ( 0.2 );
|
||||
myCamera.setUp ( 0.45 );
|
||||
myCamera.setDistance ( 0.5 );
|
||||
myCamera.setTightness ( 10.0f );
|
||||
myCamera.update ( 1.f/FPS );
|
||||
|
@ -1301,8 +1301,8 @@ void idle(void)
|
|||
//if ( mousePressed == 1 )
|
||||
|
||||
if ( myAvatar.getMode() == AVATAR_MODE_STANDING ) {
|
||||
float leftRight = ( mouseX - mouseStartX ) / ( WIDTH * ONE_HALF );
|
||||
float downUp = ( mouseY - mouseStartY ) / ( HEIGHT * ONE_HALF );
|
||||
float leftRight = ( mouseX - mouseStartX ) / (float)WIDTH;
|
||||
float downUp = ( mouseY - mouseStartY ) / (float)HEIGHT;
|
||||
float backFront = 0.0;
|
||||
glm::vec3 handMovement( leftRight, downUp, backFront );
|
||||
myAvatar.setHandMovement( handMovement );
|
||||
|
|
Loading…
Reference in a new issue