/* Copyright (C) John W. Ratcliff, 2001. * All rights reserved worldwide. * * This software is provided "as is" without express or implied * warranties. You may freely copy and compile this source into * applications you distribute provided that the copyright text * below is included in the resulting source code, for example: * "Portions Copyright (C) John W. Ratcliff, 2001" */ #include "Stdafx.h" #include "frustum.h" //#include "frustum.h" /*void Frustum::Set(int x1,int y1,int x2,int y2) { mX1 = x1; mY1 = y1; mX2 = x2; mY2 = y2; } */ ViewState Frustum::ViewVolumeTest(const Vector3d &c_v3Center,const float c_fRadius) const { if (m_bUsingSphere) { D3DXVECTOR3 v( c_v3Center.x-m_v3Center.x, c_v3Center.y-m_v3Center.y, c_v3Center.z-m_v3Center.z); if ((c_fRadius + m_fRadius) * (c_fRadius + m_fRadius) < D3DXVec3LengthSq(&v)) { return VS_OUTSIDE; } } const int count=6; D3DXVECTOR3 center = c_v3Center; //center.y *=-1; int i; float distance[count]; for(i=0;i