baseentity.h
来自「java实现的简单的分形树。简单易学!是学习分形知识的很好的例子。其java语法」· C头文件 代码 · 共 34 行
H
34 行
#ifndef __BASE_ENTITY_H
#define __BASE_ENTITY_H
#include <dingus/math/AABox.h>
#include <dingus/renderer/RenderableMesh.h>
class CBaseEntity {
public:
/**
* Frustum-culls, if potentially visible then computes WorldView
* and WVP matrices.
* @return true if potentially visible.
*/
bool preRender() {
const CRenderCamera& cam = G_RENDERCTX->getCamera();
if( !mAABB.frustumCull( mMatrix, cam.getViewProjMatrix() ) ) {
mWorldView = mMatrix * cam.getViewMatrix();
mWVP = mWorldView * cam.getProjectionMatrix();
return true;
}
return false;
}
public:
SMatrix4x4 mMatrix;
SMatrix4x4 mWorldView;
SMatrix4x4 mWVP;
CAABox mAABB;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?