add missing copy constructors for Head and Hand

This commit is contained in:
Stephen Birarda 2013-03-12 10:42:41 -07:00
parent f29510ceb0
commit 0739d39568
4 changed files with 66 additions and 6 deletions

View file

@ -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;

View file

@ -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 ();

View file

@ -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;

View file

@ -24,6 +24,7 @@ class Head : public AgentData {
public:
Head();
~Head();
Head(const Head &otherHead);
Head* clone() const;
void reset();