demo 1
This commit is contained in:
@@ -30,6 +30,8 @@ class Math {
|
||||
static inline float sin(float x) { return cos(x - HALF_PI); }
|
||||
static inline float tan(float x) { return sin(x) / cos(x); }
|
||||
static float invSqrt(float x);
|
||||
static bool equalf(const float& a, const float& b,
|
||||
const float& epsilon = 0.00001F);
|
||||
|
||||
private:
|
||||
Math();
|
||||
|
||||
@@ -35,9 +35,16 @@ class RendererCore3D {
|
||||
|
||||
void setFov(const float& t_fov);
|
||||
|
||||
/**
|
||||
* Called by beginFrame();
|
||||
* Sets 3D support to off
|
||||
*/
|
||||
void update();
|
||||
|
||||
/**
|
||||
* Called by beginFrame();
|
||||
* Updates camera info, to get proper frustum culling.
|
||||
* Sets 3D support to on
|
||||
*/
|
||||
void update(const CameraInfo3D& cameraInfo);
|
||||
|
||||
@@ -48,13 +55,13 @@ class RendererCore3D {
|
||||
* Get view (camera) matrix
|
||||
* Updated at every beginFrame()
|
||||
*/
|
||||
const M4x4& getView() { return view; }
|
||||
const M4x4& getView();
|
||||
|
||||
/**
|
||||
* Get projection * view matrix
|
||||
* Updated at every beginFrame()
|
||||
*/
|
||||
const M4x4& getViewProj() { return viewProj; }
|
||||
const M4x4& getViewProj();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
@@ -80,6 +87,7 @@ class RendererCore3D {
|
||||
private:
|
||||
M4x4 view, projection, viewProj;
|
||||
float fov;
|
||||
bool is3DSupportEnabled;
|
||||
|
||||
RendererSettings* settings;
|
||||
|
||||
|
||||
@@ -47,7 +47,10 @@ class RendererCore {
|
||||
/** World background color */
|
||||
void setClearScreenColor(const Color& color);
|
||||
|
||||
/** Clear screen and update view frustum for frustum culling. */
|
||||
/** Clear screen and update view frustum for frustum culling. NO 3D support */
|
||||
void beginFrame();
|
||||
|
||||
/** Clear screen and update view frustum for frustum culling. 3D support */
|
||||
void beginFrame(const CameraInfo3D& cameraInfo);
|
||||
|
||||
/** VSync and swap frame double buffer. */
|
||||
|
||||
@@ -37,7 +37,10 @@ class Renderer {
|
||||
|
||||
void setFrameLimit(const bool& onoff) { core.setFrameLimit(onoff); }
|
||||
|
||||
/** Update view frustum for frustum culling. */
|
||||
/** Update view frustum for frustum culling. 3D support - off */
|
||||
void beginFrame();
|
||||
|
||||
/** Update view frustum for frustum culling. 3D support - on */
|
||||
void beginFrame(const CameraInfo3D& cameraInfo);
|
||||
|
||||
/** VSync and swap frame double buffer. */
|
||||
|
||||
Reference in New Issue
Block a user