summaryrefslogtreecommitdiff
path: root/indra/llappearance/llavatarjoint.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-01 08:16:58 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-01 08:16:58 +0300
commit38c2a5bde985a6a8a96d912d432f8bdf7e5b60be (patch)
treeb3469444ea8dabe4e76a8a265ac086a9db78891c /indra/llappearance/llavatarjoint.cpp
parent9bf2dfbb39032d7407295089cf181de0987083e5 (diff)
parente7eced3c87310b15ac20cc3cd470d67686104a14 (diff)
Merge branch 'marchcat/w-whitespace' into marchcat/x-ws-merge
Diffstat (limited to 'indra/llappearance/llavatarjoint.cpp')
-rw-r--r--indra/llappearance/llavatarjoint.cpp324
1 files changed, 162 insertions, 162 deletions
diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp
index 9300b08b7b..5dae4c86cb 100644
--- a/indra/llappearance/llavatarjoint.cpp
+++ b/indra/llappearance/llavatarjoint.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llavatarjoint.cpp
* @brief Implementation of LLAvatarJoint class
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -40,16 +40,16 @@ const F32 DEFAULT_AVATAR_JOINT_LOD = 0.0f;
//-----------------------------------------------------------------------------
// Static Data
//-----------------------------------------------------------------------------
-BOOL LLAvatarJoint::sDisableLOD = FALSE;
+BOOL LLAvatarJoint::sDisableLOD = FALSE;
//-----------------------------------------------------------------------------
// LLAvatarJoint()
// Class Constructors
//-----------------------------------------------------------------------------
LLAvatarJoint::LLAvatarJoint() :
- LLJoint()
+ LLJoint()
{
- init();
+ init();
}
LLAvatarJoint::LLAvatarJoint(S32 joint_num) :
@@ -57,22 +57,22 @@ LLAvatarJoint::LLAvatarJoint(S32 joint_num) :
{
init();
}
-
+
LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) :
- LLJoint(name, parent)
+ LLJoint(name, parent)
{
- init();
+ init();
}
void LLAvatarJoint::init()
{
- mValid = FALSE;
- mComponents = SC_JOINT | SC_BONE | SC_AXES;
- mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
- mPickName = PN_DEFAULT;
- mVisible = TRUE;
- mMeshID = 0;
- mIsTransparent = FALSE;
+ mValid = FALSE;
+ mComponents = SC_JOINT | SC_BONE | SC_AXES;
+ mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD;
+ mPickName = PN_DEFAULT;
+ mVisible = TRUE;
+ mMeshID = 0;
+ mIsTransparent = FALSE;
}
@@ -90,22 +90,22 @@ LLAvatarJoint::~LLAvatarJoint()
//--------------------------------------------------------------------
void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
{
- //----------------------------------------------------------------
- // set visibility for this joint
- //----------------------------------------------------------------
- mValid = valid;
-
- //----------------------------------------------------------------
- // set visibility for children
- //----------------------------------------------------------------
- if (recursive)
- {
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->setValid(valid, TRUE);
- }
- }
+ //----------------------------------------------------------------
+ // set visibility for this joint
+ //----------------------------------------------------------------
+ mValid = valid;
+
+ //----------------------------------------------------------------
+ // set visibility for children
+ //----------------------------------------------------------------
+ if (recursive)
+ {
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->setValid(valid, TRUE);
+ }
+ }
}
@@ -114,107 +114,107 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
//--------------------------------------------------------------------
void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
{
- mComponents = comp;
- if (recursive)
- {
- for (auto child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->setSkeletonComponents(comp, recursive);
- }
- }
+ mComponents = comp;
+ if (recursive)
+ {
+ for (auto child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->setSkeletonComponents(comp, recursive);
+ }
+ }
}
void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
{
- mVisible = visible;
-
- if (recursive)
- {
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->setVisible(visible, recursive);
- }
- }
+ mVisible = visible;
+
+ if (recursive)
+ {
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->setVisible(visible, recursive);
+ }
+ }
}
void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area)
{
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
- }
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
+ }
}
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
{
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
- }
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
+ }
}
void LLAvatarJoint::updateJointGeometry()
{
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->updateJointGeometry();
- }
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->updateJointGeometry();
+ }
}
BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
{
- BOOL lod_changed = FALSE;
- BOOL found_lod = FALSE;
-
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- F32 jointLOD = joint->getLOD();
-
- if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
- {
- // we've already found a joint to enable, so enable the rest as alternatives
- lod_changed |= joint->updateLOD(pixel_area, TRUE);
- }
- else
- {
- if (pixel_area >= jointLOD || sDisableLOD)
- {
- lod_changed |= joint->updateLOD(pixel_area, TRUE);
- found_lod = TRUE;
- }
- else
- {
- lod_changed |= joint->updateLOD(pixel_area, FALSE);
- }
- }
- }
- return lod_changed;
+ BOOL lod_changed = FALSE;
+ BOOL found_lod = FALSE;
+
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ F32 jointLOD = joint->getLOD();
+
+ if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
+ {
+ // we've already found a joint to enable, so enable the rest as alternatives
+ lod_changed |= joint->updateLOD(pixel_area, TRUE);
+ }
+ else
+ {
+ if (pixel_area >= jointLOD || sDisableLOD)
+ {
+ lod_changed |= joint->updateLOD(pixel_area, TRUE);
+ found_lod = TRUE;
+ }
+ else
+ {
+ lod_changed |= joint->updateLOD(pixel_area, FALSE);
+ }
+ }
+ }
+ return lod_changed;
}
void LLAvatarJoint::dump()
{
- for (LLJoint* child : mChildren)
- {
- LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
- joint->dump();
- }
+ for (LLJoint* child : mChildren)
+ {
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child);
+ joint->dump();
+ }
}
void LLAvatarJoint::setMeshesToChildren()
{
- removeAllChildren();
- for (LLAvatarJointMesh* mesh : mMeshParts)
- {
- addChild(mesh);
- }
+ removeAllChildren();
+ for (LLAvatarJointMesh* mesh : mMeshParts)
+ {
+ addChild(mesh);
+ }
}
//-----------------------------------------------------------------------------
// LLAvatarJointCollisionVolume()
@@ -222,94 +222,94 @@ void LLAvatarJoint::setMeshesToChildren()
LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
{
- mUpdateXform = FALSE;
+ mUpdateXform = FALSE;
}
/*virtual*/
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
{
- LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
- return 0;
+ LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
+ return 0;
}
LLVector3 LLAvatarJointCollisionVolume::getVolumePos(LLVector3 &offset)
{
- mUpdateXform = TRUE;
-
- LLVector3 result = offset;
- result.scaleVec(getScale());
- result.rotVec(getWorldRotation());
- result += getWorldPosition();
-
- return result;
+ mUpdateXform = TRUE;
+
+ LLVector3 result = offset;
+ result.scaleVec(getScale());
+ result.rotVec(getWorldRotation());
+ result += getWorldPosition();
+
+ return result;
}
void LLAvatarJointCollisionVolume::renderCollision()
{
- updateWorldMatrix();
-
- gGL.pushMatrix();
- gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
+ updateWorldMatrix();
+
+ gGL.pushMatrix();
+ gGL.multMatrix( &mXform.getWorldMatrix().mMatrix[0][0] );
+
+ gGL.diffuseColor3f( 0.f, 0.f, 1.f );
+
+ gGL.begin(LLRender::LINES);
- gGL.diffuseColor3f( 0.f, 0.f, 1.f );
-
- gGL.begin(LLRender::LINES);
-
- LLVector3 v[] =
- {
- LLVector3(1,0,0),
- LLVector3(-1,0,0),
- LLVector3(0,1,0),
- LLVector3(0,-1,0),
+ LLVector3 v[] =
+ {
+ LLVector3(1,0,0),
+ LLVector3(-1,0,0),
+ LLVector3(0,1,0),
+ LLVector3(0,-1,0),
- LLVector3(0,0,-1),
- LLVector3(0,0,1),
- };
+ LLVector3(0,0,-1),
+ LLVector3(0,0,1),
+ };
- //sides
- gGL.vertex3fv(v[0].mV);
- gGL.vertex3fv(v[2].mV);
+ //sides
+ gGL.vertex3fv(v[0].mV);
+ gGL.vertex3fv(v[2].mV);
- gGL.vertex3fv(v[0].mV);
- gGL.vertex3fv(v[3].mV);
+ gGL.vertex3fv(v[0].mV);
+ gGL.vertex3fv(v[3].mV);
- gGL.vertex3fv(v[1].mV);
- gGL.vertex3fv(v[2].mV);
+ gGL.vertex3fv(v[1].mV);
+ gGL.vertex3fv(v[2].mV);
- gGL.vertex3fv(v[1].mV);
- gGL.vertex3fv(v[3].mV);
+ gGL.vertex3fv(v[1].mV);
+ gGL.vertex3fv(v[3].mV);
- //top
- gGL.vertex3fv(v[0].mV);
- gGL.vertex3fv(v[4].mV);
+ //top
+ gGL.vertex3fv(v[0].mV);
+ gGL.vertex3fv(v[4].mV);
- gGL.vertex3fv(v[1].mV);
- gGL.vertex3fv(v[4].mV);
+ gGL.vertex3fv(v[1].mV);
+ gGL.vertex3fv(v[4].mV);
- gGL.vertex3fv(v[2].mV);
- gGL.vertex3fv(v[4].mV);
+ gGL.vertex3fv(v[2].mV);
+ gGL.vertex3fv(v[4].mV);
- gGL.vertex3fv(v[3].mV);
- gGL.vertex3fv(v[4].mV);
+ gGL.vertex3fv(v[3].mV);
+ gGL.vertex3fv(v[4].mV);
- //bottom
- gGL.vertex3fv(v[0].mV);
- gGL.vertex3fv(v[5].mV);
+ //bottom
+ gGL.vertex3fv(v[0].mV);
+ gGL.vertex3fv(v[5].mV);
- gGL.vertex3fv(v[1].mV);
- gGL.vertex3fv(v[5].mV);
+ gGL.vertex3fv(v[1].mV);
+ gGL.vertex3fv(v[5].mV);
- gGL.vertex3fv(v[2].mV);
- gGL.vertex3fv(v[5].mV);
+ gGL.vertex3fv(v[2].mV);
+ gGL.vertex3fv(v[5].mV);
- gGL.vertex3fv(v[3].mV);
- gGL.vertex3fv(v[5].mV);
+ gGL.vertex3fv(v[3].mV);
+ gGL.vertex3fv(v[5].mV);
- gGL.end();
+ gGL.end();
- gGL.popMatrix();
+ gGL.popMatrix();
}