mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:44:21 +02:00
Added thrust and velocity to avatar head, first part of movement improvements
This commit is contained in:
parent
bb14a90f86
commit
e0ee6c269a
3 changed files with 23 additions and 2 deletions
|
@ -42,7 +42,10 @@ GLUquadric *sphere = gluNewQuadric();
|
|||
|
||||
Head::Head()
|
||||
{
|
||||
position.x = position.y = position.z = 0;
|
||||
position = glm::vec3(0,0,0);
|
||||
velocity = glm::vec3(0,0,0);
|
||||
thrust = glm::vec3(0,0,0);
|
||||
|
||||
PupilSize = 0.10;
|
||||
interPupilDistance = 0.6;
|
||||
interBrowDistance = 0.75;
|
||||
|
@ -88,6 +91,8 @@ Head::Head()
|
|||
|
||||
Head::Head(const Head &otherHead) {
|
||||
position = otherHead.position;
|
||||
velocity = otherHead.velocity;
|
||||
thrust = otherHead.thrust;
|
||||
PupilSize = otherHead.PupilSize;
|
||||
interPupilDistance = otherHead.interPupilDistance;
|
||||
interBrowDistance = otherHead.interBrowDistance;
|
||||
|
@ -207,6 +212,11 @@ void Head::setLeanSideways(float dist){
|
|||
// Simulate the head over time
|
||||
void Head::simulate(float deltaTime)
|
||||
{
|
||||
// Increment position as a function of velocity
|
||||
position += velocity * deltaTime;
|
||||
// Increment velocity as time
|
||||
velocity += thrust * deltaTime;
|
||||
|
||||
if (!noise)
|
||||
{
|
||||
// Decay back toward center
|
||||
|
|
|
@ -65,6 +65,11 @@ class Head : public AgentData {
|
|||
glm::vec3 getPos() { return position; };
|
||||
void setPos(glm::vec3 newpos) { position = newpos; };
|
||||
|
||||
// Set/Get update the thrust that will move the avatar around
|
||||
void setThrust(glm::vec3 newThrust) { thrust = newThrust; };
|
||||
void addThrust(glm::vec3 newThrust) { thrust += newThrust; };
|
||||
glm::vec3 getThrust() { return thrust; };
|
||||
|
||||
Hand * hand;
|
||||
|
||||
private:
|
||||
|
@ -103,8 +108,14 @@ class Head : public AgentData {
|
|||
float browAudioLift;
|
||||
|
||||
glm::vec3 position;
|
||||
glm::vec3 velocity;
|
||||
glm::vec3 thrust;
|
||||
|
||||
bool fwdKey, backKey, turnLeftKey, turnRightKey, slideLeftKey, slideRightKey, upKey, downKey;
|
||||
|
||||
int eyeContact;
|
||||
eyeContactTargets eyeContactTarget;
|
||||
|
||||
void readSensors();
|
||||
float renderYaw, renderPitch; // Pitch from view frustum when this is own head.
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
const char * SOLO_AGENT_TYPES_STRING = "MV";
|
||||
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
|
||||
char DOMAIN_IP[100] = "192.168.1.47"; // IP Address will be re-set by lookup on startup
|
||||
char DOMAIN_IP[100] = ""; // IP Address will be re-set by lookup on startup
|
||||
const int DOMAINSERVER_PORT = 40102;
|
||||
|
||||
bool silentAgentThreadStopFlag = false;
|
||||
|
|
Loading…
Reference in a new issue