Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Philip Rosedale 2013-04-24 08:46:27 -07:00
commit 50af1f68bf
3 changed files with 11 additions and 17 deletions

View file

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

View file

@ -1006,11 +1006,14 @@ void Head::updateSkeleton() {
_bone[b].position = _bone[ _bone[b].parent ].position; _bone[b].position = _bone[ _bone[b].parent ].position;
} }
///TEST! - get this working and then add a comment; JJV //-------------------------------------------------------------------------------------
// if this is not my avatar, then hand position comes from transmitted data
//-------------------------------------------------------------------------------------
if ( ! _isMine ) { if ( ! _isMine ) {
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handPosition; _bone[ AVATAR_BONE_RIGHT_HAND ].position = _handPosition;
} }
// the following will be replaced by a proper rotation...
float xx = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getRight() ); float xx = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getRight() );
float yy = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getUp () ); float yy = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getUp () );
float zz = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getFront() ); float zz = glm::dot( _bone[b].defaultPosePosition, _bone[b].orientation.getFront() );
@ -1024,7 +1027,6 @@ void Head::updateSkeleton() {
} }
} }
void Head::initializeBodySprings() { void Head::initializeBodySprings() {
for (int b=0; b<NUM_AVATAR_BONES; b++) { for (int b=0; b<NUM_AVATAR_BONES; b++) {
_bone[b].springyPosition = _bone[b].position; _bone[b].springyPosition = _bone[b].position;
@ -1128,30 +1130,22 @@ void Head::updateHandMovement( float deltaTime ) {
setHandState(_mousePressed); setHandState(_mousePressed);
bool atLeastOneAvatarIsGrasping = false;
if ( getHandState() == 1 ) { atLeastOneAvatarIsGrasping = true; }
if ( _isMine ) {
if ( _otherAvatar.handState == 1 ) {
atLeastOneAvatarIsGrasping = true;
}
}
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// if holding hands with another avatar, add a force to the hand... // if holding hands with another avatar, add a force to the hand...
//--------------------------------------------------------------------- //---------------------------------------------------------------------
if ( atLeastOneAvatarIsGrasping ) { if (( getHandState() == 1 )
|| ( _otherAvatar.handState == 1 )) {
if ( _nearOtherAvatar ) { if ( _nearOtherAvatar ) {
glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position; glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position;
glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position; glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position;
_handHolding.velocity *= 0.7; _handHolding.velocity *= 0.7;
_handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime; _handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime;
_handHolding.position += _handHolding.velocity; _handHolding.position += _handHolding.velocity;
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position; _bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position;
} }
} }
else { else {
_handHolding.position = _bone[ AVATAR_BONE_RIGHT_HAND ].position; _handHolding.position = _bone[ AVATAR_BONE_RIGHT_HAND ].position;
@ -1218,7 +1212,7 @@ void Head::renderBody() {
//renderBoneAsBlock( (AvatarBoneID)b); //renderBoneAsBlock( (AvatarBoneID)b);
//render bone orientation //render bone orientation
renderOrientationDirections( _bone[b].springyPosition, _bone[b].orientation, _bone[b].radius * 2.0 ); //renderOrientationDirections( _bone[b].springyPosition, _bone[b].orientation, _bone[b].radius * 2.0 );
if ( _usingBodySprings ) { if ( _usingBodySprings ) {
glColor3fv( skinColor ); glColor3fv( skinColor );

View file

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