mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:28:46 +02:00
disallow copying of Avatar objects
This commit is contained in:
parent
199853711f
commit
1ba1b56b2c
2 changed files with 4 additions and 65 deletions
|
@ -58,7 +58,6 @@ bool usingBigSphereCollisionTest = true;
|
||||||
float chatMessageScale = 0.0015;
|
float chatMessageScale = 0.0015;
|
||||||
float chatMessageHeight = 0.45;
|
float chatMessageHeight = 0.45;
|
||||||
|
|
||||||
|
|
||||||
Avatar::Avatar(bool isMine) {
|
Avatar::Avatar(bool isMine) {
|
||||||
_orientation.setToIdentity();
|
_orientation.setToIdentity();
|
||||||
|
|
||||||
|
@ -107,49 +106,6 @@ Avatar::Avatar(bool isMine) {
|
||||||
else { _balls = NULL; }
|
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() {
|
void Avatar::reset() {
|
||||||
_headPitch = _headYaw = _headRoll = 0;
|
_headPitch = _headYaw = _headRoll = 0;
|
||||||
_head.leanForward = _head.leanSideways = 0;
|
_head.leanForward = _head.leanSideways = 0;
|
||||||
|
@ -460,8 +416,6 @@ void Avatar::simulate(float deltaTime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Avatar::checkForMouseRayTouching() {
|
void Avatar::checkForMouseRayTouching() {
|
||||||
|
|
||||||
for (int b = 0; b < NUM_AVATAR_JOINTS; b++) {
|
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 ) {
|
void Avatar::setMouseRay(const glm::vec3 &origin, const glm::vec3 &direction ) {
|
||||||
_mouseRayOrigin = origin; _mouseRayDirection = direction;
|
_mouseRayOrigin = origin; _mouseRayDirection = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Avatar::updateHandMovementAndTouching(float deltaTime) {
|
void Avatar::updateHandMovementAndTouching(float deltaTime) {
|
||||||
|
|
||||||
// reset hand and arm positions according to hand movement
|
// reset hand and arm positions according to hand movement
|
||||||
|
@ -600,12 +551,10 @@ void Avatar::updateHandMovementAndTouching(float deltaTime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float Avatar::getHeight() {
|
float Avatar::getHeight() {
|
||||||
return _height;
|
return _height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float deltaTime) {
|
void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float deltaTime) {
|
||||||
float myBodyApproximateBoundingRadius = 1.0f;
|
float myBodyApproximateBoundingRadius = 1.0f;
|
||||||
glm::vec3 vectorFromMyBodyToBigSphere(_position - position);
|
glm::vec3 vectorFromMyBodyToBigSphere(_position - position);
|
||||||
|
@ -644,9 +593,6 @@ void Avatar::updateCollisionWithSphere(glm::vec3 position, float radius, float d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Avatar::updateAvatarCollisions(float deltaTime) {
|
void Avatar::updateAvatarCollisions(float deltaTime) {
|
||||||
|
|
||||||
// Reset detector for nearest avatar
|
// Reset detector for nearest avatar
|
||||||
|
@ -677,9 +623,6 @@ void Avatar::updateAvatarCollisions(float deltaTime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//detect collisions with other avatars and respond
|
//detect collisions with other avatars and respond
|
||||||
void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime) {
|
void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime) {
|
||||||
|
|
||||||
|
@ -735,8 +678,6 @@ void Avatar::applyCollisionWithOtherAvatar(Avatar * otherAvatar, float deltaTime
|
||||||
otherAvatar->_velocity *= bodyMomentum;
|
otherAvatar->_velocity *= bodyMomentum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Avatar::setDisplayingHead(bool displayingHead) {
|
void Avatar::setDisplayingHead(bool displayingHead) {
|
||||||
_displayingHead = displayingHead;
|
_displayingHead = displayingHead;
|
||||||
}
|
}
|
||||||
|
@ -1136,9 +1077,6 @@ glm::vec3 Avatar::getApproximateEyePosition() {
|
||||||
return _head.getApproximateEyePosition();
|
return _head.getApproximateEyePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Avatar::updateArmIKAndConstraints(float deltaTime) {
|
void Avatar::updateArmIKAndConstraints(float deltaTime) {
|
||||||
|
|
||||||
// determine the arm vector
|
// determine the arm vector
|
||||||
|
|
|
@ -76,9 +76,7 @@ enum AvatarJointID
|
||||||
class Avatar : public AvatarData {
|
class Avatar : public AvatarData {
|
||||||
public:
|
public:
|
||||||
Avatar(bool isMine);
|
Avatar(bool isMine);
|
||||||
Avatar(const Avatar &otherAvatar);
|
|
||||||
Avatar* clone() const;
|
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void updateHeadFromGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity);
|
void updateHeadFromGyros(float frametime, SerialInterface * serialInterface, glm::vec3 * gravity);
|
||||||
void updateFromMouse(int mouseX, int mouseY, int screenWidth, int screenHeight);
|
void updateFromMouse(int mouseX, int mouseY, int screenWidth, int screenHeight);
|
||||||
|
@ -139,6 +137,9 @@ public:
|
||||||
void readAvatarDataFromFile();
|
void readAvatarDataFromFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// privatize copy constructor and assignment operator to avoid copying
|
||||||
|
Avatar(const Avatar&);
|
||||||
|
Avatar& operator= (const Avatar&);
|
||||||
|
|
||||||
struct AvatarJoint
|
struct AvatarJoint
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue