frustum.h

来自「涉及windows游戏编程中的一些源码」· C头文件 代码 · 共 28 行

H
28
字号

#ifndef _FRUSTUM_H_
#define _FRUSTUM_H_

#include "Camera.h"

class CFrustum {

public:

	// Call this every time the camera moves to update the frustum
	void CalculateFrustum();

	// This takes a 3D point and returns TRUE if it's inside of the frustum
	bool PointInFrustum(float x, float y, float z);

	// This takes a 3D point and a radius and returns TRUE if the sphere is inside of the frustum
	bool SphereInFrustum(float x, float y, float z, float radius);

	// This takes the center and half the length of the cube.
	bool CubeInFrustum( float x, float y, float z, float size );
private:

	// This holds the A B C and D values for each side of our frustum.
	float m_Frustum[6][4];
};
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?