disallow copying of Avatar objects

This commit is contained in:
Stephen Birarda 2013-05-17 12:15:19 -07:00
parent 199853711f
commit 1ba1b56b2c
2 changed files with 4 additions and 65 deletions

View file

@ -58,7 +58,6 @@ bool usingBigSphereCollisionTest = true;
float chatMessageScale = 0.0015;
float chatMessageHeight = 0.45;
Avatar::Avatar(bool isMine) {
_orientation.setToIdentity();
@ -107,49 +106,6 @@ Avatar::Avatar(bool isMine) {
else { _balls = NULL; }
}
Avatar::Avatar(const Avatar &otherAvatar) : _head(otherAvatar._head) { //include the copy constructor for head
_velocity = otherAvatar._velocity;
_thrust = otherAvatar._thrust;
_rotation = otherAvatar._rotation;
_bodyYaw = otherAvatar._bodyYaw;
_bodyPitch = otherAvatar._bodyPitch;
_bodyRoll = otherAvatar._bodyRoll;
_bodyPitchDelta = otherAvatar._bodyPitchDelta;
_bodyYawDelta = otherAvatar._bodyYawDelta;
_bodyRollDelta = otherAvatar._bodyRollDelta;
_mousePressed = otherAvatar._mousePressed;
_mode = otherAvatar._mode;
_isMine = otherAvatar._isMine;
_renderYaw = otherAvatar._renderYaw;
_maxArmLength = otherAvatar._maxArmLength;
_transmitterTimer = otherAvatar._transmitterTimer;
_transmitterIsFirstData = otherAvatar._transmitterIsFirstData;
_transmitterTimeLastReceived = otherAvatar._transmitterTimeLastReceived;
_transmitterHz = otherAvatar._transmitterHz;
_transmitterInitialReading = otherAvatar._transmitterInitialReading;
_transmitterPackets = otherAvatar._transmitterPackets;
_isTransmitterV2Connected = otherAvatar._isTransmitterV2Connected;
_TEST_bigSphereRadius = otherAvatar._TEST_bigSphereRadius;
_TEST_bigSpherePosition = otherAvatar._TEST_bigSpherePosition;
_movedHandOffset = otherAvatar._movedHandOffset;
_orientation.set(otherAvatar._orientation);
initializeSkeleton();
for (int i = 0; i < MAX_DRIVE_KEYS; i++) _driveKeys[i] = otherAvatar._driveKeys[i];
_distanceToNearestAvatar = otherAvatar._distanceToNearestAvatar;
initializeSkeleton();
}
Avatar* Avatar::clone() const {
return new Avatar(*this);
}
void Avatar::reset() {
_headPitch = _headYaw = _headRoll = 0;
_head.leanForward = _head.leanSideways = 0;
@ -460,8 +416,6 @@ void Avatar::simulate(float deltaTime) {
}
}
void Avatar::checkForMouseRayTouching() {
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
@ -477,13 +431,10 @@ void Avatar::checkForMouseRayTouching() {
}
}
void Avatar::setMouseRay(const glm::vec3 &origin, const glm::vec3 &direction ) {
_mouseRayOrigin = origin; _mouseRayDirection = direction;
}
void Avatar::updateHandMovementAndTouching(float deltaTime) {
// reset hand and arm positions according to hand movement
@ -600,12 +551,10 @@ void Avatar::updateHandMovementAndTouching(float deltaTime) {
}
}
float Avatar::getHeight() {
return _height;
}
void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float deltaTime) {
float myBodyApproximateBoundingRadius = 1.0f;
glm::vec3 vectorFromMyBodyToBigSphere(_position - position);
@ -644,9 +593,6 @@ void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float d
}
}
void Avatar::updateAvatarCollisions(float deltaTime) {
// Reset detector for nearest avatar
@ -677,9 +623,6 @@ void Avatar::updateAvatarCollisions(float deltaTime) {
}
}
//detect collisions with other avatars and respond
void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime) {
@ -735,8 +678,6 @@ void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime
otherAvatar->_velocity *= bodyMomentum;
}
void Avatar::setDisplayingHead(bool displayingHead) {
_displayingHead = displayingHead;
}
@ -1136,9 +1077,6 @@ glm::vec3 Avatar::getApproximateEyePosition() {
return _head.getApproximateEyePosition();
}
void Avatar::updateArmIKAndConstraints(float deltaTime) {
// determine the arm vector

View file

@ -76,9 +76,7 @@ enum AvatarJointID
class Avatar : public AvatarData {
public:
Avatar(bool isMine);
Avatar(const Avatar &otherAvatar);
Avatar* clone() const;
void reset();
void updateHeadFromGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity);
void updateFromMouse(int mouseX, int mouseY, int screenWidth, int screenHeight);
@ -139,6 +137,9 @@ public:
void readAvatarDataFromFile();
private:
// privatize copy constructor and assignment operator to avoid copying
Avatar(const Avatar&);
Avatar& operator= (const Avatar&);
struct AvatarJoint
{