mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +02:00
fixed some things based on recent code review
This commit is contained in:
parent
096e465d36
commit
75b57d17a7
3 changed files with 11 additions and 39 deletions
|
@ -208,7 +208,7 @@ int audioCallback (const void* inputBuffer,
|
||||||
// if we haven't fired off the flange effect, check if we should
|
// if we haven't fired off the flange effect, check if we should
|
||||||
// TODO: lastMeasuredHeadYaw is now relative to body - check if this still works.
|
// TODO: lastMeasuredHeadYaw is now relative to body - check if this still works.
|
||||||
|
|
||||||
int lastYawMeasured = fabsf(interfaceAvatar->getLastMeasuredHeadYaw());
|
int lastYawMeasured = fabsf(interfaceAvatar->getHeadYawRate());
|
||||||
|
|
||||||
if (!::samplesLeftForFlange && lastYawMeasured > MIN_FLANGE_EFFECT_THRESHOLD) {
|
if (!::samplesLeftForFlange && lastYawMeasured > MIN_FLANGE_EFFECT_THRESHOLD) {
|
||||||
// we should flange for one second
|
// we should flange for one second
|
||||||
|
|
|
@ -60,6 +60,8 @@ const float LEAN_AVERAGING = 10.0;
|
||||||
const float HEAD_RATE_MAX = 50.f;
|
const float HEAD_RATE_MAX = 50.f;
|
||||||
const float SKIN_COLOR[] = {1.0, 0.84, 0.66};
|
const float SKIN_COLOR[] = {1.0, 0.84, 0.66};
|
||||||
const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63};
|
const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63};
|
||||||
|
const int NUM_BODY_CONE_SIDES = 9;
|
||||||
|
|
||||||
|
|
||||||
bool usingBigSphereCollisionTest = true;
|
bool usingBigSphereCollisionTest = true;
|
||||||
|
|
||||||
|
@ -1239,8 +1241,6 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2,
|
||||||
|
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
|
|
||||||
int num = 9;
|
|
||||||
|
|
||||||
glm::vec3 axis = position2 - position1;
|
glm::vec3 axis = position2 - position1;
|
||||||
float length = glm::length(axis);
|
float length = glm::length(axis);
|
||||||
|
|
||||||
|
@ -1255,10 +1255,12 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2,
|
||||||
float anglea = 0.0;
|
float anglea = 0.0;
|
||||||
float angleb = 0.0;
|
float angleb = 0.0;
|
||||||
|
|
||||||
for (int i = 0; i < num; i ++) {
|
for (int i = 0; i < NUM_BODY_CONE_SIDES; i ++) {
|
||||||
|
|
||||||
|
// the rectangles that comprise the sides of the cone section are
|
||||||
|
// referenced by "a" and "b" in one dimension, and "1", and "2" in the other dimension.
|
||||||
anglea = angleb;
|
anglea = angleb;
|
||||||
angleb = ((float)(i+1) / (float)num) * PI * 2.0f;
|
angleb = ((float)(i+1) / (float)NUM_BODY_CONE_SIDES) * PI * 2.0f;
|
||||||
|
|
||||||
float sa = sinf(anglea);
|
float sa = sinf(anglea);
|
||||||
float sb = sinf(angleb);
|
float sb = sinf(angleb);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "SerialInterface.h"
|
#include "SerialInterface.h"
|
||||||
#include "Balls.h"
|
#include "Balls.h"
|
||||||
#include "Head.h"
|
#include "Head.h"
|
||||||
|
#include "Skeleton.h"
|
||||||
#include "Transmitter.h"
|
#include "Transmitter.h"
|
||||||
|
|
||||||
enum DriveKeys
|
enum DriveKeys
|
||||||
|
@ -41,38 +42,6 @@ enum AvatarMode
|
||||||
NUM_AVATAR_MODES
|
NUM_AVATAR_MODES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AvatarJointID
|
|
||||||
{
|
|
||||||
AVATAR_JOINT_NULL = -1,
|
|
||||||
AVATAR_JOINT_PELVIS,
|
|
||||||
AVATAR_JOINT_TORSO,
|
|
||||||
AVATAR_JOINT_CHEST,
|
|
||||||
AVATAR_JOINT_NECK_BASE,
|
|
||||||
AVATAR_JOINT_HEAD_BASE,
|
|
||||||
AVATAR_JOINT_HEAD_TOP,
|
|
||||||
AVATAR_JOINT_LEFT_COLLAR,
|
|
||||||
AVATAR_JOINT_LEFT_SHOULDER,
|
|
||||||
AVATAR_JOINT_LEFT_ELBOW,
|
|
||||||
AVATAR_JOINT_LEFT_WRIST,
|
|
||||||
AVATAR_JOINT_LEFT_FINGERTIPS,
|
|
||||||
AVATAR_JOINT_RIGHT_COLLAR,
|
|
||||||
AVATAR_JOINT_RIGHT_SHOULDER,
|
|
||||||
AVATAR_JOINT_RIGHT_ELBOW,
|
|
||||||
AVATAR_JOINT_RIGHT_WRIST,
|
|
||||||
AVATAR_JOINT_RIGHT_FINGERTIPS,
|
|
||||||
AVATAR_JOINT_LEFT_HIP,
|
|
||||||
AVATAR_JOINT_LEFT_KNEE,
|
|
||||||
AVATAR_JOINT_LEFT_HEEL,
|
|
||||||
AVATAR_JOINT_LEFT_TOES,
|
|
||||||
AVATAR_JOINT_RIGHT_HIP,
|
|
||||||
AVATAR_JOINT_RIGHT_KNEE,
|
|
||||||
AVATAR_JOINT_RIGHT_HEEL,
|
|
||||||
AVATAR_JOINT_RIGHT_TOES,
|
|
||||||
|
|
||||||
NUM_AVATAR_JOINTS
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class Avatar : public AvatarData {
|
class Avatar : public AvatarData {
|
||||||
public:
|
public:
|
||||||
Avatar(Agent* owningAgent = NULL);
|
Avatar(Agent* owningAgent = NULL);
|
||||||
|
@ -95,7 +64,7 @@ public:
|
||||||
void setMouseRay (const glm::vec3 &origin, const glm::vec3 &direction);
|
void setMouseRay (const glm::vec3 &origin, const glm::vec3 &direction);
|
||||||
|
|
||||||
//getters
|
//getters
|
||||||
float getLastMeasuredHeadYaw () const { return _head.yawRate;}
|
float getHeadYawRate () const { return _head.yawRate;}
|
||||||
float getBodyYaw () const { return _bodyYaw;}
|
float getBodyYaw () const { return _bodyYaw;}
|
||||||
bool getIsNearInteractingOther() const { return _avatarTouch.getAbleToReachOtherAvatar();}
|
bool getIsNearInteractingOther() const { return _avatarTouch.getAbleToReachOtherAvatar();}
|
||||||
const glm::vec3& getHeadPosition () const { return _joint[ AVATAR_JOINT_HEAD_BASE ].position;}
|
const glm::vec3& getHeadPosition () const { return _joint[ AVATAR_JOINT_HEAD_BASE ].position;}
|
||||||
|
@ -147,6 +116,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
Head _head;
|
Head _head;
|
||||||
|
Skeleton _skeleton;
|
||||||
float _TEST_bigSphereRadius;
|
float _TEST_bigSphereRadius;
|
||||||
glm::vec3 _TEST_bigSpherePosition;
|
glm::vec3 _TEST_bigSpherePosition;
|
||||||
bool _mousePressed;
|
bool _mousePressed;
|
||||||
|
|
Loading…
Reference in a new issue