Castor3D 0.16.0
Multiplatform 3D engine
Static Public Member Functions | List of all members
castor3d::SubmeshUtils Class Reference

Submesh utility functions. More...

#include <SubmeshUtils.hpp>

Static Public Member Functions

static C3D_API void computeFacesFromPolygonVertex (castor::Point3fArray &texcoords, TriFaceMapping const &triFace)
 Creates faces from the points.
 
static C3D_API void computeNormals (castor::Point3fArray const &positions, castor::Point3fArray &normals, FaceArray const &triFace, bool reverted=false)
 Generates normals.
 
static C3D_API void computeTangentsFromNormals (castor::Point3fArray const &positions, castor::Point3fArray const &texcoords, castor::Point3fArray const &normals, castor::Point4fArray &tangents, FaceArray const &faces)
 Computes tangent for each vertex of the submesh.
 

Detailed Description

Submesh utility functions.

Member Function Documentation

◆ computeFacesFromPolygonVertex()

static C3D_API void castor3d::SubmeshUtils::computeFacesFromPolygonVertex ( castor::Point3fArray & texcoords,
TriFaceMapping const & triFace )
static

Creates faces from the points.

Remarks
This function assumes the points are sorted like triangles fan.
Parameters
[in,out]texcoordsThe texture coordinates.
[in,out]triFaceThe component that will receive the computed triangles.

◆ computeNormals()

static C3D_API void castor3d::SubmeshUtils::computeNormals ( castor::Point3fArray const & positions,
castor::Point3fArray & normals,
FaceArray const & triFace,
bool reverted = false )
static

Generates normals.

Parameters
[in]positionsThe vertices positions.
[out]normalsThe vertices normals.
[in]triFaceThe triangles.
[in]revertedTells if the normals must be inverted.

◆ computeTangentsFromNormals()

static C3D_API void castor3d::SubmeshUtils::computeTangentsFromNormals ( castor::Point3fArray const & positions,
castor::Point3fArray const & texcoords,
castor::Point3fArray const & normals,
castor::Point4fArray & tangents,
FaceArray const & faces )
static

Computes tangent for each vertex of the submesh.

Remarks
This function supposes the normals are defined.
Parameters
[in]positionsThe vertices positions.
[in]texcoordsThe vertices texture coordinates.
[in]normalsThe vertices normals.
[out]tangentsThe vertices tangents.
[in]facesThe triangles.

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