Sources/CryGame C++/Solution1/CryGame/XVehicleProxyHeli.cpp
//////////////////////////////////////////////////////////////////////
//returns height of the highest static entity object in self bbox extended down by depth

returns height of the highest static entity object in self bbox extended down by depth
returns height of the highest static entity object in self bbox extended down by depth
float CXVehicleProxy::GetObjectsBelowHeight( const Vec3d& pos, const float depth, const float scale )
{
	Vec3d bbox[2];
	float	theHeight = -1000;
	float	selfButtom;
	m_pEntity->GetBBox( bbox[0], bbox[1] );
	selfButtom = bbox[0].z;
	bbox[0].z -= depth; 
	vectorf vMin = pos + (bbox[0]-m_pEntity->GetPos())*scale;
	vectorf vMax = pos + (bbox[1]-m_pEntity->GetPos())*scale;
	IPhysicalEntity **ppList = NULL;
	int iNumEntites;
	iNumEntites = m_pGame->GetSystem()->GetIPhysicalWorld()->GetEntitiesInBox(vMin, vMax, ppList,  1);
	for(int i=0; i<iNumEntites; i++)
	{
		pe_status_pos status;
		if(ppList[i]->GetType()==PE_LIVING)
			continue;
		ppList[i]->GetStatus(&status);
		if(m_pGame->h_drawbelow->GetIVal() != 0 )
			m_pGame->GetSystem()->GetIRenderer()->Draw3dBBox( status.BBox[0] + status.pos, status.BBox[1] + status.pos);
		status.BBox[1].z += status.pos.z; 
		if(theHeight<status.BBox[1].z)
			theHeight = status.BBox[1].z;
	}
	return theHeight;
}
float CXVehicleProxy :: GetObjectsBelowHeight ( const Vec3d & pos , const float depth , const float scale ) { Vec3d bbox [ 2 ] ; float theHeight = -1000 ; float selfButtom ; m_pEntity -> GetBBox ( bbox [ 0 ] , bbox [ 1 ] ) ; selfButtom = bbox [ 0 ] . z ; bbox [ 0 ] . z -= depth ; vectorf vMin = pos + ( bbox [ 0 ] - m_pEntity -> GetPos ( ) ) * scale ; vectorf vMax = pos + ( bbox [ 1 ] - m_pEntity -> GetPos ( ) ) * scale ; IPhysicalEntity * * ppList = NULL ; int iNumEntites ; iNumEntites = m_pGame -> GetSystem ( ) -> GetIPhysicalWorld ( ) -> GetEntitiesInBox ( vMin , vMax , ppList , 1 ) ; for ( int i = 0 ; i < iNumEntites ; i ++ ) { pe_status_pos status ; if ( ppList [ i ] -> GetType ( ) == PE_LIVING ) continue ; ppList [ i ] -> GetStatus ( & status ) ; if ( m_pGame -> h_drawbelow -> GetIVal ( ) != 0 ) m_pGame -> GetSystem ( ) -> GetIRenderer ( ) -> Draw3dBBox ( status . BBox [ 0 ] + status . pos , status . BBox [ 1 ] + status . pos ) ; status . BBox [ 1 ] . z += status . pos . z ; if ( theHeight < status . BBox [ 1 ] . z ) theHeight = status . BBox [ 1 ] . z ; } return theHeight ; }
returns height of the highest static entity object in self bbox extended down by depth
returns height of the highest static entity object in self bbox extended down by depth
// object types - bitmask 0-terrain 1-static, 2-sleeping, 3-physical, 4-living
 // Get bbox (status) from physics engine
