mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:36:38 +02:00
Merge remote-tracking branch 'origin'
This commit is contained in:
commit
5a98ebfff2
13 changed files with 290 additions and 205 deletions
|
@ -25,6 +25,8 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "AgentList.h"
|
#include "AgentList.h"
|
||||||
|
#include "AgentTypes.h"
|
||||||
|
#include <PacketHeaders.h>
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -46,7 +48,7 @@ const int LOGOFF_CHECK_INTERVAL = 5000;
|
||||||
#define DEBUG_TO_SELF 0
|
#define DEBUG_TO_SELF 0
|
||||||
|
|
||||||
int lastActiveCount = 0;
|
int lastActiveCount = 0;
|
||||||
AgentList agentList('D', DOMAIN_LISTEN_PORT);
|
AgentList agentList(AGENT_TYPE_DOMAIN, DOMAIN_LISTEN_PORT);
|
||||||
|
|
||||||
unsigned char * addAgentToBroadcastPacket(unsigned char *currentPosition, Agent *agentToAdd) {
|
unsigned char * addAgentToBroadcastPacket(unsigned char *currentPosition, Agent *agentToAdd) {
|
||||||
*currentPosition++ = agentToAdd->getType();
|
*currentPosition++ = agentToAdd->getType();
|
||||||
|
@ -82,7 +84,7 @@ int main(int argc, const char * argv[])
|
||||||
char agentType;
|
char agentType;
|
||||||
|
|
||||||
unsigned char *broadcastPacket = new unsigned char[MAX_PACKET_SIZE];
|
unsigned char *broadcastPacket = new unsigned char[MAX_PACKET_SIZE];
|
||||||
*broadcastPacket = 'D';
|
*broadcastPacket = PACKET_HEADER_DOMAIN;
|
||||||
|
|
||||||
unsigned char *currentBufferPos;
|
unsigned char *currentBufferPos;
|
||||||
unsigned char *startPointer;
|
unsigned char *startPointer;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
//------------------------
|
//------------------------
|
||||||
Camera::Camera()
|
Camera::Camera()
|
||||||
{
|
{
|
||||||
|
mode = CAMERA_MODE_THIRD_PERSON;
|
||||||
|
fieldOfView = 60.0; // default
|
||||||
yaw = 0.0;
|
yaw = 0.0;
|
||||||
pitch = 0.0;
|
pitch = 0.0;
|
||||||
roll = 0.0;
|
roll = 0.0;
|
||||||
|
@ -22,6 +24,7 @@ Camera::Camera()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
void Camera::update()
|
void Camera::update()
|
||||||
{
|
{
|
||||||
|
@ -33,5 +36,13 @@ void Camera::update()
|
||||||
|
|
||||||
position = glm::dvec3( targetPosition );
|
position = glm::dvec3( targetPosition );
|
||||||
position += glm::dvec3( x, y, z );
|
position += glm::dvec3( x, y, z );
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
//geterate the ortho-normals for the orientation based on the Euler angles
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
orientation.setToIdentity();
|
||||||
|
orientation.yaw ( yaw );
|
||||||
|
orientation.pitch ( pitch );
|
||||||
|
orientation.roll ( roll );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,16 @@
|
||||||
#include "Orientation.h"
|
#include "Orientation.h"
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
|
enum CameraMode
|
||||||
|
{
|
||||||
|
CAMERA_MODE_NULL = -1,
|
||||||
|
CAMERA_MODE_FIRST_PERSON,
|
||||||
|
CAMERA_MODE_THIRD_PERSON,
|
||||||
|
CAMERA_MODE_MY_OWN_FACE,
|
||||||
|
NUM_CAMERA_MODES
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Camera
|
class Camera
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -19,30 +29,34 @@ public:
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void setYaw ( double y ) { yaw = y; }
|
void setMode ( CameraMode m ) { mode = m; }
|
||||||
void setPitch ( double p ) { pitch = p; }
|
void setYaw ( float y ) { yaw = y; }
|
||||||
void setRoll ( double r ) { roll = r; }
|
void setPitch ( float p ) { pitch = p; }
|
||||||
void setUp ( double u ) { up = u; }
|
void setRoll ( float r ) { roll = r; }
|
||||||
void setDistance ( double d ) { distance = d; }
|
void setUp ( float u ) { up = u; }
|
||||||
void setTargetPosition ( glm::dvec3 t ) { targetPosition = t; };
|
void setDistance ( float d ) { distance = d; }
|
||||||
void setPosition ( glm::dvec3 p ) { position = p; };
|
void setTargetPosition ( glm::vec3 t ) { targetPosition = t; };
|
||||||
|
void setPosition ( glm::vec3 p ) { position = p; };
|
||||||
void setOrientation ( Orientation o ) { orientation.set(o); }
|
void setOrientation ( Orientation o ) { orientation.set(o); }
|
||||||
|
|
||||||
double getYaw () { return yaw; }
|
float getYaw () { return yaw; }
|
||||||
double getPitch () { return pitch; }
|
float getPitch () { return pitch; }
|
||||||
double getRoll () { return roll; }
|
float getRoll () { return roll; }
|
||||||
glm::dvec3 getPosition () { return position; }
|
glm::vec3 getPosition () { return position; }
|
||||||
Orientation getOrientation () { return orientation; }
|
Orientation getOrientation () { return orientation; }
|
||||||
|
CameraMode getMode () { return mode; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
glm::dvec3 position;
|
CameraMode mode;
|
||||||
glm::dvec3 targetPosition;
|
glm::vec3 position;
|
||||||
double yaw;
|
glm::vec3 targetPosition;
|
||||||
double pitch;
|
float fieldOfView;
|
||||||
double roll;
|
float yaw;
|
||||||
double up;
|
float pitch;
|
||||||
double distance;
|
float roll;
|
||||||
|
float up;
|
||||||
|
float distance;
|
||||||
Orientation orientation;
|
Orientation orientation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ void Head::reset()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//this pertains to moving the head with the glasses
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
void Head::UpdatePos(float frametime, SerialInterface * serialInterface, int head_mirror, glm::vec3 * gravity)
|
void Head::UpdatePos(float frametime, SerialInterface * serialInterface, int head_mirror, glm::vec3 * gravity)
|
||||||
// Using serial data, update avatar/render position and angles
|
// Using serial data, update avatar/render position and angles
|
||||||
|
@ -239,9 +239,9 @@ void Head::UpdatePos(float frametime, SerialInterface * serialInterface, int hea
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
void Head::setAvatarPosition( double x, double y, double z )
|
void Head::setAvatarPosition( float x, float y, float z )
|
||||||
{
|
{
|
||||||
avatar.position = glm::dvec3( x, y, z );
|
avatar.position = glm::vec3( x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,10 +285,7 @@ void Head::simulate(float deltaTime)
|
||||||
sin( avatar.pitch * PI_OVER_180 ),
|
sin( avatar.pitch * PI_OVER_180 ),
|
||||||
cos( avatar.roll * PI_OVER_180 )
|
cos( avatar.roll * PI_OVER_180 )
|
||||||
);
|
);
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
glm::vec3 forward(-sinf(getRenderYaw()*PI/180),
|
glm::vec3 forward(-sinf(getRenderYaw()*PI/180),
|
||||||
sinf(getRenderPitch()*PI/180),
|
sinf(getRenderPitch()*PI/180),
|
||||||
cosf(getRenderYaw()*PI/180));
|
cosf(getRenderYaw()*PI/180));
|
||||||
|
@ -296,93 +293,54 @@ void Head::simulate(float deltaTime)
|
||||||
thrust = glm::vec3(0);
|
thrust = glm::vec3(0);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const float THRUST_MAG = 10.0;
|
const float THRUST_MAG = 10.0;
|
||||||
|
const float THRUST_LATERAL_MAG = 10.0;
|
||||||
/*
|
const float THRUST_VERTICAL_MAG = 10.0;
|
||||||
const float THRUST_LATERAL_MAG = 10.0;
|
|
||||||
const float THRUST_VERTICAL_MAG = 10.0;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
avatar.thrust = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
avatar.thrust = glm::dvec3( 0.0, 0.0, 0.0 );
|
|
||||||
|
|
||||||
if (driveKeys[FWD])
|
if (driveKeys[FWD])
|
||||||
{
|
{
|
||||||
//position.x += avatar.orientation.getFront().getX() * 0.01;
|
|
||||||
//position.y += avatar.orientation.getFront().getY() * 0.01;
|
|
||||||
//position.z -= avatar.orientation.getFront().getZ() * 0.01;
|
|
||||||
|
|
||||||
avatar.thrust.x += avatar.orientation.getFront().getX() * THRUST_MAG;
|
avatar.thrust.x += avatar.orientation.getFront().getX() * THRUST_MAG;
|
||||||
avatar.thrust.y += avatar.orientation.getFront().getY() * THRUST_MAG;
|
avatar.thrust.y += avatar.orientation.getFront().getY() * THRUST_MAG;
|
||||||
avatar.thrust.z -= avatar.orientation.getFront().getZ() * THRUST_MAG;
|
avatar.thrust.z -= avatar.orientation.getFront().getZ() * THRUST_MAG;
|
||||||
|
|
||||||
//thrust += THRUST_MAG*forward;
|
//thrust += THRUST_MAG*forward;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driveKeys[BACK])
|
if (driveKeys[BACK])
|
||||||
{
|
{
|
||||||
//position.x -= avatar.orientation.getFront().getX() * 0.01;
|
|
||||||
//position.y -= avatar.orientation.getFront().getY() * 0.01;
|
|
||||||
//position.z += avatar.orientation.getFront().getZ() * 0.01;
|
|
||||||
|
|
||||||
avatar.thrust.x -= avatar.orientation.getFront().getX() * THRUST_MAG;
|
avatar.thrust.x -= avatar.orientation.getFront().getX() * THRUST_MAG;
|
||||||
avatar.thrust.y -= avatar.orientation.getFront().getY() * THRUST_MAG;
|
avatar.thrust.y -= avatar.orientation.getFront().getY() * THRUST_MAG;
|
||||||
avatar.thrust.z += avatar.orientation.getFront().getZ() * THRUST_MAG;
|
avatar.thrust.z += avatar.orientation.getFront().getZ() * THRUST_MAG;
|
||||||
|
|
||||||
//thrust += -THRUST_MAG*forward;
|
//thrust += -THRUST_MAG*forward;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (driveKeys[RIGHT])
|
if (driveKeys[RIGHT])
|
||||||
{
|
{
|
||||||
//position.x += avatar.orientation.getRight().getX() * 0.01;
|
avatar.thrust.x += avatar.orientation.getRight().getX() * THRUST_LATERAL_MAG;
|
||||||
//position.y += avatar.orientation.getRight().getY() * 0.01;
|
avatar.thrust.y += avatar.orientation.getRight().getY() * THRUST_LATERAL_MAG;
|
||||||
//position.z -= avatar.orientation.getRight().getZ() * 0.01;
|
avatar.thrust.z -= avatar.orientation.getRight().getZ() * THRUST_LATERAL_MAG;
|
||||||
|
|
||||||
avatar.thrust.x += avatar.orientation.getRight().getX() * THRUST_MAG;
|
|
||||||
avatar.thrust.y += avatar.orientation.getRight().getY() * THRUST_MAG;
|
|
||||||
avatar.thrust.z -= avatar.orientation.getRight().getZ() * THRUST_MAG;
|
|
||||||
|
|
||||||
//thrust.x += forward.z*-THRUST_LATERAL_MAG;
|
//thrust.x += forward.z*-THRUST_LATERAL_MAG;
|
||||||
//thrust.z += forward.x*THRUST_LATERAL_MAG;
|
//thrust.z += forward.x*THRUST_LATERAL_MAG;
|
||||||
}
|
}
|
||||||
if (driveKeys[LEFT])
|
if (driveKeys[LEFT])
|
||||||
{
|
{
|
||||||
//position.x -= avatar.orientation.getRight().getX() * 0.01;
|
avatar.thrust.x -= avatar.orientation.getRight().getX() * THRUST_LATERAL_MAG;
|
||||||
//position.y -= avatar.orientation.getRight().getY() * 0.01;
|
avatar.thrust.y -= avatar.orientation.getRight().getY() * THRUST_LATERAL_MAG;
|
||||||
//position.z += avatar.orientation.getRight().getZ() * 0.01;
|
avatar.thrust.z += avatar.orientation.getRight().getZ() * THRUST_LATERAL_MAG;
|
||||||
|
|
||||||
avatar.thrust.x -= avatar.orientation.getRight().getX() * THRUST_MAG;
|
|
||||||
avatar.thrust.y -= avatar.orientation.getRight().getY() * THRUST_MAG;
|
|
||||||
avatar.thrust.z += avatar.orientation.getRight().getZ() * THRUST_MAG;
|
|
||||||
|
|
||||||
//thrust.x += forward.z*THRUST_LATERAL_MAG;
|
//thrust.x += forward.z*THRUST_LATERAL_MAG;
|
||||||
//thrust.z += forward.x*-THRUST_LATERAL_MAG;
|
//thrust.z += forward.x*-THRUST_LATERAL_MAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (driveKeys[UP])
|
if (driveKeys[UP])
|
||||||
{
|
{
|
||||||
//position.x -= avatar.orientation.getUp().getX() * 0.01;
|
avatar.thrust.x -= avatar.orientation.getUp().getX() * THRUST_VERTICAL_MAG;
|
||||||
//position.y -= avatar.orientation.getUp().getY() * 0.01;
|
avatar.thrust.y -= avatar.orientation.getUp().getY() * THRUST_VERTICAL_MAG;
|
||||||
//position.z += avatar.orientation.getUp().getZ() * 0.01;
|
avatar.thrust.z += avatar.orientation.getUp().getZ() * THRUST_VERTICAL_MAG;
|
||||||
|
|
||||||
avatar.thrust.x -= avatar.orientation.getUp().getX() * THRUST_MAG;
|
|
||||||
avatar.thrust.y -= avatar.orientation.getUp().getY() * THRUST_MAG;
|
|
||||||
avatar.thrust.z += avatar.orientation.getUp().getZ() * THRUST_MAG;
|
|
||||||
|
|
||||||
//thrust.y += -THRUST_VERTICAL_MAG;
|
//thrust.y += -THRUST_VERTICAL_MAG;
|
||||||
}
|
}
|
||||||
if (driveKeys[DOWN])
|
if (driveKeys[DOWN])
|
||||||
{
|
{
|
||||||
//position.x += avatar.orientation.getUp().getX() * 0.01;
|
avatar.thrust.x += avatar.orientation.getUp().getX() * THRUST_VERTICAL_MAG;
|
||||||
//position.y += avatar.orientation.getUp().getY() * 0.01;
|
avatar.thrust.y += avatar.orientation.getUp().getY() * THRUST_VERTICAL_MAG;
|
||||||
//position.z -= avatar.orientation.getUp().getZ() * 0.01;
|
avatar.thrust.z -= avatar.orientation.getUp().getZ() * THRUST_VERTICAL_MAG;
|
||||||
|
|
||||||
avatar.thrust.x += avatar.orientation.getUp().getX() * THRUST_MAG;
|
|
||||||
avatar.thrust.y += avatar.orientation.getUp().getY() * THRUST_MAG;
|
|
||||||
avatar.thrust.z -= avatar.orientation.getUp().getZ() * THRUST_MAG;
|
|
||||||
|
|
||||||
//thrust.y += THRUST_VERTICAL_MAG;
|
//thrust.y += THRUST_VERTICAL_MAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,9 +362,9 @@ void Head::simulate(float deltaTime)
|
||||||
|
|
||||||
//avatar.yawDelta *= 0.99;
|
//avatar.yawDelta *= 0.99;
|
||||||
|
|
||||||
avatar.velocity += avatar.thrust * (double)deltaTime;
|
avatar.velocity += glm::dvec3( avatar.thrust * deltaTime );
|
||||||
|
|
||||||
position += avatar.velocity * (double)deltaTime;
|
position += (glm::vec3)avatar.velocity * deltaTime;
|
||||||
|
|
||||||
//avatar.velocity *= 0.9;
|
//avatar.velocity *= 0.9;
|
||||||
|
|
||||||
|
@ -715,9 +673,9 @@ void Head::renderHead( int faceToFace, int isMine )
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
void Head::setHandMovement( glm::dvec3 movement )
|
void Head::setHandMovement( glm::vec3 movement )
|
||||||
{
|
{
|
||||||
handOffset = glm::dvec3( movement.x, -movement.y, movement.z );
|
handOffset = glm::vec3( movement.x, -movement.y, movement.z );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -725,22 +683,21 @@ void Head::setHandMovement( glm::dvec3 movement )
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
void Head::initializeAvatar()
|
void Head::initializeAvatar()
|
||||||
{
|
{
|
||||||
avatar.position = glm::dvec3( 0.0, 0.0, 0.0 );
|
avatar.position = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
avatar.velocity = glm::dvec3( 0.0, 0.0, 0.0 );
|
avatar.velocity = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
avatar.thrust = glm::dvec3( 0.0, 0.0, 0.0 );
|
avatar.thrust = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
avatar.orientation.setToIdentity();
|
avatar.orientation.setToIdentity();
|
||||||
|
|
||||||
avatar.yaw = 0.0;
|
avatar.yaw = 90.0;
|
||||||
avatar.pitch = 0.0;
|
avatar.pitch = 0.0;
|
||||||
avatar.roll = 0.0;
|
avatar.roll = 0.0;
|
||||||
|
|
||||||
avatar.yawDelta = 0.0;
|
avatar.yawDelta = 0.0;
|
||||||
|
|
||||||
for (int b=0; b<NUM_AVATAR_BONES; b++)
|
for (int b=0; b<NUM_AVATAR_BONES; b++)
|
||||||
{
|
{
|
||||||
avatar.bone[b].worldPosition = glm::dvec3( 0.0, 0.0, 0.0 );
|
avatar.bone[b].worldPosition = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
//avatar.bone[b].offsetPosition = glm::dvec3( 0.0, 0.0, 0.0 );
|
avatar.bone[b].velocity = glm::vec3( 0.0, 0.0, 0.0 );
|
||||||
avatar.bone[b].velocity = glm::dvec3( 0.0, 0.0, 0.0 );
|
|
||||||
avatar.bone[b].worldOrientation.setToIdentity();
|
avatar.bone[b].worldOrientation.setToIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,7 +735,7 @@ void Head::initializeAvatar()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// left pelvis and leg
|
// left pelvis and leg
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_PELVIS ].parent = AVATAR_BONE_NULL;
|
avatar.bone[ AVATAR_BONE_LEFT_PELVIS ].parent = AVATAR_BONE_PELVIS_SPINE;
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_THIGH ].parent = AVATAR_BONE_LEFT_PELVIS;
|
avatar.bone[ AVATAR_BONE_LEFT_THIGH ].parent = AVATAR_BONE_LEFT_PELVIS;
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_SHIN ].parent = AVATAR_BONE_LEFT_THIGH;
|
avatar.bone[ AVATAR_BONE_LEFT_SHIN ].parent = AVATAR_BONE_LEFT_THIGH;
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_FOOT ].parent = AVATAR_BONE_LEFT_SHIN;
|
avatar.bone[ AVATAR_BONE_LEFT_FOOT ].parent = AVATAR_BONE_LEFT_SHIN;
|
||||||
|
@ -786,7 +743,7 @@ void Head::initializeAvatar()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// right pelvis and leg
|
// right pelvis and leg
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_PELVIS ].parent = AVATAR_BONE_NULL;
|
avatar.bone[ AVATAR_BONE_RIGHT_PELVIS ].parent = AVATAR_BONE_PELVIS_SPINE;
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_THIGH ].parent = AVATAR_BONE_RIGHT_PELVIS;
|
avatar.bone[ AVATAR_BONE_RIGHT_THIGH ].parent = AVATAR_BONE_RIGHT_PELVIS;
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_SHIN ].parent = AVATAR_BONE_RIGHT_THIGH;
|
avatar.bone[ AVATAR_BONE_RIGHT_SHIN ].parent = AVATAR_BONE_RIGHT_THIGH;
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_FOOT ].parent = AVATAR_BONE_RIGHT_SHIN;
|
avatar.bone[ AVATAR_BONE_RIGHT_FOOT ].parent = AVATAR_BONE_RIGHT_SHIN;
|
||||||
|
@ -795,29 +752,29 @@ void Head::initializeAvatar()
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
// specify the default pose position
|
// specify the default pose position
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
avatar.bone[ AVATAR_BONE_PELVIS_SPINE ].defaultPosePosition = glm::dvec3( 0.0, 0.1, 0.0 );
|
avatar.bone[ AVATAR_BONE_PELVIS_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_MID_SPINE ].defaultPosePosition = glm::dvec3( 0.0, 0.1, 0.0 );
|
avatar.bone[ AVATAR_BONE_MID_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_CHEST_SPINE ].defaultPosePosition = glm::dvec3( 0.0, 0.1, 0.0 );
|
avatar.bone[ AVATAR_BONE_CHEST_SPINE ].defaultPosePosition = glm::vec3( 0.0, 0.1, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_NECK ].defaultPosePosition = glm::dvec3( 0.0, 0.06, 0.0 );
|
avatar.bone[ AVATAR_BONE_NECK ].defaultPosePosition = glm::vec3( 0.0, 0.06, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_HEAD ].defaultPosePosition = glm::dvec3( 0.0, 0.06, 0.0 );
|
avatar.bone[ AVATAR_BONE_HEAD ].defaultPosePosition = glm::vec3( 0.0, 0.06, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_CHEST ].defaultPosePosition = glm::dvec3( -0.06, 0.06, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_CHEST ].defaultPosePosition = glm::vec3( -0.06, 0.06, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_SHOULDER ].defaultPosePosition = glm::dvec3( -0.03, 0.0, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_SHOULDER ].defaultPosePosition = glm::vec3( -0.03, 0.0, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_UPPER_ARM ].defaultPosePosition = glm::dvec3( 0.0, -0.12, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_UPPER_ARM ].defaultPosePosition = glm::vec3( 0.0, -0.12, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_FOREARM ].defaultPosePosition = glm::dvec3( 0.0, -0.1, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_FOREARM ].defaultPosePosition = glm::vec3( 0.0, -0.1, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_HAND ].defaultPosePosition = glm::dvec3( 0.0, -0.05, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_HAND ].defaultPosePosition = glm::vec3( 0.0, -0.05, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_CHEST ].defaultPosePosition = glm::dvec3( 0.06, 0.06, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_CHEST ].defaultPosePosition = glm::vec3( 0.06, 0.06, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].defaultPosePosition = glm::dvec3( 0.03, 0.0, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].defaultPosePosition = glm::vec3( 0.03, 0.0, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].defaultPosePosition = glm::dvec3( 0.0, -0.12, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].defaultPosePosition = glm::vec3( 0.0, -0.12, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_FOREARM ].defaultPosePosition = glm::dvec3( 0.0, -0.1, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_FOREARM ].defaultPosePosition = glm::vec3( 0.0, -0.1, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_HAND ].defaultPosePosition = glm::dvec3( 0.0, -0.05, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_HAND ].defaultPosePosition = glm::vec3( 0.0, -0.05, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_PELVIS ].defaultPosePosition = glm::dvec3( -0.05, 0.0, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_PELVIS ].defaultPosePosition = glm::vec3( -0.05, 0.0, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_THIGH ].defaultPosePosition = glm::dvec3( 0.0, -0.15, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_THIGH ].defaultPosePosition = glm::vec3( 0.0, -0.15, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_SHIN ].defaultPosePosition = glm::dvec3( 0.0, -0.15, 0.0 );
|
avatar.bone[ AVATAR_BONE_LEFT_SHIN ].defaultPosePosition = glm::vec3( 0.0, -0.15, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_LEFT_FOOT ].defaultPosePosition = glm::dvec3( 0.0, 0.0, 0.04 );
|
avatar.bone[ AVATAR_BONE_LEFT_FOOT ].defaultPosePosition = glm::vec3( 0.0, 0.0, 0.04 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_PELVIS ].defaultPosePosition = glm::dvec3( 0.05, 0.0, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_PELVIS ].defaultPosePosition = glm::vec3( 0.05, 0.0, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_THIGH ].defaultPosePosition = glm::dvec3( 0.0, -0.15, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_THIGH ].defaultPosePosition = glm::vec3( 0.0, -0.15, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_SHIN ].defaultPosePosition = glm::dvec3( 0.0, -0.15, 0.0 );
|
avatar.bone[ AVATAR_BONE_RIGHT_SHIN ].defaultPosePosition = glm::vec3( 0.0, -0.15, 0.0 );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_FOOT ].defaultPosePosition = glm::dvec3( 0.0, 0.0, 0.04 );
|
avatar.bone[ AVATAR_BONE_RIGHT_FOOT ].defaultPosePosition = glm::vec3( 0.0, 0.0, 0.04 );
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// calculate bone length
|
// calculate bone length
|
||||||
|
@ -880,19 +837,19 @@ void Head::updateAvatarSkeleton()
|
||||||
avatar.bone[b].worldPosition = avatar.bone[ avatar.bone[b].parent ].worldPosition;
|
avatar.bone[b].worldPosition = avatar.bone[ avatar.bone[b].parent ].worldPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
double xx = glm::dot( avatar.bone[b].defaultPosePosition.x, avatar.bone[b].worldOrientation.getRight ().x )
|
float xx = glm::dot( avatar.bone[b].defaultPosePosition.x, (float)avatar.bone[b].worldOrientation.getRight ().x )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.y, avatar.bone[b].worldOrientation.getRight ().y )
|
+ glm::dot( avatar.bone[b].defaultPosePosition.y, (float)avatar.bone[b].worldOrientation.getRight ().y )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.z, avatar.bone[b].worldOrientation.getRight ().z );
|
+ glm::dot( avatar.bone[b].defaultPosePosition.z, (float)avatar.bone[b].worldOrientation.getRight ().z );
|
||||||
|
|
||||||
double yy = glm::dot( avatar.bone[b].defaultPosePosition.x, avatar.bone[b].worldOrientation.getUp ().x )
|
float yy = glm::dot( avatar.bone[b].defaultPosePosition.x, (float)avatar.bone[b].worldOrientation.getUp ().x )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.y, avatar.bone[b].worldOrientation.getUp ().y )
|
+ glm::dot( avatar.bone[b].defaultPosePosition.y, (float)avatar.bone[b].worldOrientation.getUp ().y )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.z, avatar.bone[b].worldOrientation.getUp ().z );
|
+ glm::dot( avatar.bone[b].defaultPosePosition.z, (float)avatar.bone[b].worldOrientation.getUp ().z );
|
||||||
|
|
||||||
double zz = glm::dot( avatar.bone[b].defaultPosePosition.x, avatar.bone[b].worldOrientation.getFront ().x )
|
float zz = glm::dot( avatar.bone[b].defaultPosePosition.x, (float)avatar.bone[b].worldOrientation.getFront ().x )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.y, avatar.bone[b].worldOrientation.getFront ().y )
|
+ glm::dot( avatar.bone[b].defaultPosePosition.y, (float)avatar.bone[b].worldOrientation.getFront ().y )
|
||||||
+ glm::dot( avatar.bone[b].defaultPosePosition.z, avatar.bone[b].worldOrientation.getFront ().z );
|
+ glm::dot( avatar.bone[b].defaultPosePosition.z, (float)avatar.bone[b].worldOrientation.getFront ().z );
|
||||||
|
|
||||||
glm::dvec3 rotatedBoneVector( xx, yy, zz );
|
glm::vec3 rotatedBoneVector( xx, yy, zz );
|
||||||
|
|
||||||
//rotatedBonePosition.x = avatar.bone[b].defaultPosePosition.x;// * avatar.bone[b].worldOrientation.getFront().x;
|
//rotatedBonePosition.x = avatar.bone[b].defaultPosePosition.x;// * avatar.bone[b].worldOrientation.getFront().x;
|
||||||
//rotatedBonePosition.y = avatar.bone[b].defaultPosePosition.y;// * avatar.bone[b].worldOrientation.getFront().y;
|
//rotatedBonePosition.y = avatar.bone[b].defaultPosePosition.y;// * avatar.bone[b].worldOrientation.getFront().y;
|
||||||
|
@ -947,7 +904,7 @@ void Head::updateAvatarSkeleton()
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
double Head::getAvatarYaw()
|
float Head::getAvatarYaw()
|
||||||
{
|
{
|
||||||
return avatar.yaw;
|
return avatar.yaw;
|
||||||
}
|
}
|
||||||
|
@ -969,7 +926,6 @@ void Head::updateHandMovement()
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
float distance = glm::length( armVector );
|
float distance = glm::length( armVector );
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
// if right hand is being dragged beyond maximum arm length...
|
// if right hand is being dragged beyond maximum arm length...
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
|
@ -992,9 +948,18 @@ void Head::updateHandMovement()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
glm::vec3 newElbowPosition = avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].worldPosition;
|
glm::vec3 newElbowPosition = avatar.bone[ AVATAR_BONE_RIGHT_SHOULDER ].worldPosition;
|
||||||
newElbowPosition += armVector * (float)ONE_HALF;
|
newElbowPosition += armVector * (float)ONE_HALF;
|
||||||
glm::dvec3 perpendicular = glm::dvec3( -armVector.y, armVector.x, armVector.z );
|
glm::vec3 perpendicular = glm::vec3( -armVector.y, armVector.x, armVector.z );
|
||||||
newElbowPosition += perpendicular * ( 1.0 - ( avatar.maxArmLength / distance ) ) * ONE_HALF;
|
newElbowPosition += perpendicular * (float)( ( 1.0 - ( avatar.maxArmLength / distance ) ) * ONE_HALF );
|
||||||
avatar.bone[ AVATAR_BONE_RIGHT_FOREARM ].worldPosition = newElbowPosition;
|
avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].worldPosition = newElbowPosition;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// set wrist position
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
glm::vec3 vv( avatar.bone[ AVATAR_BONE_RIGHT_HAND ].worldPosition );
|
||||||
|
vv -= avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].worldPosition;
|
||||||
|
glm::vec3 newWristPosition = avatar.bone[ AVATAR_BONE_RIGHT_UPPER_ARM ].worldPosition;
|
||||||
|
newWristPosition += vv * 0.7f;
|
||||||
|
avatar.bone[ AVATAR_BONE_RIGHT_FOREARM ].worldPosition = newWristPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1005,7 +970,9 @@ void Head::renderBody()
|
||||||
{
|
{
|
||||||
glColor3fv(skinColor);
|
glColor3fv(skinColor);
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
// Render bones as spheres
|
// Render bones as spheres
|
||||||
|
//-----------------------------------------
|
||||||
for (int b=0; b<NUM_AVATAR_BONES; b++)
|
for (int b=0; b<NUM_AVATAR_BONES; b++)
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -1014,9 +981,21 @@ void Head::renderBody()
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------
|
||||||
// Render lines connecting the bones
|
// Render lines connecting the bones
|
||||||
|
//-----------------------------------------
|
||||||
glColor3f(1,1,1);
|
glColor3f(1,1,1);
|
||||||
glLineWidth(3.0);
|
glLineWidth(3.0);
|
||||||
|
|
||||||
|
for (int b=1; b<NUM_AVATAR_BONES; b++)
|
||||||
|
{
|
||||||
|
glBegin( GL_LINE_STRIP );
|
||||||
|
glVertex3fv( &avatar.bone[ avatar.bone[ b ].parent ].worldPosition.x);
|
||||||
|
glVertex3fv( &avatar.bone[ b ].worldPosition.x);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
glVertex3fv(&avatar.bone[AVATAR_BONE_CHEST_SPINE].worldPosition.x);
|
glVertex3fv(&avatar.bone[AVATAR_BONE_CHEST_SPINE].worldPosition.x);
|
||||||
glVertex3fv(&avatar.bone[AVATAR_BONE_NECK].worldPosition.x);
|
glVertex3fv(&avatar.bone[AVATAR_BONE_NECK].worldPosition.x);
|
||||||
|
@ -1052,6 +1031,8 @@ void Head::renderBody()
|
||||||
glVertex3fv(&avatar.bone[AVATAR_BONE_RIGHT_SHIN].worldPosition.x);
|
glVertex3fv(&avatar.bone[AVATAR_BONE_RIGHT_SHIN].worldPosition.x);
|
||||||
glVertex3fv(&avatar.bone[AVATAR_BONE_RIGHT_FOOT].worldPosition.x);
|
glVertex3fv(&avatar.bone[AVATAR_BONE_RIGHT_FOOT].worldPosition.x);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,7 +1071,9 @@ void Head::parseData(void *data, int size)
|
||||||
&Pitch, &Yaw, &Roll,
|
&Pitch, &Yaw, &Roll,
|
||||||
&position.x, &position.y, &position.z,
|
&position.x, &position.y, &position.z,
|
||||||
&loudness, &averageLoudness,
|
&loudness, &averageLoudness,
|
||||||
&handPos.x, &handPos.y, &handPos.z
|
&avatar.bone[ AVATAR_BONE_RIGHT_HAND ].worldPosition.x,
|
||||||
|
&avatar.bone[ AVATAR_BONE_RIGHT_HAND ].worldPosition.y,
|
||||||
|
&avatar.bone[ AVATAR_BONE_RIGHT_HAND ].worldPosition.z
|
||||||
);
|
);
|
||||||
|
|
||||||
if (glm::length(handPos) > 0.0) hand->setPos(handPos);
|
if (glm::length(handPos) > 0.0) hand->setPos(handPos);
|
||||||
|
|
|
@ -105,25 +105,25 @@ struct AvatarBone
|
||||||
{
|
{
|
||||||
AvatarBones parent;
|
AvatarBones parent;
|
||||||
glm::vec3 worldPosition;
|
glm::vec3 worldPosition;
|
||||||
glm::dvec3 defaultPosePosition;
|
glm::vec3 defaultPosePosition;
|
||||||
glm::dvec3 velocity;
|
glm::dvec3 velocity;
|
||||||
double yaw;
|
float yaw;
|
||||||
double pitch;
|
float pitch;
|
||||||
double roll;
|
float roll;
|
||||||
Orientation worldOrientation;
|
Orientation worldOrientation;
|
||||||
double length;
|
float length;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Avatar
|
struct Avatar
|
||||||
{
|
{
|
||||||
glm::dvec3 position;
|
glm::vec3 position;
|
||||||
glm::dvec3 velocity;
|
glm::dvec3 velocity;
|
||||||
glm::dvec3 thrust;
|
glm::vec3 thrust;
|
||||||
double yaw;
|
float yaw;
|
||||||
double pitch;
|
float pitch;
|
||||||
double roll;
|
float roll;
|
||||||
double yawDelta;
|
float yawDelta;
|
||||||
double maxArmLength;
|
float maxArmLength;
|
||||||
Orientation orientation;
|
Orientation orientation;
|
||||||
AvatarBone bone[ NUM_AVATAR_BONES ];
|
AvatarBone bone[ NUM_AVATAR_BONES ];
|
||||||
};
|
};
|
||||||
|
@ -157,17 +157,17 @@ class Head : public AgentData {
|
||||||
float getYaw() {return Yaw;}
|
float getYaw() {return Yaw;}
|
||||||
float getLastMeasuredYaw() {return YawRate;}
|
float getLastMeasuredYaw() {return YawRate;}
|
||||||
|
|
||||||
double getAvatarYaw();
|
float getAvatarYaw();
|
||||||
|
|
||||||
void render(int faceToFace, int isMine);
|
void render(int faceToFace, int isMine);
|
||||||
|
|
||||||
void setAvatarPosition( double, double, double );
|
void setAvatarPosition( float, float, float );
|
||||||
void renderBody();
|
void renderBody();
|
||||||
void renderHead( int faceToFace, int isMine );
|
void renderHead( int faceToFace, int isMine );
|
||||||
|
|
||||||
void simulate(float);
|
void simulate(float);
|
||||||
|
|
||||||
void setHandMovement( glm::dvec3 movement );
|
void setHandMovement( glm::vec3 movement );
|
||||||
void updateHandMovement();
|
void updateHandMovement();
|
||||||
|
|
||||||
// Send and receive network data
|
// Send and receive network data
|
||||||
|
@ -233,7 +233,7 @@ class Head : public AgentData {
|
||||||
glm::vec3 velocity;
|
glm::vec3 velocity;
|
||||||
glm::vec3 thrust;
|
glm::vec3 thrust;
|
||||||
|
|
||||||
glm::dvec3 handOffset;
|
glm::vec3 handOffset;
|
||||||
|
|
||||||
int driveKeys[MAX_DRIVE_KEYS];
|
int driveKeys[MAX_DRIVE_KEYS];
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "Cloud.h"
|
#include "Cloud.h"
|
||||||
#include <AgentList.h>
|
#include <AgentList.h>
|
||||||
|
#include <AgentTypes.h>
|
||||||
#include "VoxelSystem.h"
|
#include "VoxelSystem.h"
|
||||||
#include "Lattice.h"
|
#include "Lattice.h"
|
||||||
#include "Finger.h"
|
#include "Finger.h"
|
||||||
|
@ -70,7 +71,7 @@ using namespace std;
|
||||||
int audio_on = 1; // Whether to turn on the audio support
|
int audio_on = 1; // Whether to turn on the audio support
|
||||||
int simulate_on = 1;
|
int simulate_on = 1;
|
||||||
|
|
||||||
AgentList agentList('I');
|
AgentList agentList(AGENT_TYPE_INTERFACE);
|
||||||
pthread_t networkReceiveThread;
|
pthread_t networkReceiveThread;
|
||||||
bool stopNetworkReceiveThread = false;
|
bool stopNetworkReceiveThread = false;
|
||||||
|
|
||||||
|
@ -384,7 +385,7 @@ void init(void)
|
||||||
}
|
}
|
||||||
myHead.setPos(start_location );
|
myHead.setPos(start_location );
|
||||||
|
|
||||||
myCamera.setPosition( glm::dvec3( start_location ) );
|
myCamera.setPosition( start_location );
|
||||||
|
|
||||||
#ifdef MARKER_CAPTURE
|
#ifdef MARKER_CAPTURE
|
||||||
if(marker_capture_enabled){
|
if(marker_capture_enabled){
|
||||||
|
@ -595,47 +596,45 @@ void display(void)
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
||||||
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// set the camera to third-person view
|
// camera settings
|
||||||
//-------------------------------------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
myCamera.setTargetPosition( (glm::dvec3)myHead.getPos() );
|
myCamera.setTargetPosition( myHead.getPos() );
|
||||||
myCamera.setPitch ( 0.0 );
|
|
||||||
myCamera.setRoll ( 0.0 );
|
|
||||||
|
|
||||||
if ( display_head )
|
if ( display_head )
|
||||||
//-------------------------------------------------------------------------------------
|
|
||||||
// set the camera to looking at my face
|
|
||||||
//-------------------------------------------------------------------------------------
|
|
||||||
{
|
{
|
||||||
|
//-----------------------------------------------
|
||||||
|
// set the camera to looking at my own face
|
||||||
|
//-----------------------------------------------
|
||||||
myCamera.setYaw ( - myHead.getAvatarYaw() );
|
myCamera.setYaw ( - myHead.getAvatarYaw() );
|
||||||
|
myCamera.setPitch ( 0.0 );
|
||||||
|
myCamera.setRoll ( 0.0 );
|
||||||
myCamera.setUp ( 0.4 );
|
myCamera.setUp ( 0.4 );
|
||||||
|
myCamera.setDistance( 0.5 );
|
||||||
myCamera.setDistance( 0.08 );
|
myCamera.setDistance( 0.08 );
|
||||||
myCamera.update();
|
myCamera.update();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
//-------------------------------------------------------------------------------------
|
|
||||||
// set the camera to third-person view
|
|
||||||
//-------------------------------------------------------------------------------------
|
|
||||||
{
|
{
|
||||||
|
//----------------------------------------------------
|
||||||
|
// set the camera to third-person view behind my av
|
||||||
|
//----------------------------------------------------
|
||||||
myCamera.setYaw ( 180.0 - myHead.getAvatarYaw() );
|
myCamera.setYaw ( 180.0 - myHead.getAvatarYaw() );
|
||||||
myCamera.setUp ( 0.15 );
|
myCamera.setPitch ( 10.0 );
|
||||||
myCamera.setDistance( 0.08 );
|
myCamera.setRoll ( 0.0 );
|
||||||
|
myCamera.setUp ( 0.2 );
|
||||||
|
myCamera.setDistance( 1.6 );
|
||||||
|
myCamera.setDistance( 0.5 );
|
||||||
myCamera.update();
|
myCamera.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//---------------------------------------------
|
||||||
// transform to camera view
|
// transform view according to myCamera
|
||||||
//-------------------------------------------------------------------------------------
|
//---------------------------------------------
|
||||||
glRotatef ( myCamera.getPitch(), 1, 0, 0 );
|
glRotatef ( myCamera.getPitch(), 1, 0, 0 );
|
||||||
glRotatef ( myCamera.getYaw(), 0, 1, 0 );
|
glRotatef ( myCamera.getYaw(), 0, 1, 0 );
|
||||||
glRotatef ( myCamera.getRoll(), 0, 0, 1 );
|
glRotatef ( myCamera.getRoll(), 0, 0, 1 );
|
||||||
|
|
||||||
//printf( "myCamera position = %f, %f, %f\n", myCamera.getPosition().x, myCamera.getPosition().y, myCamera.getPosition().z );
|
|
||||||
|
|
||||||
glTranslatef( myCamera.getPosition().x, myCamera.getPosition().y, myCamera.getPosition().z );
|
glTranslatef( myCamera.getPosition().x, myCamera.getPosition().y, myCamera.getPosition().z );
|
||||||
|
|
||||||
// fixed view
|
|
||||||
//glTranslatef( 6.18, -0.15, 1.4 );
|
|
||||||
|
|
||||||
if (::starsOn) {
|
if (::starsOn) {
|
||||||
// should be the first rendering pass - w/o depth buffer / lighting
|
// should be the first rendering pass - w/o depth buffer / lighting
|
||||||
|
@ -660,8 +659,10 @@ void display(void)
|
||||||
if (display_field) field.render();
|
if (display_field) field.render();
|
||||||
|
|
||||||
// Render heads of other agents
|
// Render heads of other agents
|
||||||
for(std::vector<Agent>::iterator agent = agentList.getAgents().begin(); agent != agentList.getAgents().end(); agent++) {
|
for(std::vector<Agent>::iterator agent = agentList.getAgents().begin(); agent != agentList.getAgents().end(); agent++)
|
||||||
if (agent->getLinkedData() != NULL) {
|
{
|
||||||
|
if (agent->getLinkedData() != NULL)
|
||||||
|
{
|
||||||
Head *agentHead = (Head *)agent->getLinkedData();
|
Head *agentHead = (Head *)agent->getLinkedData();
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glm::vec3 pos = agentHead->getPos();
|
glm::vec3 pos = agentHead->getPos();
|
||||||
|
@ -671,7 +672,7 @@ void display(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!display_head) balls.render();
|
if ( !display_head ) balls.render();
|
||||||
|
|
||||||
// Render the world box
|
// Render the world box
|
||||||
if (!display_head && stats_on) render_world_box();
|
if (!display_head && stats_on) render_world_box();
|
||||||
|
@ -1043,19 +1044,34 @@ void idle(void)
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
if ( mouse_pressed == 1 )
|
if ( mouse_pressed == 1 )
|
||||||
{
|
{
|
||||||
double xOffset = ( mouse_x - mouse_start_x ) / (double)WIDTH;
|
float xOffset = ( mouse_x - mouse_start_x ) / (double)WIDTH;
|
||||||
double yOffset = ( mouse_y - mouse_start_y ) / (double)HEIGHT;
|
float yOffset = ( mouse_y - mouse_start_y ) / (double)HEIGHT;
|
||||||
|
|
||||||
double leftRight = xOffset;
|
float leftRight = xOffset;
|
||||||
double downUp = yOffset;
|
float downUp = yOffset;
|
||||||
double backFront = 0.0;
|
float backFront = 0.0;
|
||||||
|
|
||||||
glm::dvec3 handMovement( leftRight, downUp, backFront );
|
glm::vec3 handMovement( leftRight, downUp, backFront );
|
||||||
myHead.setHandMovement( handMovement );
|
myHead.setHandMovement( handMovement );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simulation
|
// Simulation
|
||||||
simulateHead(1.f/FPS);
|
simulateHead(1.f/FPS);
|
||||||
|
|
||||||
|
|
||||||
|
//test
|
||||||
|
/*
|
||||||
|
// simulate the other agents
|
||||||
|
for(std::vector<Agent>::iterator agent = agentList.getAgents().begin(); agent != agentList.getAgents().end(); agent++)
|
||||||
|
{
|
||||||
|
if (agent->getLinkedData() != NULL)
|
||||||
|
{
|
||||||
|
Head *agentHead = (Head *)agent->getLinkedData();
|
||||||
|
agentHead->simulate(1.f/FPS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
simulateHand(1.f/FPS);
|
simulateHand(1.f/FPS);
|
||||||
|
|
||||||
if (simulate_on) {
|
if (simulate_on) {
|
||||||
|
@ -1090,7 +1106,6 @@ void reshape(int width, int height)
|
||||||
fov.setResolution(width, height)
|
fov.setResolution(width, height)
|
||||||
.setBounds(glm::vec3(-0.5f,-0.5f,-500.0f), glm::vec3(0.5f, 0.5f, 0.1f) )
|
.setBounds(glm::vec3(-0.5f,-0.5f,-500.0f), glm::vec3(0.5f, 0.5f, 0.1f) )
|
||||||
.setPerspective(0.7854f);
|
.setPerspective(0.7854f);
|
||||||
|
|
||||||
glLoadMatrixf(glm::value_ptr(fov.getViewerScreenXform()));
|
glLoadMatrixf(glm::value_ptr(fov.getViewerScreenXform()));
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <AgentList.h>
|
#include <AgentList.h>
|
||||||
|
#include <AgentTypes.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <StdDev.h>
|
#include <StdDev.h>
|
||||||
#include "AudioRingBuffer.h"
|
#include "AudioRingBuffer.h"
|
||||||
|
@ -60,7 +61,7 @@ const int AGENT_LOOPBACK_MODIFIER = 307;
|
||||||
|
|
||||||
const int LOOPBACK_SANITY_CHECK = 0;
|
const int LOOPBACK_SANITY_CHECK = 0;
|
||||||
|
|
||||||
AgentList agentList('M', MIXER_LISTEN_PORT);
|
AgentList agentList(AGENT_TYPE_MIXER, MIXER_LISTEN_PORT);
|
||||||
StDev stdev;
|
StDev stdev;
|
||||||
|
|
||||||
void plateauAdditionOfSamples(int16_t &mixSample, int16_t sampleToAdd) {
|
void plateauAdditionOfSamples(int16_t &mixSample, int16_t sampleToAdd) {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "Agent.h"
|
#include "Agent.h"
|
||||||
|
#include "AgentTypes.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "UDPSocket.h"
|
#include "UDPSocket.h"
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
|
@ -90,10 +91,36 @@ Agent::~Agent() {
|
||||||
delete linkedData;
|
delete linkedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
char Agent::getType() {
|
char Agent::getType() const {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Names of Agent Types
|
||||||
|
const char* AGENT_TYPE_NAME_DOMAIN = "Domain";
|
||||||
|
const char* AGENT_TYPE_NAME_VOXEL = "Voxel Server";
|
||||||
|
const char* AGENT_TYPE_NAME_INTERFACE = "Client Interface";
|
||||||
|
const char* AGENT_TYPE_NAME_MIXER = "Audio Mixer";
|
||||||
|
const char* AGENT_TYPE_NAME_UNKNOWN = "Unknown";
|
||||||
|
|
||||||
|
const char* Agent::getTypeName() const {
|
||||||
|
const char* name = AGENT_TYPE_NAME_UNKNOWN;
|
||||||
|
switch (this->type) {
|
||||||
|
case AGENT_TYPE_DOMAIN:
|
||||||
|
name = AGENT_TYPE_NAME_DOMAIN;
|
||||||
|
break;
|
||||||
|
case AGENT_TYPE_VOXEL:
|
||||||
|
name = AGENT_TYPE_NAME_VOXEL;
|
||||||
|
break;
|
||||||
|
case AGENT_TYPE_INTERFACE:
|
||||||
|
name = AGENT_TYPE_NAME_INTERFACE;
|
||||||
|
break;
|
||||||
|
case AGENT_TYPE_MIXER:
|
||||||
|
name = AGENT_TYPE_NAME_MIXER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
void Agent::setType(char newType) {
|
void Agent::setType(char newType) {
|
||||||
type = newType;
|
type = newType;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +201,7 @@ std::ostream& operator<<(std::ostream& os, const Agent* agent) {
|
||||||
sockaddr_in *agentPublicSocket = (sockaddr_in *)agent->publicSocket;
|
sockaddr_in *agentPublicSocket = (sockaddr_in *)agent->publicSocket;
|
||||||
sockaddr_in *agentLocalSocket = (sockaddr_in *)agent->localSocket;
|
sockaddr_in *agentLocalSocket = (sockaddr_in *)agent->localSocket;
|
||||||
|
|
||||||
os << "T: " << agent->type << " PA: " << inet_ntoa(agentPublicSocket->sin_addr) <<
|
os << "T: " << agent->getTypeName() << " (" << agent->type << ") PA: " << inet_ntoa(agentPublicSocket->sin_addr) <<
|
||||||
":" << ntohs(agentPublicSocket->sin_port) << " LA: " << inet_ntoa(agentLocalSocket->sin_addr) <<
|
":" << ntohs(agentPublicSocket->sin_port) << " LA: " << inet_ntoa(agentLocalSocket->sin_addr) <<
|
||||||
":" << ntohs(agentLocalSocket->sin_port);
|
":" << ntohs(agentLocalSocket->sin_port);
|
||||||
return os;
|
return os;
|
||||||
|
|
|
@ -40,7 +40,8 @@ public:
|
||||||
|
|
||||||
pthread_mutex_t deleteMutex;
|
pthread_mutex_t deleteMutex;
|
||||||
|
|
||||||
char getType();
|
char getType() const;
|
||||||
|
const char* getTypeName() const;
|
||||||
void setType(char newType);
|
void setType(char newType);
|
||||||
uint16_t getAgentId();
|
uint16_t getAgentId();
|
||||||
void setAgentId(uint16_t thisAgentId);
|
void setAgentId(uint16_t thisAgentId);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include "AgentList.h"
|
#include "AgentList.h"
|
||||||
|
#include "AgentTypes.h"
|
||||||
#include "PacketHeaders.h"
|
#include "PacketHeaders.h"
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
|
@ -180,13 +181,13 @@ bool AgentList::addOrUpdateAgent(sockaddr *publicSocket, sockaddr *localSocket,
|
||||||
newAgent.activatePublicSocket();
|
newAgent.activatePublicSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newAgent.getType() == 'M' && audioMixerSocketUpdate != NULL) {
|
if (newAgent.getType() == AGENT_TYPE_MIXER && audioMixerSocketUpdate != NULL) {
|
||||||
// this is an audio mixer
|
// this is an audio mixer
|
||||||
// for now that means we need to tell the audio class
|
// for now that means we need to tell the audio class
|
||||||
// to use the local socket information the domain server gave us
|
// to use the local socket information the domain server gave us
|
||||||
sockaddr_in *publicSocketIn = (sockaddr_in *)publicSocket;
|
sockaddr_in *publicSocketIn = (sockaddr_in *)publicSocket;
|
||||||
audioMixerSocketUpdate(publicSocketIn->sin_addr.s_addr, publicSocketIn->sin_port);
|
audioMixerSocketUpdate(publicSocketIn->sin_addr.s_addr, publicSocketIn->sin_port);
|
||||||
} else if (newAgent.getType() == 'V') {
|
} else if (newAgent.getType() == AGENT_TYPE_VOXEL) {
|
||||||
newAgent.activatePublicSocket();
|
newAgent.activatePublicSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +200,7 @@ bool AgentList::addOrUpdateAgent(sockaddr *publicSocket, sockaddr *localSocket,
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (agent->getType() == 'M' || agent->getType() == 'V') {
|
if (agent->getType() == AGENT_TYPE_MIXER || agent->getType() == AGENT_TYPE_VOXEL) {
|
||||||
// until the Audio class also uses our agentList, we need to update
|
// until the Audio class also uses our agentList, we need to update
|
||||||
// the lastRecvTimeUsecs for the audio mixer so it doesn't get killed and re-added continously
|
// the lastRecvTimeUsecs for the audio mixer so it doesn't get killed and re-added continously
|
||||||
agent->setLastRecvTimeUsecs(usecTimestampNow());
|
agent->setLastRecvTimeUsecs(usecTimestampNow());
|
||||||
|
@ -210,9 +211,10 @@ bool AgentList::addOrUpdateAgent(sockaddr *publicSocket, sockaddr *localSocket,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AgentList::AGENTS_OF_TYPE_HEAD = "H";
|
// XXXBHG - do we want to move these?
|
||||||
const char* AgentList::AGENTS_OF_TYPE_VOXEL_AND_INTERFACE = "VI";
|
|
||||||
const char* AgentList::AGENTS_OF_TYPE_VOXEL = "V";
|
const char* AgentList::AGENTS_OF_TYPE_VOXEL = "V";
|
||||||
|
const char* AgentList::AGENTS_OF_TYPE_INTERFACE = "I";
|
||||||
|
const char* AgentList::AGENTS_OF_TYPE_VOXEL_AND_INTERFACE = "VI";
|
||||||
|
|
||||||
void AgentList::broadcastToAgents(char *broadcastData, size_t dataBytes,const char* agentTypes) {
|
void AgentList::broadcastToAgents(char *broadcastData, size_t dataBytes,const char* agentTypes) {
|
||||||
for(std::vector<Agent>::iterator agent = agents.begin(); agent != agents.end(); agent++) {
|
for(std::vector<Agent>::iterator agent = agents.begin(); agent != agents.end(); agent++) {
|
||||||
|
@ -229,7 +231,7 @@ void AgentList::pingAgents() {
|
||||||
*payload = PACKET_HEADER_PING;
|
*payload = PACKET_HEADER_PING;
|
||||||
|
|
||||||
for(std::vector<Agent>::iterator agent = agents.begin(); agent != agents.end(); agent++) {
|
for(std::vector<Agent>::iterator agent = agents.begin(); agent != agents.end(); agent++) {
|
||||||
if (agent->getType() == 'I') {
|
if (agent->getType() == AGENT_TYPE_INTERFACE) {
|
||||||
if (agent->getActiveSocket() != NULL) {
|
if (agent->getActiveSocket() != NULL) {
|
||||||
// we know which socket is good for this agent, send there
|
// we know which socket is good for this agent, send there
|
||||||
agentSocket.send(agent->getActiveSocket(), payload, 1);
|
agentSocket.send(agent->getActiveSocket(), payload, 1);
|
||||||
|
@ -268,7 +270,8 @@ void *removeSilentAgents(void *args) {
|
||||||
|
|
||||||
pthread_mutex_t * agentDeleteMutex = &agent->deleteMutex;
|
pthread_mutex_t * agentDeleteMutex = &agent->deleteMutex;
|
||||||
|
|
||||||
if ((checkTimeUSecs - agent->getLastRecvTimeUsecs()) > AGENT_SILENCE_THRESHOLD_USECS && agent->getType() != 'V'
|
if ((checkTimeUSecs - agent->getLastRecvTimeUsecs()) > AGENT_SILENCE_THRESHOLD_USECS
|
||||||
|
&& agent->getType() != AGENT_TYPE_VOXEL
|
||||||
&& pthread_mutex_trylock(agentDeleteMutex) == 0) {
|
&& pthread_mutex_trylock(agentDeleteMutex) == 0) {
|
||||||
|
|
||||||
std::cout << "Killing agent " << &(*agent) << "\n";
|
std::cout << "Killing agent " << &(*agent) << "\n";
|
||||||
|
|
|
@ -67,10 +67,9 @@ public:
|
||||||
void startDomainServerCheckInThread();
|
void startDomainServerCheckInThread();
|
||||||
void stopDomainServerCheckInThread();
|
void stopDomainServerCheckInThread();
|
||||||
|
|
||||||
static const char* AGENTS_OF_TYPE_HEAD;
|
|
||||||
static const char* AGENTS_OF_TYPE_VOXEL_AND_INTERFACE;
|
|
||||||
static const char* AGENTS_OF_TYPE_VOXEL;
|
static const char* AGENTS_OF_TYPE_VOXEL;
|
||||||
|
static const char* AGENTS_OF_TYPE_INTERFACE;
|
||||||
|
static const char* AGENTS_OF_TYPE_VOXEL_AND_INTERFACE;
|
||||||
};
|
};
|
||||||
|
|
||||||
int unpackAgentId(unsigned char *packedData, uint16_t *agentId);
|
int unpackAgentId(unsigned char *packedData, uint16_t *agentId);
|
||||||
|
|
26
shared/src/AgentTypes.h
Normal file
26
shared/src/AgentTypes.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// AgentTypes.h
|
||||||
|
// hifi
|
||||||
|
//
|
||||||
|
// Created by Brad Hefta-Gaub on 2013/04/09
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Single byte/character Agent Types used to identify various agents in the system.
|
||||||
|
// For example, an agent whose is 'V' is always a voxel server.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_AgentTypes_h
|
||||||
|
#define hifi_AgentTypes_h
|
||||||
|
|
||||||
|
// NOTE: If you add a new AGENT_TYPE_XXX then you also should add a new AGENT_TYPE_NAME_XXX and a new "case" to the
|
||||||
|
// switch statement in Agent.cpp specifically Agent::getTypeName().
|
||||||
|
// If you don't then it will make things harder on your co-developers in debugging because the Agent
|
||||||
|
// class won't know the name and will report it as "Unknown".
|
||||||
|
|
||||||
|
// Agent Type Codes
|
||||||
|
const char AGENT_TYPE_DOMAIN = 'D';
|
||||||
|
const char AGENT_TYPE_VOXEL = 'V';
|
||||||
|
const char AGENT_TYPE_INTERFACE = 'I'; // could also be injector???
|
||||||
|
const char AGENT_TYPE_MIXER = 'M';
|
||||||
|
|
||||||
|
#endif
|
|
@ -13,6 +13,7 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <OctalCode.h>
|
#include <OctalCode.h>
|
||||||
#include <AgentList.h>
|
#include <AgentList.h>
|
||||||
|
#include <AgentTypes.h>
|
||||||
#include <VoxelTree.h>
|
#include <VoxelTree.h>
|
||||||
#include "VoxelAgentData.h"
|
#include "VoxelAgentData.h"
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
@ -45,7 +46,7 @@ const int PACKETS_PER_CLIENT_PER_INTERVAL = 2;
|
||||||
|
|
||||||
const int MAX_VOXEL_TREE_DEPTH_LEVELS = 4;
|
const int MAX_VOXEL_TREE_DEPTH_LEVELS = 4;
|
||||||
|
|
||||||
AgentList agentList('V', VOXEL_LISTEN_PORT);
|
AgentList agentList(AGENT_TYPE_VOXEL, VOXEL_LISTEN_PORT);
|
||||||
VoxelTree randomTree;
|
VoxelTree randomTree;
|
||||||
|
|
||||||
bool wantColorRandomizer = false;
|
bool wantColorRandomizer = false;
|
||||||
|
@ -344,7 +345,7 @@ int main(int argc, const char * argv[])
|
||||||
|
|
||||||
// Now send this to the connected agents so they know to delete
|
// Now send this to the connected agents so they know to delete
|
||||||
printf("rebroadcasting delete voxel message to connected agents... agentList.broadcastToAgents()\n");
|
printf("rebroadcasting delete voxel message to connected agents... agentList.broadcastToAgents()\n");
|
||||||
agentList.broadcastToAgents(packetData,receivedBytes,AgentList::AGENTS_OF_TYPE_HEAD);
|
agentList.broadcastToAgents(packetData,receivedBytes,AgentList::AGENTS_OF_TYPE_INTERFACE);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (packetData[0] == PACKET_HEADER_Z_COMMAND) {
|
if (packetData[0] == PACKET_HEADER_Z_COMMAND) {
|
||||||
|
@ -372,12 +373,14 @@ int main(int argc, const char * argv[])
|
||||||
|
|
||||||
// Now send this to the connected agents so they can also process these messages
|
// Now send this to the connected agents so they can also process these messages
|
||||||
printf("rebroadcasting Z message to connected agents... agentList.broadcastToAgents()\n");
|
printf("rebroadcasting Z message to connected agents... agentList.broadcastToAgents()\n");
|
||||||
agentList.broadcastToAgents(packetData,receivedBytes,AgentList::AGENTS_OF_TYPE_HEAD);
|
agentList.broadcastToAgents(packetData,receivedBytes,AgentList::AGENTS_OF_TYPE_INTERFACE);
|
||||||
}
|
}
|
||||||
|
// If we got a PACKET_HEADER_HEAD_DATA, then we're talking to an AGENT_TYPE_INTERFACE, and we
|
||||||
|
// need to make sure we have it in our agentList.
|
||||||
if (packetData[0] == PACKET_HEADER_HEAD_DATA) {
|
if (packetData[0] == PACKET_HEADER_HEAD_DATA) {
|
||||||
if (agentList.addOrUpdateAgent(&agentPublicAddress,
|
if (agentList.addOrUpdateAgent(&agentPublicAddress,
|
||||||
&agentPublicAddress,
|
&agentPublicAddress,
|
||||||
packetData[0],
|
AGENT_TYPE_INTERFACE,
|
||||||
agentList.getLastAgentId())) {
|
agentList.getLastAgentId())) {
|
||||||
agentList.increaseAgentId();
|
agentList.increaseAgentId();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue