diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f0fb5826a5900614f5422f0f22cf0db9be4434ee..1f19cec64a8f1f7149e3266979f4bc9fb5ac5de0 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -41,9 +41,6 @@ #include "xform.h" #include "llmatrix4a.h" -class LLViewerJoint; -class LLViewerJointAttachment; - const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; // Need to set this to count of animate-able joints, // currently = #bones + #collision_volumes + #attachments + 2, @@ -193,9 +190,6 @@ class LLJoint LLJoint( const std::string &name, LLJoint *parent=NULL ); virtual ~LLJoint(); - virtual LLViewerJointAttachment* asViewerJointAttachment() { return nullptr; } - virtual LLViewerJoint* asViewerJoint() { return nullptr; } - private: void init(); diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index a74549596f6e35d27162b14504854c122deb6d2c..b020d46f9a18e78a0925f18c56dad2cb24a793b2 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -35,7 +35,6 @@ class LLFace; class LLViewerJointMesh; -class LLViewerJoint; //----------------------------------------------------------------------------- // class LLViewerJoint @@ -51,8 +50,6 @@ class LLViewerJoint : LLViewerJoint(const std::string &name, LLJoint *parent = NULL); virtual ~LLViewerJoint(); - LLViewerJoint* asViewerJoint() override { return static_cast<LLViewerJoint*>(this); } - // Render character hierarchy. // Traverses the entire joint hierarchy, setting up // transforms and calling the drawShape(). diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 2e84b0f6abc45ed53a356c96a65602ea3cbf5231..c20ba9c3931f4107d04af10b361e8dac6c37b3b9 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -36,22 +36,19 @@ class LLDrawable; class LLViewerObject; -class LLViewerJointAttachment; extern const F32 MAX_ATTACHMENT_DIST; //----------------------------------------------------------------------------- // class LLViewerJointAttachment //----------------------------------------------------------------------------- -class LLViewerJointAttachment final : +class LLViewerJointAttachment : public LLViewerJoint { public: LLViewerJointAttachment(); virtual ~LLViewerJointAttachment(); - LLViewerJointAttachment* asViewerJointAttachment() final { return static_cast<LLViewerJointAttachment*>(this); } - //virtual U32 render( F32 pixelArea ); // Returns triangle count // Returns true if this object is transparent. diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 45ca5e84f0511c0f613a8513b354ff0f367b1d85..05ca4204c4877196496389d2e094baf571a4d83d 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -50,8 +50,6 @@ class LLViewerJointMesh final : public LLAvatarJointMesh, public LLViewerJoint // Destructor virtual ~LLViewerJointMesh(); - LLViewerJoint* asViewerJoint() override { return static_cast<LLViewerJoint*>(this); } - // Render time method to upload batches of joint matrices void uploadJointMatrices(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9eae0ffd8234c2636ad7a70b86d203adbd936ad4..c9cd39d690f17e8f1152f21599469503b94b6f91 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1520,7 +1520,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) if (joint && rig_info && rig_info->isRiggedTo()) { - LLViewerJointAttachment *as_joint_attach = joint->asViewerJointAttachment(); + LLViewerJointAttachment *as_joint_attach = dynamic_cast<LLViewerJointAttachment*>(joint); if (as_joint_attach && as_joint_attach->getIsHUDAttachment()) { // Ignore bounding box of HUD joints @@ -7419,7 +7419,7 @@ BOOL LLVOAvatar::updateJointLODs() } // now select meshes to render based on adjusted pixel area - LLViewerJoint* root = mRoot && mRoot->asViewerJoint() ? mRoot->asViewerJoint() : nullptr; + LLViewerJoint* root = dynamic_cast<LLViewerJoint*>(mRoot); BOOL res = FALSE; if (root) { @@ -7519,7 +7519,7 @@ void LLVOAvatar::dirtyMesh(S32 priority) //----------------------------------------------------------------------------- LLViewerJoint* LLVOAvatar::getViewerJoint(S32 idx) { - return (mMeshLOD[idx] && mMeshLOD[idx]->asViewerJoint()) ? mMeshLOD[idx]->asViewerJoint() : nullptr; + return dynamic_cast<LLViewerJoint*>(mMeshLOD[idx]); } //-----------------------------------------------------------------------------