예제 #1
0
	void cFrustum::SetViewProjMatrix(const cMatrixf& a_mtxProj, const cMatrixf& a_mtxView,
									float afFarPlane, float afNearPlane,float afFOV,float afAspect,
									const cVector3f &avOrigin, bool abInfFarPlane)
	{
		m_mtxViewProj = cMath::MatrixMul(a_mtxProj, a_mtxView);
		m_mtxModelView = a_mtxView;

		mfFarPlane = afFarPlane;
		mfNearPlane = afNearPlane;
		mfFOV = afFOV;
		mfAspect = afAspect;

		mvOrigin = avOrigin;

		mbInfFarPlane = abInfFarPlane;
		
		//This could be made more accurate.
		mOriginBV.SetSize(afNearPlane*2);
		mOriginBV.SetPosition(mvOrigin);
		
		UpdatePlanes();
		UpdateSphere();
		UpdateEndPoints();
		UpdateBV();
	}
예제 #2
0
	void cFrustum::SetViewProjMatrix(const cMatrixf &a_mtxProj, const cMatrixf &a_mtxView,
			float a_fFarPlane, float a_fNearPlane, float a_fFOV, float a_fAspect,
			const cVector3f &a_vOrigin, bool a_bInfFarPlane)
	{
		m_mtxViewProj = cMath::MatrixMul(a_mtxProj, a_mtxView);
		m_mtxModelView = a_mtxView;

		m_fFarPlane = a_fFarPlane;
		m_fNearPlane = a_fNearPlane;
		m_fFOV = a_fFOV;
		m_fAspect = a_fAspect;

		m_vOrigin = a_vOrigin;

		m_bInfFarPlane = a_bInfFarPlane;

		m_OriginBV.SetSize(a_fNearPlane*2);
		m_OriginBV.SetPosition(m_vOrigin);

		UpdatePlanes();
		UpdateSphere();
		UpdateEndPoints();
		UpdateBV();
	}