diff options
author | Don Kjer <don@lindenlab.com> | 2012-09-13 03:30:17 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2012-09-13 03:30:17 +0000 |
commit | 929b7e029513ecbb08c415e945c83ea09dc1b3eb (patch) | |
tree | 2d83d0f1ee29e1f96ea450897ec53ff29bb986f6 /indra/llappearance/llavatarappearance.cpp | |
parent | da1a303fc33b098f133cb72a8bac9d8e886d65df (diff) |
Instantiated bare-bones LLBakingAvatar concrete class (derived from LLAvatarAppearance). Moved some LLCharacter funcionality from LLVOAvatar to LLAvatarAppearance.
Diffstat (limited to 'indra/llappearance/llavatarappearance.cpp')
-rw-r--r-- | indra/llappearance/llavatarappearance.cpp | 79 |
1 files changed, 77 insertions, 2 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index ed8ff1e69e..19c656044c 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -166,7 +166,7 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : mTexEyeColor( NULL ), mPelvisToFoot(0.f), mHeadOffset(), - + mRoot(NULL), mWearableData(wearable_data) { LLMemType mt(LLMemType::MTYPE_AVATAR); @@ -287,7 +287,7 @@ LLAvatarAppearance::~LLAvatarAppearance() } } - mRoot->removeAllChildren(); + if (mRoot) mRoot->removeAllChildren(); mJointMap.clear(); clearSkeleton(); @@ -1178,6 +1178,81 @@ BOOL LLAvatarAppearance::loadLayersets() return success; } +//----------------------------------------------------------------------------- +// getCharacterJoint() +//----------------------------------------------------------------------------- +LLJoint *LLAvatarAppearance::getCharacterJoint( U32 num ) +{ + if ((S32)num >= mSkeleton.size() + || (S32)num < 0) + { + return NULL; + } + return mSkeleton[num]; +} + + +//----------------------------------------------------------------------------- +// getVolumePos() +//----------------------------------------------------------------------------- +LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_offset) +{ + if (joint_index > mNumCollisionVolumes) + { + return LLVector3::zero; + } + + return mCollisionVolumes[joint_index].getVolumePos(volume_offset); +} + +//----------------------------------------------------------------------------- +// findCollisionVolume() +//----------------------------------------------------------------------------- +LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id) +{ + if ((S32)volume_id > mNumCollisionVolumes) + { + return NULL; + } + + return &mCollisionVolumes[volume_id]; +} + +//----------------------------------------------------------------------------- +// findCollisionVolume() +//----------------------------------------------------------------------------- +S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name) +{ + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + if (mCollisionVolumes[i].getName() == name) + { + return i; + } + } + + return -1; +} + +//----------------------------------------------------------------------------- +// LLAvatarAppearance::getHeadMesh() +//----------------------------------------------------------------------------- +LLPolyMesh* LLAvatarAppearance::getHeadMesh() +{ + return mMeshLOD[MESH_ID_HEAD]->mMeshParts[0]->getMesh(); +} + + +//----------------------------------------------------------------------------- +// LLAvatarAppearance::getUpperBodyMesh() +//----------------------------------------------------------------------------- +LLPolyMesh* LLAvatarAppearance::getUpperBodyMesh() +{ + return mMeshLOD[MESH_ID_UPPER_BODY]->mMeshParts[0]->getMesh(); +} + + + // virtual BOOL LLAvatarAppearance::isValid() const { |