one more glitch...

This commit is contained in:
Jeffrey Ventrella 2013-04-23 21:17:39 -07:00
parent 48da3f726e
commit 61a17060c3
3 changed files with 14 additions and 14 deletions

View file

@ -91,7 +91,7 @@ bool processParameters(int parameterCount, char* parameterData[])
}
}
return true;
};
};_Position
int main(int argc, const char* argv[]) {

View file

@ -1133,7 +1133,9 @@ void Head::updateHandMovement( float deltaTime ) {
if ( getHandState() == 1 ) { atLeastOneAvatarIsGrasping = true; }
if ( _isMine ) {
if ( _otherAvatar.handState == 1 ) {
atLeastOneAvatarIsGrasping = true;
if ( _nearOtherAvatar ) {
atLeastOneAvatarIsGrasping = true;
}
}
}
@ -1141,17 +1143,15 @@ void Head::updateHandMovement( float deltaTime ) {
// if holding hands with another avatar, add a force to the hand...
//---------------------------------------------------------------------
if ( atLeastOneAvatarIsGrasping ) {
if ( _nearOtherAvatar ) {
glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position;
glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position;
_handHolding.velocity *= 0.7;
_handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime;
_handHolding.position += _handHolding.velocity;
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position;
}
glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position;
glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position;
_handHolding.velocity *= 0.7;
_handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime;
_handHolding.position += _handHolding.velocity;
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position;
}
else {
_handHolding.position = _bone[ AVATAR_BONE_RIGHT_HAND ].position;

View file

@ -19,7 +19,7 @@ VoxelAgentData::~VoxelAgentData() {
}
VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) {
memcpy(&_Position, &otherAgentData._Position, sizeof(_Position));
memcpy(&_position, &otherAgentData._position, sizeof(_position));
rootMarkerNode = new MarkerNode();
}