Skip to content
Snippets Groups Projects
Commit 4fc71be0 authored by Richard Linden's avatar Richard Linden
Browse files

Merge

parents f0fa1961 e298325b
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa ...@@ -172,7 +172,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (!pos_source) if (!pos_source)
{ {
llwarns << "Unable to process mesh without position data; invalid model; invalid model." << llendl; LL_WARNS() << "Unable to process mesh without position data; invalid model; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT; return LLModel::BAD_ELEMENT;
} }
...@@ -193,7 +193,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa ...@@ -193,7 +193,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if ((vertex_count == 0) || (tc_count == 0)) if ((vertex_count == 0) || (tc_count == 0))
{ {
llwarns << "Unable to process mesh with empty position array; invalid model." << llendl; LL_WARNS() << "Unable to process mesh with empty position array; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT; return LLModel::BAD_ELEMENT;
} }
......
...@@ -85,7 +85,6 @@ const LLManip::EManipPart MANIPULATOR_IDS[LLManipScale::NUM_MANIPULATORS] = ...@@ -85,7 +85,6 @@ const LLManip::EManipPart MANIPULATOR_IDS[LLManipScale::NUM_MANIPULATORS] =
LLManip::LL_FACE_NEGZ LLManip::LL_FACE_NEGZ
}; };
F32 get_default_max_prim_scale(bool is_flora) F32 get_default_max_prim_scale(bool is_flora)
{ {
// a bit of a hack, but if it's foilage, we don't want to use the // a bit of a hack, but if it's foilage, we don't want to use the
...@@ -292,10 +291,6 @@ void LLManipScale::render() ...@@ -292,10 +291,6 @@ void LLManipScale::render()
LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL); LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset( -2.f, -2.f); glPolygonOffset( -2.f, -2.f);
// JC - Band-aid until edge stretch working similar to side stretch
// in non-uniform.
// renderEdges( bbox );
renderCorners( bbox ); renderCorners( bbox );
renderFaces( bbox ); renderFaces( bbox );
...@@ -693,63 +688,38 @@ void LLManipScale::renderFaces( const LLBBox& bbox ) ...@@ -693,63 +688,38 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
{ {
case 0: case 0:
conditionalHighlight( LL_FACE_POSZ, &z_highlight_color, &z_normal_color ); conditionalHighlight( LL_FACE_POSZ, &z_highlight_color, &z_normal_color );
renderAxisHandle( LL_FACE_POSZ, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], max.mV[VZ] ) ); renderAxisHandle( 8, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], max.mV[VZ] ) );
break; break;
case 1: case 1:
conditionalHighlight( LL_FACE_POSX, &x_highlight_color, &x_normal_color ); conditionalHighlight( LL_FACE_POSX, &x_highlight_color, &x_normal_color );
renderAxisHandle( LL_FACE_POSX, ctr, LLVector3( max.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) ); renderAxisHandle( 9, ctr, LLVector3( max.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
break; break;
case 2: case 2:
conditionalHighlight( LL_FACE_POSY, &y_highlight_color, &y_normal_color ); conditionalHighlight( LL_FACE_POSY, &y_highlight_color, &y_normal_color );
renderAxisHandle( LL_FACE_POSY, ctr, LLVector3( ctr.mV[VX], max.mV[VY], ctr.mV[VZ] ) ); renderAxisHandle( 10, ctr, LLVector3( ctr.mV[VX], max.mV[VY], ctr.mV[VZ] ) );
break; break;
case 3: case 3:
conditionalHighlight( LL_FACE_NEGX, &x_highlight_color, &x_normal_color ); conditionalHighlight( LL_FACE_NEGX, &x_highlight_color, &x_normal_color );
renderAxisHandle( LL_FACE_NEGX, ctr, LLVector3( min.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) ); renderAxisHandle( 11, ctr, LLVector3( min.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
break; break;
case 4: case 4:
conditionalHighlight( LL_FACE_NEGY, &y_highlight_color, &y_normal_color ); conditionalHighlight( LL_FACE_NEGY, &y_highlight_color, &y_normal_color );
renderAxisHandle( LL_FACE_NEGY, ctr, LLVector3( ctr.mV[VX], min.mV[VY], ctr.mV[VZ] ) ); renderAxisHandle( 12, ctr, LLVector3( ctr.mV[VX], min.mV[VY], ctr.mV[VZ] ) );
break; break;
case 5: case 5:
conditionalHighlight( LL_FACE_NEGZ, &z_highlight_color, &z_normal_color ); conditionalHighlight( LL_FACE_NEGZ, &z_highlight_color, &z_normal_color );
renderAxisHandle( LL_FACE_NEGZ, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], min.mV[VZ] ) ); renderAxisHandle( 13, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], min.mV[VZ] ) );
break; break;
} }
} }
} }
} }
void LLManipScale::renderEdges( const LLBBox& bbox )
{
LLVector3 extent = bbox.getExtentLocal();
for( U32 part = LL_EDGE_MIN; part <= LL_EDGE_MAX; part++ )
{
F32 edge_width = mBoxHandleSize[part] * .6f;
LLVector3 direction = edgeToUnitVector( part );
LLVector3 center_to_edge = unitVectorToLocalBBoxExtent( direction, bbox );
gGL.pushMatrix();
{
gGL.translatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] );
conditionalHighlight( part );
gGL.scalef(
direction.mV[0] ? edge_width : extent.mV[VX],
direction.mV[1] ? edge_width : extent.mV[VY],
direction.mV[2] ? edge_width : extent.mV[VZ] );
gBox.render();
}
gGL.popMatrix();
}
}
void LLManipScale::renderCorners( const LLBBox& bbox ) void LLManipScale::renderCorners( const LLBBox& bbox )
{ {
U32 part = LL_CORNER_NNN; U32 part = LL_CORNER_NNN;
...@@ -792,14 +762,14 @@ void LLManipScale::renderBoxHandle( F32 x, F32 y, F32 z ) ...@@ -792,14 +762,14 @@ void LLManipScale::renderBoxHandle( F32 x, F32 y, F32 z )
} }
void LLManipScale::renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end ) void LLManipScale::renderAxisHandle( U32 handle_index, const LLVector3& start, const LLVector3& end )
{ {
if( getShowAxes() ) if( getShowAxes() )
{ {
// Draws a single "jacks" style handle: a long, retangular box from start to end. // Draws a single "jacks" style handle: a long, retangular box from start to end.
LLVector3 offset_start = end - start; LLVector3 offset_start = end - start;
offset_start.normalize(); offset_start.normalize();
offset_start = start + mBoxHandleSize[part] * offset_start; offset_start = start + mBoxHandleSize[handle_index] * offset_start;
LLVector3 delta = end - offset_start; LLVector3 delta = end - offset_start;
LLVector3 pos = offset_start + 0.5f * delta; LLVector3 pos = offset_start + 0.5f * delta;
...@@ -808,9 +778,9 @@ void LLManipScale::renderAxisHandle( U32 part, const LLVector3& start, const LLV ...@@ -808,9 +778,9 @@ void LLManipScale::renderAxisHandle( U32 part, const LLVector3& start, const LLV
{ {
gGL.translatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] ); gGL.translatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] );
gGL.scalef( gGL.scalef(
mBoxHandleSize[part] + llabs(delta.mV[VX]), mBoxHandleSize[handle_index] + llabs(delta.mV[VX]),
mBoxHandleSize[part] + llabs(delta.mV[VY]), mBoxHandleSize[handle_index] + llabs(delta.mV[VY]),
mBoxHandleSize[part] + llabs(delta.mV[VZ])); mBoxHandleSize[handle_index] + llabs(delta.mV[VZ]));
gBox.render(); gBox.render();
} }
gGL.popMatrix(); gGL.popMatrix();
......
...@@ -96,7 +96,6 @@ class LLManipScale : public LLManip ...@@ -96,7 +96,6 @@ class LLManipScale : public LLManip
private: private:
void renderCorners( const LLBBox& local_bbox ); void renderCorners( const LLBBox& local_bbox );
void renderFaces( const LLBBox& local_bbox ); void renderFaces( const LLBBox& local_bbox );
void renderEdges( const LLBBox& local_bbox );
void renderBoxHandle( F32 x, F32 y, F32 z ); void renderBoxHandle( F32 x, F32 y, F32 z );
void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end ); void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end );
void renderGuidelinesPart( const LLBBox& local_bbox ); void renderGuidelinesPart( const LLBBox& local_bbox );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment