Eidolon
|
#include <RenderTypes.h>
Public Types | |
typedef vec3(* | vecfunc) (Ctx, int) |
typedef color(* | colfunc) (Ctx, int) |
Public Member Functions | |
CallbackVertexBuffer (Ctx context, sval numvertices, vecfunc vertfunc, vecfunc normalfunc=NULL, colfunc colorfunc=NULL, vecfunc uvwfunc=NULL) | |
virtual vec3 | getVertex (int i) const |
Returns the i'th vertex, i<numVertices() More... | |
virtual vec3 | getNormal (int i) const |
Returns the i'th normal, i<numVertices() More... | |
virtual color | getColor (int i) const |
Returns the i'th color, i<numVertices() More... | |
virtual vec3 | getUVWCoord (int i) const |
Returns the i'th UVW texture coord, i<numVertices() More... | |
virtual sval | numVertices () const |
Returns number of total vertices. More... | |
virtual bool | hasNormal () const |
Returns true if the buffer contains normal data. More... | |
virtual bool | hasColor () const |
Returns true if the buffer contains color data. More... | |
virtual bool | hasUVWCoord () const |
Returns true if the buffer contains texture coord data. More... | |
![]() | |
virtual | ~VertexBuffer () |
Public Attributes | |
vecfunc | vertfunc |
vecfunc | normalfunc |
colfunc | colorfunc |
vecfunc | uvwfunc |
sval | numvertices |
Ctx | context |
This buffer uses callback functions passed to its constructor as the sources of data rather than storing matrices. The purpose is to allow the callback functions to be defined in Cython to adapt Python code/objects to C++. This allows a VertexBuffer subtype to be defined with Python code but callable in C++. The Ctx value is the context the callback functions are given when called which is typically going to be `this' cast to a different type in Cython such as void*.
typedef color(* colfunc) (Ctx, int) |
typedef vec3(* vecfunc) (Ctx, int) |
|
inline |
|
inlinevirtual |
Returns the i'th color, i<numVertices()
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns the i'th normal, i<numVertices()
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns the i'th UVW texture coord, i<numVertices()
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns the i'th vertex, i<numVertices()
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns true if the buffer contains color data.
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns true if the buffer contains normal data.
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns true if the buffer contains texture coord data.
Reimplemented from VertexBuffer.
|
inlinevirtual |
Returns number of total vertices.
Reimplemented from VertexBuffer.
colfunc colorfunc |
Ctx context |
vecfunc normalfunc |
sval numvertices |
vecfunc uvwfunc |
vecfunc vertfunc |