summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2012-06-07 11:00:58 -0400
committerprep <prep@lindenlab.com>2012-06-07 11:00:58 -0400
commit18509683267385212c6f8652a8da0ab5bf88eb8a (patch)
treebeb5fa197a944769b8301e2cb840b4cdd04d6dfa /indra/newview
parent208d73f52497c7e4c15f21843428ffa6a3db7aaa (diff)
Physics capsules now inherit the rotations of their parent vo when rendered. API update.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.cpp15
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.h4
-rw-r--r--indra/newview/pipeline.cpp15
3 files changed, 19 insertions, 15 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index 098881544f..b4a1394b06 100644
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -74,12 +74,12 @@ void LLFloaterPathfindingCharacters::setShowPhysicsCapsule(BOOL pIsShowPhysicsCa
#endif // SERVER_SIDE_CHARACTER_SHAPE_ROLLOUT_COMPLETE
}
-BOOL LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos) const
+BOOL LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const
{
id = mSelectedCharacterId;
- // Physics capsule is enable if the checkbox is enabled and if we can get a position
- // for any selected object
- return (isShowPhysicsCapsule() && getCapsulePosition(pos));
+ // Physics capsule is enable if the checkbox is enabled and if we can get the required render
+ // parameters for any selected object
+ return (isShowPhysicsCapsule() && getCapsuleRenderData(pos, rot ));
}
void LLFloaterPathfindingCharacters::openCharactersViewer()
@@ -286,7 +286,7 @@ void LLFloaterPathfindingCharacters::hideCapsule() const
}
}
-bool LLFloaterPathfindingCharacters::getCapsulePosition(LLVector3 &pPosition) const
+bool LLFloaterPathfindingCharacters::getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const
{
bool result = false;
@@ -298,8 +298,9 @@ bool LLFloaterPathfindingCharacters::getCapsulePosition(LLVector3 &pPosition) co
LLViewerObject *viewerObject = gObjectList.findObject(mSelectedCharacterId);
if ( viewerObject != NULL )
{
- pPosition = viewerObject->getRenderPosition();
- result = true;
+ rot = viewerObject->getRotation() ;
+ pPosition = viewerObject->getRenderPosition();
+ result = true;
}
}
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h
index fe24b6c562..a86a9700b1 100644
--- a/indra/newview/llfloaterpathfindingcharacters.h
+++ b/indra/newview/llfloaterpathfindingcharacters.h
@@ -44,7 +44,7 @@ public:
BOOL isShowPhysicsCapsule() const;
void setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule);
- BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos) const;
+ BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot ) const;
static void openCharactersViewer();
static LLHandle<LLFloaterPathfindingCharacters> getInstanceHandle();
@@ -79,7 +79,7 @@ private:
void showCapsule() const;
void hideCapsule() const;
- bool getCapsulePosition(LLVector3 &pPosition) const;
+ bool getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const;
LLCheckBoxCtrl *mShowPhysicsCapsuleCheckBox;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 3531599764..708bb20bc2 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4377,24 +4377,27 @@ void LLPipeline::renderDebug()
gPathfindingProgram.uniform1f("alpha_scale", 1.f);
}
- LLUUID id;
+ //Requried character physics capsule render parameters
+ LLUUID id;
LLVector3 pos;
- if ( pathfindingCharacter->isPhysicsCapsuleEnabled( id, pos ) )
- {
+ LLQuaternion rot;
+
+ if ( pathfindingCharacter->isPhysicsCapsuleEnabled( id, pos, rot ) )
+ {
if (LLGLSLShader::sNoFixedFunction)
{
//remove blending artifacts
gGL.setColorMask(false, false);
- llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos );
+ llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
gGL.setColorMask(true, false);
LLGLEnable blend(GL_BLEND);
gPathfindingProgram.uniform1f("alpha_scale", 0.90f);
- llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos );
+ llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
gPathfindingProgram.bind();
}
else
{
- llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos );
+ llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot );
}
}
}