summaryrefslogtreecommitdiff
path: root/indra/newview/llvosurfacepatch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvosurfacepatch.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llvosurfacepatch.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index cb905d02da..9a5c5831ca 100644..100755
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -97,10 +97,10 @@ public:
glTexCoordPointer(2,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], (void*)(base + mOffsets[TYPE_TEXCOORD1]));
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
- if (data_mask & MAP_BINORMAL)
+ if (data_mask & MAP_TANGENT)
{
glClientActiveTextureARB(GL_TEXTURE2_ARB);
- glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_BINORMAL], (void*)(base + mOffsets[TYPE_BINORMAL]));
+ glTexCoordPointer(3,GL_FLOAT, LLVertexBuffer::sTypeSize[TYPE_TANGENT], (void*)(base + mOffsets[TYPE_TANGENT]));
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
if (data_mask & MAP_TEXCOORD0)
@@ -467,7 +467,7 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
S32 vertex_count = 0;
S32 i, x, y;
- S32 num_vertices, num_indices;
+ S32 num_vertices;
U32 render_stride = mLastStride;
S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge();
@@ -485,7 +485,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
if (north_stride == render_stride)
{
num_vertices = 2 * length + 1;
- num_indices = length * 6 - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(8, 15) + mPatchp->getPointAgent(8, 16))*0.5f;
@@ -536,7 +535,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
{
// North stride is longer (has less vertices)
num_vertices = length + length/2 + 1;
- num_indices = half_length*9 - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(7, 15) + mPatchp->getPointAgent(8, 16))*0.5f;
@@ -595,7 +593,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
length = patch_size / north_stride;
half_length = length / 2;
num_vertices = length + half_length + 1;
- num_indices = 9*half_length - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(15, 7) + mPatchp->getPointAgent(16, 8))*0.5f;
@@ -666,7 +663,7 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
{
S32 i, x, y;
- S32 num_vertices, num_indices;
+ S32 num_vertices;
U32 render_stride = mLastStride;
S32 patch_size = mPatchp->getSurface()->getGridsPerPatchEdge();
@@ -679,7 +676,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
if (east_stride == render_stride)
{
num_vertices = 2 * length + 1;
- num_indices = length * 6 - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(8, 15) + mPatchp->getPointAgent(8, 16))*0.5f;
@@ -728,7 +724,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
{
// East stride is longer (has less vertices)
num_vertices = length + half_length + 1;
- num_indices = half_length*9 - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(7, 15) + mPatchp->getPointAgent(8, 16))*0.5f;
@@ -783,7 +778,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
length = patch_size / east_stride;
half_length = length / 2;
num_vertices = length + length/2 + 1;
- num_indices = 9*(length/2) - 3;
facep->mCenterAgent = (mPatchp->getPointAgent(15, 7) + mPatchp->getPointAgent(16, 8))*0.5f;
@@ -942,8 +936,8 @@ void LLVOSurfacePatch::getGeomSizesEast(const S32 stride, const S32 east_stride,
}
}
-BOOL LLVOSurfacePatch::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
- LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal)
+BOOL LLVOSurfacePatch::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, S32 *face_hitp,
+ LLVector4a* intersection,LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent)
{
@@ -952,7 +946,9 @@ BOOL LLVOSurfacePatch::lineSegmentIntersect(const LLVector3& start, const LLVect
return FALSE;
}
- LLVector3 delta = end-start;
+ LLVector4a da;
+ da.setSub(end, start);
+ LLVector3 delta(da.getF32ptr());
LLVector3 pdelta = delta;
pdelta.mV[2] = 0;
@@ -961,7 +957,9 @@ BOOL LLVOSurfacePatch::lineSegmentIntersect(const LLVector3& start, const LLVect
F32 tdelta = 1.f/plength;
- LLVector3 origin = start - mRegionp->getOriginAgent();
+ LLVector3 v_start(start.getF32ptr());
+
+ LLVector3 origin = v_start - mRegionp->getOriginAgent();
if (mRegionp->getLandHeightRegion(origin) > origin.mV[2])
{
@@ -1016,12 +1014,12 @@ BOOL LLVOSurfacePatch::lineSegmentIntersect(const LLVector3& start, const LLVect
{
sample.mV[2] = mRegionp->getLandHeightRegion(sample);
}
- *intersection = sample + mRegionp->getOriginAgent();
+ intersection->load3((sample + mRegionp->getOriginAgent()).mV);
}
if (normal)
{
- *normal = mRegionp->getLand().resolveNormalGlobal(mRegionp->getPosGlobalFromRegion(sample));
+ normal->load3((mRegionp->getLand().resolveNormalGlobal(mRegionp->getPosGlobalFromRegion(sample))).mV);
}
return TRUE;