graphics
Class CHFTracer
in HFTracer.h
in HFTracer.cpp
- class CHFTracer
Constructor Summary |
CHFTracer( CTerrain* pTerrain )
RayTriIntersect: intersect a ray with triangle defined by vertices
v0,v1,v2; return true if ray hits triangle at distance less than dist,
or false otherwise |
Method Summary |
private bool |
CellIntersect( int cx, int cz, CVector3D& origin, CVector3D& dir, float& dist ) const
RayIntersect: intersect ray with this heightfield; return true if
intersection occurs (and fill in grid coordinates of intersection), or false
otherwise |
bool |
RayIntersect( CVector3D& origin, CVector3D& dir, int& x, int& z, CVector3D& ipt ) const
|
private bool |
RayTriIntersect( const CVector3D& v0, const CVector3D& v1, const CVector3D& v2, const CVector3D& origin, const CVector3D& dir, float& dist ) const
CellIntersect: test if ray intersects either of the triangles in the given
cell - return hit result, and distance to hit, if hit occurred |
m_CellSize
private float m_CellSize;
m_Heightfield
private const u16* m_Heightfield;
m_HeightScale
private float m_HeightScale;
m_MapSize
private u32 m_MapSize;
m_pTerrain
private CTerrain* m_pTerrain;
CHFTracer
public CHFTracer( CTerrain* pTerrain );
- RayTriIntersect: intersect a ray with triangle defined by vertices
v0,v1,v2; return true if ray hits triangle at distance less than dist,
or false otherwise
CellIntersect
private bool CellIntersect( int cx, int cz, CVector3D& origin, CVector3D& dir, float& dist ) const;
- RayIntersect: intersect ray with this heightfield; return true if
intersection occurs (and fill in grid coordinates of intersection), or false
otherwise
RayIntersect
public bool RayIntersect( CVector3D& origin, CVector3D& dir, int& x, int& z, CVector3D& ipt ) const;
RayTriIntersect
private bool RayTriIntersect( const CVector3D& v0, const CVector3D& v1, const CVector3D& v2, const CVector3D& origin, const CVector3D& dir, float& dist ) const;
- CellIntersect: test if ray intersects either of the triangles in the given
cell - return hit result, and distance to hit, if hit occurred