Unstaged changes cleanup. Further vectorization. Change in binormal/bitangent calculation.

This commit is contained in:
Shyotl
2013-10-09 14:47:06 -05:00
parent b473661cf4
commit f25eb07fab
51 changed files with 1987 additions and 1895 deletions

View File

@@ -1729,19 +1729,20 @@ void LLVOAvatar::renderCollisionVolumes()
if (mNameText.notNull())
{
LLVector3 unused;
mNameText->lineSegmentIntersect(LLVector3(0,0,0), LLVector3(0,0,1), unused, TRUE);
LLVector4a unused;
mNameText->lineSegmentIntersect(unused, unused, unused, TRUE);
}
}
BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
S32 face,
BOOL pick_transparent,
S32* face_hit,
LLVector3* intersection,
LLVector4a* intersection,
LLVector2* tex_coord,
LLVector3* normal,
LLVector3* bi_normal)
LLVector4a* normal,
LLVector4a* tangent)
{
if ((isSelf() && !gAgent.needsRenderAvatar()) || !LLPipeline::sPickAvatar)
{
@@ -1758,8 +1759,8 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
glh::matrix4f inverse = mat.inverse();
glh::matrix4f norm_mat = inverse.transpose();
glh::vec3f p1(start.mV);
glh::vec3f p2(end.mV);
glh::vec3f p1(start.getF32ptr());
glh::vec3f p2(end.getF32ptr());
inverse.mult_matrix_vec(p1);
inverse.mult_matrix_vec(p2);
@@ -1778,12 +1779,12 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
if (intersection)
{
*intersection = LLVector3(res_pos.v);
intersection->load3(res_pos.v);
}
if (normal)
{
*normal = LLVector3(res_norm.v);
normal->load3(res_norm.v);
}
return TRUE;
@@ -1817,7 +1818,8 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
}
}
LLVector3 position;
LLVector4a position;
if (mNameText.notNull() && mNameText->lineSegmentIntersect(start, end, position))
{
if (intersection)
@@ -1831,14 +1833,14 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
return FALSE;
}
LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector3& start, const LLVector3& end,
LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector4a& start, const LLVector4a& end,
S32 face,
BOOL pick_transparent,
S32* face_hit,
LLVector3* intersection,
LLVector4a* intersection,
LLVector2* tex_coord,
LLVector3* normal,
LLVector3* bi_normal)
LLVector4a* normal,
LLVector4a* tangent)
{
static const LLCachedControl<bool> allow_mesh_picking("SGAllowRiggedMeshSelection");
@@ -1851,8 +1853,8 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
if (lineSegmentBoundingBox(start, end))
{
LLVector3 local_end = end;
LLVector3 local_intersection;
LLVector4a local_end = end;
LLVector4a local_intersection;
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
@@ -1866,7 +1868,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
{
LLViewerObject* attached_object = (*attachment_iter);
if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, face_hit, &local_intersection, tex_coord, normal, bi_normal))
if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, face_hit, &local_intersection, tex_coord, normal, tangent))
{
local_end = local_intersection;
if (intersection)