A little vectorization. gluProject replaced with vectorized glProjectf. Added LLMatrix4a::rotate4. Tweaked LLMatrix4a::rotate. Removed extra _mm_movehl_ps call in LLMatrix3a::setTranspose

This commit is contained in:
Shyotl
2011-11-19 20:02:31 -06:00
parent 70909f86c8
commit 1cf367aae5
4 changed files with 108 additions and 66 deletions

View File

@@ -54,6 +54,8 @@ void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent,
hud_render_text(wstr, pos_agent, font, style, x_offset, y_offset, color, orthographic);
}
int glProjectf(const LLVector3& object, const F32* modelview, const F32* projection, const LLRect& viewport, LLVector3& windowCoordinate);
void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
const LLFontGL &font,
const U8 style,
@@ -103,27 +105,15 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
//get the render_pos in screen space
F64 winX, winY, winZ;
LLVector3 window_coordinates;
F32& winX = window_coordinates.mV[VX];
F32& winY = window_coordinates.mV[VY];
F32& winZ = window_coordinates.mV[VZ];
const LLRect& world_view_rect = gViewerWindow->getWorldViewRectRaw();
S32 viewport[4];
viewport[0] = world_view_rect.mLeft;
viewport[1] = world_view_rect.mBottom;
viewport[2] = world_view_rect.getWidth();
viewport[3] = world_view_rect.getHeight();
F64 mdlv[16];
F64 proj[16];
for (U32 i = 0; i < 16; i++)
{
mdlv[i] = (F64) gGLModelView[i];
proj[i] = (F64) gGLProjection[i];
}
gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2],
mdlv, proj, (GLint*) viewport,
&winX, &winY, &winZ);
glProjectf(render_pos, gGLModelView, gGLProjection, world_view_rect, window_coordinates);
//fonts all render orthographically, set up projection``
glMatrixMode(GL_PROJECTION);
glPushMatrix();