diff --git a/interface/src/Hand.cpp b/interface/src/Hand.cpp index ea57c91a9b..b23d89f7bd 100644 --- a/interface/src/Hand.cpp +++ b/interface/src/Hand.cpp @@ -27,6 +27,25 @@ Hand::Hand(glm::vec3 initcolor) renderPointer = true; } +Hand::Hand(const Hand &otherHand) { + color = otherHand.color; + noise = otherHand.noise; + scale = otherHand.scale; + position = otherHand.position; + target = otherHand.target; + velocity = otherHand.color; + pitch = otherHand.pitch; + yaw = otherHand.yaw; + roll = otherHand.roll; + pitchRate = otherHand.pitchRate; + yawRate = otherHand.yawRate; + rollRate = otherHand.rollRate; + transmitterTimer = otherHand.transmitterTimer; + transmitterHz = otherHand.transmitterHz; + transmitterPackets = otherHand.transmitterPackets; + renderPointer = otherHand.renderPointer; +} + void Hand::reset() { position.x = DEFAULT_X; diff --git a/interface/src/Hand.h b/interface/src/Hand.h index 3c32c3553d..bda0fb2145 100644 --- a/interface/src/Hand.h +++ b/interface/src/Hand.h @@ -19,6 +19,7 @@ class Hand { public: Hand(glm::vec3 color); + Hand(const Hand &otherHand); void simulate (float deltaTime); void render (int isMine); void reset (); diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index cc330c396c..eea423eb8f 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -72,11 +72,10 @@ Head::Head() averageLoudness = 0.0; lastLoudness = 0.0; browAudioLift = 0.0; + noise = 0; - setNoise(0); hand = new Hand(glm::vec3(skinColor[0], skinColor[1], skinColor[2])); - if (iris_texture.size() == 0) { unsigned error = lodepng::decode(iris_texture, iris_texture_width, iris_texture_height, iris_texture_file); if (error != 0) { @@ -85,6 +84,50 @@ Head::Head() } } +Head::Head(const Head &otherHead) { + position = otherHead.position; + PupilSize = otherHead.PupilSize; + interPupilDistance = otherHead.interPupilDistance; + interBrowDistance = otherHead.interBrowDistance; + NominalPupilSize = otherHead.NominalPupilSize; + Yaw = otherHead.Yaw; + EyebrowPitch[0] = otherHead.EyebrowPitch[0]; + EyebrowPitch[1] = otherHead.EyebrowPitch[1]; + EyebrowRoll[0] = otherHead.EyebrowRoll[0]; + EyebrowRoll[1] = otherHead.EyebrowRoll[1]; + MouthPitch = otherHead.MouthPitch; + MouthYaw = otherHead.MouthYaw; + MouthWidth = otherHead.MouthWidth; + MouthHeight = otherHead.MouthHeight; + EyeballPitch[0] = otherHead.EyeballPitch[0]; + EyeballPitch[1] = otherHead.EyeballPitch[1]; + EyeballScaleX = otherHead.EyeballScaleX; + EyeballScaleY = otherHead.EyeballScaleY; + EyeballScaleZ = otherHead.EyeballScaleZ; + EyeballYaw[0] = otherHead.EyeballYaw[0]; + EyeballYaw[1] = otherHead.EyeballYaw[1]; + PitchTarget = otherHead.PitchTarget; + YawTarget = otherHead.YawTarget; + NoiseEnvelope = otherHead.NoiseEnvelope; + PupilConverge = otherHead.PupilConverge; + leanForward = otherHead.leanForward; + leanSideways = otherHead.leanSideways; + eyeContact = otherHead.eyeContact; + eyeContactTarget = otherHead.eyeContactTarget; + scale = otherHead.scale; + renderYaw = otherHead.renderYaw; + renderPitch = otherHead.renderPitch; + audioAttack = otherHead.audioAttack; + loudness = otherHead.loudness; + averageLoudness = otherHead.averageLoudness; + lastLoudness = otherHead.lastLoudness; + browAudioLift = otherHead.browAudioLift; + noise = otherHead.noise; + + Hand newHand = Hand(*otherHead.hand); + hand = &newHand; +} + Head::~Head() { if (sphere) { gluDeleteQuadric(sphere); @@ -95,10 +138,6 @@ Head* Head::clone() const { return new Head(*this); } -Head* Head::clone() const { - return new Head(*this); -} - void Head::reset() { Pitch = Yaw = Roll = 0; diff --git a/interface/src/Head.h b/interface/src/Head.h index c7ffc9502d..fe22c9efdb 100644 --- a/interface/src/Head.h +++ b/interface/src/Head.h @@ -24,6 +24,7 @@ class Head : public AgentData { public: Head(); ~Head(); + Head(const Head &otherHead); Head* clone() const; void reset();