mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Moved fpumath to bx.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <bgfx.h>
|
||||
#include <bx/timer.h>
|
||||
#include "fpumath.h"
|
||||
#include <bx/fpumath.h>
|
||||
|
||||
#include "font/font_manager.h"
|
||||
#include "font/text_metrics.h"
|
||||
@@ -197,11 +197,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
|
||||
float view[16];
|
||||
float proj[16];
|
||||
mtxLookAt(view, eye, at);
|
||||
bx::mtxLookAt(view, eye, at);
|
||||
float centering = 0.5f;
|
||||
|
||||
// Setup a top-left ortho matrix for screen space drawing.
|
||||
mtxOrtho(proj, centering, width + centering, height + centering, centering, -1.0f, 1.0f);
|
||||
bx::mtxOrtho(proj, centering, width + centering, height + centering, centering, -1.0f, 1.0f);
|
||||
|
||||
// Set view and projection matrix for view 0.
|
||||
bgfx::setViewTransform(0, view, proj);
|
||||
@@ -214,20 +214,20 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
float textScaleMat[16];
|
||||
float screenCenterMat[16];
|
||||
|
||||
mtxRotateZ(textRotMat, textRotation);
|
||||
mtxTranslate(textCenterMat, -(textAreaWidth * 0.5f), (-visibleLineCount)*metrics.getLineHeight()*0.5f, 0);
|
||||
mtxScale(textScaleMat, textScale, textScale, 1.0f);
|
||||
mtxTranslate(screenCenterMat, ( (width) * 0.5f), ( (height) * 0.5f), 0);
|
||||
bx::mtxRotateZ(textRotMat, textRotation);
|
||||
bx::mtxTranslate(textCenterMat, -(textAreaWidth * 0.5f), (-visibleLineCount)*metrics.getLineHeight()*0.5f, 0);
|
||||
bx::mtxScale(textScaleMat, textScale, textScale, 1.0f);
|
||||
bx::mtxTranslate(screenCenterMat, ( (width) * 0.5f), ( (height) * 0.5f), 0);
|
||||
|
||||
//first translate to text center, then scale, then rotate
|
||||
float tmpMat[16];
|
||||
mtxMul(tmpMat, textCenterMat, textRotMat);
|
||||
bx::mtxMul(tmpMat, textCenterMat, textRotMat);
|
||||
|
||||
float tmpMat2[16];
|
||||
mtxMul(tmpMat2, tmpMat, textScaleMat);
|
||||
bx::mtxMul(tmpMat2, tmpMat, textScaleMat);
|
||||
|
||||
float tmpMat3[16];
|
||||
mtxMul(tmpMat3, tmpMat2, screenCenterMat);
|
||||
bx::mtxMul(tmpMat3, tmpMat2, screenCenterMat);
|
||||
|
||||
// Set model matrix for rendering.
|
||||
bgfx::setTransform(tmpMat3);
|
||||
|
||||
Reference in New Issue
Block a user