📄 baseentity.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -