mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:42:58 +02:00
repair indentation and NULL comparisons in Avatar class
This commit is contained in:
parent
b40af0f02b
commit
bd553ef061
1 changed files with 30 additions and 32 deletions
|
@ -62,37 +62,35 @@ float chatMessageScale = 0.0015;
|
||||||
float chatMessageHeight = 0.20;
|
float chatMessageHeight = 0.20;
|
||||||
|
|
||||||
Avatar::Avatar(Agent* owningAgent) :
|
Avatar::Avatar(Agent* owningAgent) :
|
||||||
AvatarData(owningAgent),
|
AvatarData(owningAgent),
|
||||||
_initialized(false),
|
_initialized(false),
|
||||||
_head(this),
|
_head(this),
|
||||||
_ballSpringsInitialized(false),
|
_ballSpringsInitialized(false),
|
||||||
_TEST_bigSphereRadius(0.5f),
|
_TEST_bigSphereRadius(0.5f),
|
||||||
_TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f),
|
_TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f),
|
||||||
_mousePressed(false),
|
_mousePressed(false),
|
||||||
_bodyPitchDelta(0.0f),
|
_bodyPitchDelta(0.0f),
|
||||||
_bodyYawDelta(0.0f),
|
_bodyYawDelta(0.0f),
|
||||||
_bodyRollDelta(0.0f),
|
_bodyRollDelta(0.0f),
|
||||||
_movedHandOffset(0.0f, 0.0f, 0.0f),
|
_movedHandOffset(0.0f, 0.0f, 0.0f),
|
||||||
_mode(AVATAR_MODE_STANDING),
|
_mode(AVATAR_MODE_STANDING),
|
||||||
_cameraPosition(0.0f, 0.0f, 0.0f),
|
_cameraPosition(0.0f, 0.0f, 0.0f),
|
||||||
_handHoldingPosition(0.0f, 0.0f, 0.0f),
|
_handHoldingPosition(0.0f, 0.0f, 0.0f),
|
||||||
_velocity(0.0f, 0.0f, 0.0f),
|
_velocity(0.0f, 0.0f, 0.0f),
|
||||||
_thrust(0.0f, 0.0f, 0.0f),
|
_thrust(0.0f, 0.0f, 0.0f),
|
||||||
_speed(0.0f),
|
_speed(0.0f),
|
||||||
_maxArmLength(0.0f),
|
_maxArmLength(0.0f),
|
||||||
_pelvisStandingHeight(0.0f),
|
_pelvisStandingHeight(0.0f),
|
||||||
_pelvisFloatingHeight(0.0f),
|
_pelvisFloatingHeight(0.0f),
|
||||||
_distanceToNearestAvatar(std::numeric_limits<float>::max()),
|
_distanceToNearestAvatar(std::numeric_limits<float>::max()),
|
||||||
_gravity(0.0f, -1.0f, 0.0f),
|
_gravity(0.0f, -1.0f, 0.0f),
|
||||||
_worldUpDirection(DEFAULT_UP_DIRECTION),
|
_worldUpDirection(DEFAULT_UP_DIRECTION),
|
||||||
_mouseRayOrigin(0.0f, 0.0f, 0.0f),
|
_mouseRayOrigin(0.0f, 0.0f, 0.0f),
|
||||||
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
||||||
_interactingOther(NULL),
|
_interactingOther(NULL),
|
||||||
_isMouseTurningRight(false),
|
_isMouseTurningRight(false),
|
||||||
_voxels(this)
|
_voxels(this)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
// give the pointer to our head to inherited _headData variable from AvatarData
|
// give the pointer to our head to inherited _headData variable from AvatarData
|
||||||
_headData = &_head;
|
_headData = &_head;
|
||||||
|
|
||||||
|
@ -659,7 +657,7 @@ void Avatar::updateHandMovementAndTouching(float deltaTime) {
|
||||||
//loop through all the other avatars for potential interactions...
|
//loop through all the other avatars for potential interactions...
|
||||||
AgentList* agentList = AgentList::getInstance();
|
AgentList* agentList = AgentList::getInstance();
|
||||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
if (agent->getLinkedData() && agent->getType() == AGENT_TYPE_AVATAR) {
|
||||||
Avatar *otherAvatar = (Avatar *)agent->getLinkedData();
|
Avatar *otherAvatar = (Avatar *)agent->getLinkedData();
|
||||||
|
|
||||||
// test whether shoulders are close enough to allow for reaching to touch hands
|
// test whether shoulders are close enough to allow for reaching to touch hands
|
||||||
|
@ -828,7 +826,7 @@ void Avatar::updateAvatarCollisions(float deltaTime) {
|
||||||
// loop through all the other avatars for potential interactions...
|
// loop through all the other avatars for potential interactions...
|
||||||
AgentList* agentList = AgentList::getInstance();
|
AgentList* agentList = AgentList::getInstance();
|
||||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
if (agent->getLinkedData() && agent->getType() == AGENT_TYPE_AVATAR) {
|
||||||
Avatar *otherAvatar = (Avatar *)agent->getLinkedData();
|
Avatar *otherAvatar = (Avatar *)agent->getLinkedData();
|
||||||
|
|
||||||
// check if the bounding spheres of the two avatars are colliding
|
// check if the bounding spheres of the two avatars are colliding
|
||||||
|
|
Loading…
Reference in a new issue