CSAD
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
csad::Mesh Class Reference

Mesh - geometric container sets vertex model object. Tops in its composition can have the following characteristics: position, color, vector front, texture coordinates. More...

Inheritance diagram for csad::Mesh:
csad::BaseMesh csad::StaticMesh

Public Types

enum  stDrawFormat {
  _GL_POINTS = 0x000, _GL_LINES = 0x001, _GL_LINE_LOOP = 0x002, _GL_LINE_STRIP = 0x003,
  _GL_TRIANGLES = 0x004, _GL_TRIANGLE_STRIP = 0x005, _GL_TRIANGLE_FAN = 0x006, _GL_QUADS = 0x007 ,
  _GL_POLYGON = 0x009, _GL_INDEX_BYTE = 0x01000000 , _GL_NEED_INDEX_UPDATE = 0x10000000, _GL_NEED_ELEMENT_UPDATE = 0x20000000
}
 the format of building geometry. More...
 
enum  stFormat {
  _TGL_V2F = 0x00000001, _TGL_V3F = 0x00000002 , _TGL_V2D = 0x00000004, _TGL_V3D = 0x00000005 ,
  _TGL_N3F = 0x00000008, _TGL_0T1F = 0x00000010, _TGL_0T2F = 0x00000020 , _TGL_C3F = 0x10000000,
  _TGL_C4F = 0x20000000
}
 the types of fields of geometry More...
 
enum  stItem {
  _TEXTURE0 = 0, _TEXTURE1 = 1, _TEXTURE2 = 2 , _COLOR = 6,
  _NORMAL = 7, _VECTOR = 8
}
 field vertex geometry. More...
 

Public Member Functions

CSAD_API vector3d calculateBound ()
 preset sphere describing cube
 
CSAD_API void calculateNormals ()
 recalculate normals
 
CSAD_API void cleanIndex (int from, int count)
 specifies the zero index elements
 
template<typename T >
_FORCEINLINE LinkArray< T > color ()
 The array of vertices color.
 
_FORCEINLINE unsigned char *& elements ()
 елементы геометрии
 
_FORCEINLINE unsigned int elementsCount ()
 returns the number of vertices
 
_FORCEINLINE unsigned int elementSize ()
 The size element.
 
_FORCEINLINE vector4dgetBoundSphere ()
 returns a sector describing the cube in which pomeshaetsa geometry
 
CSAD_API unsigned int getColorType ()
 returns the color format of vertices: float[3] float[4]
 
_FORCEINLINE stDrawFormat getDrawFormat ()
 former rendering
 
CSAD_API unsigned int getTexType (int id)
 
CSAD_API unsigned int getVectorType ()
 
template<typename T >
_FORCEINLINE LinkArray< T > index ()
 Array indexes.
 
CSAD_API int indexById (unsigned int id)
 value of index
 
_FORCEINLINE unsigned int indexCount ()
 returns the number of indexes
 
CSAD_API bool isNormal ()
 returns true if the vertices contains the vector of the front
 
template<typename T >
_FORCEINLINE LinkArray< T > normal ()
 Array normals.
 
CSAD_API MeshresizeIndex (unsigned int count)
 Changes the number of indexes, preserving the values at the end of the array.
 
CSAD_API MeshresizeVertex (unsigned int count)
 Changes the number of elements, preserving the values at the end of the array.
 
CSAD_API MeshsetDrawFormat (stDrawFormat attr)
 задает тип геометри
 
CSAD_API MeshsetFields (unsigned int attr)
 to install the vertex format
 
CSAD_API MeshsetIndex (unsigned int i, int val)
 installing index
 
CSAD_API MeshsetIndexCount (unsigned int count)
 Sets the number of indexes, the previous value of the index is not saved.
 
CSAD_API MeshsetIndexLine (unsigned int i, unsigned int a, unsigned int b)
 installation of two indexess in a row
 
CSAD_API MeshsetIndexQuad (unsigned int i, unsigned int a, unsigned int b, unsigned int c, unsigned int d)
 installation of four indexes in a row
 
CSAD_API MeshsetIndexTri (unsigned int i, unsigned int a, unsigned int b, unsigned int c)
 installation of three indexes in a row
 
CSAD_API MeshsetVector (unsigned int i, float *v)
 slow installation vertix
 
CSAD_API MeshsetVector (unsigned int i, double *v)
 slow installation vertix
 
CSAD_API MeshsetVertexCount (unsigned int count)
 Sets the number of elements vertex buffer, the previous value of vertices is not saved.
 
template<typename T >
_FORCEINLINE LinkArray< T > texture0 ()
 An array of texture coordinates.
 
template<typename T >
_FORCEINLINE LinkArray< T > texture1 ()
 An array of texture coordinates.
 
_FORCEINLINE void update ()
 the next drawing geometry updated on the device
 
_FORCEINLINE void updateVertex ()
 the next drawing vertex geometry updated on the device
 
template<typename T >
_FORCEINLINE LinkArray< T > vector ()
 The array of vertices positions.
 
template<typename T >
_FORCEINLINE LinkArray< T > vertex ()
 The array of vertices.
 

Static Public Attributes

static CSAD_API MeshCube
 Геометрия куба
 
static CSAD_API MeshQuad
 Геометрия квадрата
 

Friends

class gen::ModellerMesh
 

Detailed Description

Mesh - geometric container sets vertex model object. Tops in its composition can have the following characteristics: position, color, vector front, texture coordinates.

See Also
csad: scene MeshFilter StaticMesh VBOMesh

Member Enumeration Documentation

the format of building geometry.

Enumerator
_GL_POINTS 

вершина интерпретируется как отдельная точка.

_GL_LINES 

пара вершин интерпретируются как линия.

_GL_LINE_LOOP 

каждая вершина участвует в построении замкнутой линейной фигуры.

_GL_LINE_STRIP 

каждая вершина участвует в построении не замкнутой линейной фигуры.

_GL_TRIANGLES 

каждые три вершины задают треугольник.

_GL_TRIANGLE_STRIP 

треугольник производится из двух предыдущий вершин и текущей.

_GL_TRIANGLE_FAN 

каждая вершина строит треугольник к предыдущей грани треугольника или первой пары вершин, все треугольники имеют общую первую вершину.

_GL_QUADS 

каждые четыре вершины задают пару смежных треугольников.

_GL_POLYGON 

замкнутый полигон разделяется индексами -1.

_GL_INDEX_BYTE 

glIndexSize

_GL_NEED_INDEX_UPDATE 

буфер индекса требует обновления на устройстве

_GL_NEED_ELEMENT_UPDATE 

буфер вершин требует обновления на устройстве

the types of fields of geometry

Enumerator
_TGL_V2F 

two-dimensional coordinates single-precision

_TGL_V3F 

three-dimensional coordinates of single-precision

_TGL_V2D 

two-dimensional double-precision coordinates

_TGL_V3D 

three-dimensional double-precision coordinates

_TGL_N3F 

three-dimensional normal single-precision

_TGL_0T1F 

coordinate single precision first layer by odnomernoi textures

_TGL_0T2F 

coordinate single precision first layer of two-dimensional texture

_TGL_C3F 

цвет RGB.

_TGL_C4F 

цвет RGBA.

field vertex geometry.

Enumerator
_TEXTURE0 

field texture coordinates of the first layer

_TEXTURE1 

field texture coordinates of the second layer

_TEXTURE2 

field texture coordinates of the third layer

_COLOR 

color box

_NORMAL 

field surface

_VECTOR 

field of coordinatearea

Member Function Documentation

CSAD_API unsigned int csad::Mesh::getTexType ( int  id)

The field type of texture coordinates, if the field is missing returns 0.

Parameters
id- индекс слоя текстурных координат.
Returns
_TGL_0T1F, _TGL_0T2F, _TGL_0T3F, _TGL_0T4F.
CSAD_API unsigned int csad::Mesh::getVectorType ( )

The type of the field of coordinate geometry, if the field is missing returns 0.

Returns
_TGL_V2F, _TGL_V3F, _TGL_V4F, _TGL_V2D, _TGL_V3D, _TGL_V4D.