Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | List of all members
G3D::UniversalSurface::CPUGeom Class Reference

Public Member Functions

 CPUGeom (const Array< int > *index, const MeshAlg::Geometry *geometry, const Array< Vector2 > *texCoord0, const Array< Vector2unorm16 > *texCoord1=nullptr, const Array< Color4 > *vertexColors=nullptr, const Array< Vector4 > *packedTangent=nullptr)
 
 CPUGeom (const Array< int > *index, const CPUVertexArray *vertexArray)
 
 CPUGeom ()
 
void copyVertexDataToGPU (AttributeArray &vertex, AttributeArray &normal, AttributeArray &packedTangents, AttributeArray &texCoord0, AttributeArray &texCoord1, AttributeArray &vertexColors, VertexBuffer::UsageHint hint)
 Updates the interleaved vertex arrays. More...
 

Public Attributes

const MeshAlg::Geometrygeometry
 
const Array< int > * index
 
const Array< Vector4 > * packedTangent
 Packs two tangents, T1 and T2 that form a reference frame with the normal such that. More...
 
const Array< Vector2 > * texCoord0
 
const Array< Vector2unorm16 > * texCoord1
 May be nullptr. More...
 
const CPUVertexArrayvertexArray
 If non-nullptr, this superceeds geometry, packedTangent, and texCoord0. More...
 
const Array< Color4 > * vertexColors
 

Constructor & Destructor Documentation

◆ CPUGeom() [1/3]

G3D::UniversalSurface::CPUGeom::CPUGeom ( const Array< int > *  index,
const MeshAlg::Geometry geometry,
const Array< Vector2 > *  texCoord0,
const Array< Vector2unorm16 > *  texCoord1 = nullptr,
const Array< Color4 > *  vertexColors = nullptr,
const Array< Vector4 > *  packedTangent = nullptr 
)
inline

◆ CPUGeom() [2/3]

G3D::UniversalSurface::CPUGeom::CPUGeom ( const Array< int > *  index,
const CPUVertexArray vertexArray 
)
inline

◆ CPUGeom() [3/3]

G3D::UniversalSurface::CPUGeom::CPUGeom ( )
inline

Member Function Documentation

◆ copyVertexDataToGPU()

void G3D::UniversalSurface::CPUGeom::copyVertexDataToGPU ( AttributeArray vertex,
AttributeArray normal,
AttributeArray packedTangents,
AttributeArray texCoord0,
AttributeArray texCoord1,
AttributeArray vertexColors,
VertexBuffer::UsageHint  hint 
)

Updates the interleaved vertex arrays.

If they are not big enough, allocates a new vertex buffer and reallocates the vertex arrays inside them. This is often used as a helper to convert a CPUGeom to a GPUGeom.

Member Data Documentation

◆ geometry

const MeshAlg::Geometry* G3D::UniversalSurface::CPUGeom::geometry

◆ index

const Array<int>* G3D::UniversalSurface::CPUGeom::index

◆ packedTangent

const Array<Vector4>* G3D::UniversalSurface::CPUGeom::packedTangent

Packs two tangents, T1 and T2 that form a reference frame with the normal such that.

  • $ \vec{x} = \vec{T}_1 = \vec{t}_{xyz}$
  • $ \vec{y} = \vec{T}_2 = \vec{t}_w * (\vec{n} \times \vec{t}_{xyz}) $
  • $ \vec{z} = \vec{n} $

◆ texCoord0

const Array<Vector2>* G3D::UniversalSurface::CPUGeom::texCoord0

◆ texCoord1

const Array<Vector2unorm16>* G3D::UniversalSurface::CPUGeom::texCoord1

May be nullptr.

◆ vertexArray

const CPUVertexArray* G3D::UniversalSurface::CPUGeom::vertexArray

If non-nullptr, this superceeds geometry, packedTangent, and texCoord0.

◆ vertexColors

const Array<Color4>* G3D::UniversalSurface::CPUGeom::vertexColors

documentation generated on Wed Nov 24 2021 08:02:01 using doxygen 1.8.15