mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 14:59:14 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d65f577268
4 changed files with 25 additions and 20 deletions
|
@ -113,7 +113,7 @@ int main(int argc, const char* argv[]) {
|
||||||
// move eve away from the origin
|
// move eve away from the origin
|
||||||
// pick a random point inside a 10x10 grid
|
// pick a random point inside a 10x10 grid
|
||||||
|
|
||||||
eve.setBodyPosition(glm::vec3(randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION),
|
eve.setPosition(glm::vec3(randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION),
|
||||||
0,
|
0,
|
||||||
randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION)));
|
randFloatInRange(-RANDOM_POSITION_MAX_DIMENSION, RANDOM_POSITION_MAX_DIMENSION)));
|
||||||
|
|
||||||
|
@ -121,9 +121,9 @@ int main(int argc, const char* argv[]) {
|
||||||
eve.setBodyYaw(0);
|
eve.setBodyYaw(0);
|
||||||
|
|
||||||
// put her hand out so somebody can shake it
|
// put her hand out so somebody can shake it
|
||||||
eve.setHandPosition(glm::vec3(eve.getBodyPosition()[0] - 0.2,
|
eve.setHandPosition(glm::vec3(eve.getPosition()[0] - 0.2,
|
||||||
0.25,
|
0.25,
|
||||||
eve.getBodyPosition()[2] + 0.1));
|
eve.getPosition()[2] + 0.1));
|
||||||
|
|
||||||
// read eve's audio data
|
// read eve's audio data
|
||||||
AudioInjector eveAudioInjector("eve.raw");
|
AudioInjector eveAudioInjector("eve.raw");
|
||||||
|
|
|
@ -1128,24 +1128,29 @@ 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 (( getHandState() == 1 )
|
if ( atLeastOneAvatarIsGrasping ) {
|
||||||
|| ( _otherAvatar.handState == 1 )) {
|
if ( _nearOtherAvatar ) {
|
||||||
//if ( _usingBodySprings )
|
|
||||||
{
|
glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position;
|
||||||
if ( _nearOtherAvatar ) {
|
glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position;
|
||||||
|
|
||||||
glm::vec3 vectorToOtherHand = _otherAvatar.handPosition - _handHolding.position;
|
_handHolding.velocity *= 0.7;
|
||||||
glm::vec3 vectorToMyHand = _bone[ AVATAR_BONE_RIGHT_HAND ].position - _handHolding.position;
|
_handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime;
|
||||||
|
_handHolding.position += _handHolding.velocity;
|
||||||
_handHolding.velocity *= 0.7;
|
|
||||||
_handHolding.velocity += ( vectorToOtherHand + vectorToMyHand ) * _handHolding.force * deltaTime;
|
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position;
|
||||||
_handHolding.position += _handHolding.velocity;
|
|
||||||
|
|
||||||
_bone[ AVATAR_BONE_RIGHT_HAND ].position = _handHolding.position;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -19,7 +19,7 @@ VoxelAgentData::~VoxelAgentData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) {
|
VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) {
|
||||||
memcpy(&_bodyPosition, &otherAgentData._bodyPosition, sizeof(_bodyPosition));
|
memcpy(&_Position, &otherAgentData._Position, sizeof(_Position));
|
||||||
rootMarkerNode = new MarkerNode();
|
rootMarkerNode = new MarkerNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ void *distributeVoxelsToListeners(void *args) {
|
||||||
stopOctal = randomTree.loadBitstreamBuffer(voxelPacketEnd,
|
stopOctal = randomTree.loadBitstreamBuffer(voxelPacketEnd,
|
||||||
randomTree.rootNode,
|
randomTree.rootNode,
|
||||||
agentData->rootMarkerNode,
|
agentData->rootMarkerNode,
|
||||||
agentData->getBodyPosition(),
|
agentData->getPosition(),
|
||||||
treeRoot,
|
treeRoot,
|
||||||
viewFrustum,
|
viewFrustum,
|
||||||
::viewFrustumCulling,
|
::viewFrustumCulling,
|
||||||
|
|
Loading…
Reference in a new issue