summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Buzzard <no-email>2011-03-08 15:53:39 -0800
committerTofu Buzzard <no-email>2011-03-08 15:53:39 -0800
commitceb8561e49ace81d39209849a6f8a805d2d9d8ed (patch)
tree5260f3a7e6dc889ebbc26569df8fdf23db6f5c95 /indra
parentfffcb116fefd6501f629f13457be90a4d88e746b (diff)
parent94b0ce6d842a1f34bd46535a8b4db68aa397a541 (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llface.cpp22
-rw-r--r--indra/newview/llface.h4
-rw-r--r--indra/newview/llhudnametag.cpp25
-rwxr-xr-xindra/newview/pipeline.cpp10
4 files changed, 54 insertions, 7 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 10847e7067..290115417f 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -384,6 +384,24 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align)
llassert(verify());
}
+void LLFace::setGeomIndex(U16 idx)
+{
+ if (mGeomIndex != idx)
+ {
+ mGeomIndex = idx;
+ mVertexBuffer = NULL;
+ }
+}
+
+void LLFace::setIndicesIndex(S32 idx)
+{
+ if (mIndicesIndex != idx)
+ {
+ mIndicesIndex = idx;
+ mVertexBuffer = NULL;
+ }
+}
+
//============================================================================
U16 LLFace::getGeometryAvatar(
@@ -1858,7 +1876,7 @@ BOOL LLFace::verify(const U32* indices_array) const
}
// First, check whether the face data fits within the pool's range.
- if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
+ if ((mGeomIndex + mGeomCount) > mVertexBuffer->getRequestedVerts())
{
ok = FALSE;
llinfos << "Face references invalid vertices!" << llendl;
@@ -1877,7 +1895,7 @@ BOOL LLFace::verify(const U32* indices_array) const
llinfos << "Face has bogus indices count" << llendl;
}
- if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices())
+ if (mIndicesIndex + mIndicesCount > mVertexBuffer->getRequestedIndices())
{
ok = FALSE;
llinfos << "Face references invalid indices!" << llendl;
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 1f69dd145e..b2170c4cf3 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -196,8 +196,8 @@ public:
BOOL verify(const U32* indices_array = NULL) const;
void printDebugInfo() const;
- void setGeomIndex(U16 idx) { mGeomIndex = idx; }
- void setIndicesIndex(S32 idx) { mIndicesIndex = idx; }
+ void setGeomIndex(U16 idx);
+ void setIndicesIndex(S32 idx);
void setDrawInfo(LLDrawInfo* draw_info);
F32 getTextureVirtualSize() ;
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 8caf4d3d4c..82e1f2dfb5 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -146,24 +146,43 @@ BOOL LLHUDNameTag::lineSegmentIntersect(const LLVector3& start, const LLVector3&
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
+ LLVector3 position = mPositionAgent;
+
+ if (mSourceObject)
+ { //get intersection of eye through mPositionAgent to plane of source object
+ //using this position keeps the camera from focusing on some seemingly random
+ //point several meters in front of the nametag
+ const LLVector3& p = mSourceObject->getPositionAgent();
+ const LLVector3& n = LLViewerCamera::getInstance()->getAtAxis();
+ const LLVector3& eye = LLViewerCamera::getInstance()->getOrigin();
+
+ LLVector3 ray = position-eye;
+ ray.normalize();
+
+ LLVector3 delta = p-position;
+ F32 dist = delta*n;
+ F32 dt = dist/(ray*n);
+ position += ray*dt;
+ }
+
// scale screen size of borders down
//RN: for now, text on hud objects is never occluded
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
- LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
+ LLViewerCamera::getInstance()->getPixelVectors(position, y_pixel_vec, x_pixel_vec);
LLVector3 width_vec = mWidth * x_pixel_vec;
LLVector3 height_vec = mHeight * y_pixel_vec;
LLCoordGL screen_pos;
- LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE);
+ LLViewerCamera::getInstance()->projectPosAgentToScreen(position, screen_pos, FALSE);
LLVector2 screen_offset;
screen_offset = updateScreenPos(mPositionOffset);
- LLVector3 render_position = mPositionAgent
+ LLVector3 render_position = position
+ (x_pixel_vec * screen_offset.mV[VX])
+ (y_pixel_vec * screen_offset.mV[VY]);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 6af371072b..c8ef75030d 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6202,6 +6202,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
{
focus_point = gDebugRaycastIntersection;
}
+ else if (gAgentCamera.cameraMouselook())
+ {
+ gViewerWindow->cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE,
+ NULL,
+ &focus_point);
+ }
else
{
LLViewerObject* obj = gAgentCamera.getFocusObject();
@@ -6209,6 +6215,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
{
focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal());
}
+ else
+ {
+ focus_point = gDebugRaycastIntersection;
+ }
}
}