ScummVM API documentation
hpl::cMesh2D Class Reference

#include <Mesh2d.h>

Public Member Functions

void AddVertex (cVector2f avPos, cVector2f avTexCoord=0, cColor aCol=1)
 
void AddIndex (unsigned int alIndex)
 
void AddEdgeIndex (unsigned int alIndex)
 
void CreateVertexVec ()
 
void CreateTileVertexVec ()
 
tVertexVecGetVertexVec (const cRect2f &aImageRect, cVector2f avSize, eTileRotation aRotation=eTileRotation_0)
 
tUIntVecGetIndexVec ()
 
tMesh2DEdgeVecGetEdgeVec (eTileRotation aRotation=eTileRotation_0)
 
bool PointIsInside (const cVector2f &avPoint, const cVector2f &avMeshPos, eTileRotation aRotation=eTileRotation_0)
 
cCollisionMesh2DCreateCollisonMesh (const cVector2f &avPos, const cVector2f &avSizeMul, eTileRotation aRotation=eTileRotation_0)
 

Detailed Description

Mesh2D is stores meshes used by 2d objects for collision and drawing.

Remarks
The main objects in the class is the vertex list, the edge list, the index list and the edge index list. The edge list is a list calculated by the app it self, it contain normals for all edges in the vertex list. When the vertexes are defined this must be in a clockwise order in the edge index list! The Z value in the vertex doesn't matter. The indexes point to the vertex list.
See also

Member Function Documentation

◆ PointIsInside()

bool hpl::cMesh2D::PointIsInside ( const cVector2f avPoint,
const cVector2f avMeshPos,
eTileRotation  aRotation = eTileRotation_0 
)

Checks if a point is inside the mesh. Only works on convex edge meshes.

Parameters
avPoint
avMeshPos
aRotation
Returns

The documentation for this class was generated from the following file: