Added support for setting the axis which the text should be aligned along.

This commit is contained in:
Robert Osfield
2002-12-05 12:01:38 +00:00
parent a4404a388d
commit d7692f83d7
2 changed files with 17 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ Text::Text(const Text& text,const osg::CopyOp& copyop):
_alignment(text._alignment),
_drawMode(text._drawMode),
_boundingBoxType(text._boundingBoxType),
_axisAlignment(text._axisAlignment),
_pos(text._pos),
_alignmentPos(text._alignmentPos),
_color(text._color)
@@ -122,8 +123,11 @@ setDefaults()
_boundingBoxType=GLYPH;
_boundingBoxType=GEOMETRY;
_axisAlignment = XY_PLANE;
_initAlignment=false;
_useDisplayList=false;
}
@@ -209,6 +213,8 @@ void Text::drawImplementation(State& state) const
{
case POLYGON:
glTranslatef(drawPos.x(),drawPos.y(),drawPos.z());
if(_axisAlignment==XZ_PLANE) glRotatef(90.0f,1.0f,0.0f,0.0f);
else if (_axisAlignment==YZ_PLANE) { glRotatef(90.0f,0.0f,0.0f,1.0f); glRotatef(90.0f,1.0f,0.0f,0.0f);}
_font->output(state,_text.c_str());
break;
case OUTLINE: