cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Mesh Class Reference

Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on. More...

#include <CCMesh.h>

Inheritance diagram for Mesh:
Ref

Public Types

typedef std::vector< unsigned
short > 
IndexArray

Public Member Functions

GLuint getVertexBuffer () const
 get vertex buffer More...
 
var getVertexBuffer ()
 get vertex buffer More...
 
local getVertexBuffer ()
 get vertex buffer More...
 
bool hasVertexAttrib (int attrib) const
 has vertex attribute? More...
 
ssize_t getMeshVertexAttribCount () const
 get mesh vertex attribute count More...
 
var getMeshVertexAttribCount ()
 get mesh vertex attribute count More...
 
local getMeshVertexAttribCount ()
 get mesh vertex attribute count More...
 
const MeshVertexAttribgetMeshVertexAttribute (int idx)
 get MeshVertexAttribute by index More...
 
local getMeshVertexAttribute ( local idx)
 get MeshVertexAttribute by index More...
 
int getVertexSizeInBytes () const
 get per vertex size in bytes More...
 
var getVertexSizeInBytes ()
 get per vertex size in bytes More...
 
local getVertexSizeInBytes ()
 get per vertex size in bytes More...
 
void setTexture (const std::string &texPath)
 texture getter and setter More...
 
var setTexture ( var texPath)
 texture getter and setter More...
 
local setTexture ( local texPath)
 texture getter and setter More...
 
void setTexture (Texture2D *tex)
var setTexture ( var tex)
local setTexture ( local tex)
Texture2DgetTexture () const
var getTexture ()
local getTexture ()
void setVisible (bool visible)
 visible getter and setter More...
 
var setVisible ( var visible)
 visible getter and setter More...
 
local setVisible ( local visible)
 visible getter and setter More...
 
bool isVisible () const
var isVisible ()
local isVisible ()
MeshSkingetSkin () const
 skin getter More...
 
local getSkin ()
 skin getter More...
 
MeshIndexDatagetMeshIndexData () const
 mesh index data getter More...
 
local getMeshIndexData ()
 mesh index data getter More...
 
GLProgramStategetGLProgramState () const
 get GLProgramState More...
 
var getGLProgramState ()
 get GLProgramState More...
 
local getGLProgramState ()
 get GLProgramState More...
 
const std::string & getName () const
 name getter More...
 
var getName ()
 name getter More...
 
local getName ()
 name getter More...
 
void setBlendFunc (const BlendFunc &blendFunc)
var setBlendFunc ( var blendFunc)
local setBlendFunc ( local blendFunc)
const BlendFuncgetBlendFunc () const
var getBlendFunc ()
local getBlendFunc ()
GLenum getPrimitiveType () const
 get primitive type More...
 
local getPrimitiveType ()
 get primitive type More...
 
ssize_t getIndexCount () const
 get index count More...
 
var getIndexCount ()
 get index count More...
 
local getIndexCount ()
 get index count More...
 
GLenum getIndexFormat () const
 get index format More...
 
var getIndexFormat ()
 get index format More...
 
local getIndexFormat ()
 get index format More...
 
GLuint getIndexBuffer () const
 get index buffer More...
 
var getIndexBuffer ()
 get index buffer More...
 
local getIndexBuffer ()
 get index buffer More...
 
const AABBgetAABB () const
 get AABB More...
 
local getAABB ()
 get AABB More...
 
virtual ~Mesh ()
var ~Mesh ()
local ~Mesh ()
GLProgramgetDefaultGLProgram (bool textured)
local getDefaultGLProgram ( local textured)
void setGLProgramState (GLProgramState *glProgramState)
var setGLProgramState ( var glProgramState)
local setGLProgramState ( local glProgramState)
MeshCommandgetMeshCommand ()
void setSkin (MeshSkin *skin)
 skin setter More...
 
var setSkin ( var skin)
 skin setter More...
 
local setSkin ( local skin)
 skin setter More...
 
void setMeshIndexData (MeshIndexData *indexdata)
 Mesh index data setter. More...
 
var setMeshIndexData ( var indexdata)
 Mesh index data setter. More...
 
local setMeshIndexData ( local indexdata)
 Mesh index data setter. More...
 
void setName (const std::string &name)
 name setter More...
 
local setName ( local name)
 name setter More...
 
void calcuateAABB ()
var calcuateAABB ()
local calcuateAABB ()
void bindMeshCommand ()
var bindMeshCommand ()
local bindMeshCommand ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Static Public Member Functions

static Meshcreate (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const IndexArray &indices)
 create mesh from positions, normals, and so on, sigle SubMesh More...
 
local create ( local positions, local normals, local texs, local indices)
 create mesh from positions, normals, and so on, sigle SubMesh More...
 
static Meshcreate (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, int numIndex, const std::vector< MeshVertexAttrib > &attribs, int attribCount)
 create mesh with vertex attributes More...
 
local create ( local vertices, local perVertexSizeInFloat, local indices, local numIndex, local attribs, local attribCount)
 create mesh with vertex attributes More...
 
static Meshcreate (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, const std::vector< MeshVertexAttrib > &attribs)
var create ( var vertices, var perVertexSizeInFloat, var indices, var attribs)
local create ( local vertices, local perVertexSizeInFloat, local indices, local attribs)
static Meshcreate (const std::string &name, MeshIndexData *indexData, MeshSkin *skin=nullptr)
 create mesh More...
 

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: Mesh()

Protected Attributes

Texture2D_texture
MeshSkin_skin
var _skin
local _skin
bool _visible
var _visible
local _visible
bool _isTransparent
var _isTransparent
local _isTransparent
std::string _name
var _name
local _name
MeshIndexData_meshIndexData
var _meshIndexData
local _meshIndexData
GLProgramState_glProgramState
var _glProgramState
local _glProgramState
MeshCommand _meshCommand
var _meshCommand
local _meshCommand
BlendFunc _blend
var _blend
local _blend
AABB _aabb
var _aabb
local _aabb
std::function< void()> _visibleChanged
var _visibleChanged
local _visibleChanged
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Friends

class Sprite3D

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Detailed Description

Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on.

Member Typedef Documentation

typedef std::vector<unsigned
short> IndexArray
local IndexArray

Constructor & Destructor Documentation

virtual ~Mesh ( )
virtual
var ~Mesh ( )
virtual
local ~Mesh ( )
virtual

Member Function Documentation

void bindMeshCommand ( )
var bindMeshCommand ( )
local bindMeshCommand ( )
void calcuateAABB ( )
var calcuateAABB ( )
local calcuateAABB ( )
static Mesh* create ( const std::vector< float > &  positions,
const std::vector< float > &  normals,
const std::vector< float > &  texs,
const IndexArray indices 
)
static

create mesh from positions, normals, and so on, sigle SubMesh

var create ( var  positions,
var  normals,
var  texs,
var  indices 
)
static

create mesh from positions, normals, and so on, sigle SubMesh

local create ( local  positions,
local  normals,
local  texs,
local  indices 
)
static

create mesh from positions, normals, and so on, sigle SubMesh

static Mesh* create ( const std::vector< float > &  vertices,
int  perVertexSizeInFloat,
const IndexArray indices,
int  numIndex,
const std::vector< MeshVertexAttrib > &  attribs,
int  attribCount 
)
inlinestatic

create mesh with vertex attributes

var create ( var  vertices,
var  perVertexSizeInFloat,
var  indices,
var  numIndex,
var  attribs,
var  attribCount 
)
inlinestatic

create mesh with vertex attributes

local create ( local  vertices,
local  perVertexSizeInFloat,
local  indices,
local  numIndex,
local  attribs,
local  attribCount 
)
inlinestatic

create mesh with vertex attributes

static Mesh* create ( const std::vector< float > &  vertices,
int  perVertexSizeInFloat,
const IndexArray indices,
const std::vector< MeshVertexAttrib > &  attribs 
)
static
var create ( var  vertices,
var  perVertexSizeInFloat,
var  indices,
var  attribs 
)
static
local create ( local  vertices,
local  perVertexSizeInFloat,
local  indices,
local  attribs 
)
static
static Mesh* create ( const std::string &  name,
MeshIndexData indexData,
MeshSkin skin = nullptr 
)
static

create mesh

var create ( var  name,
var  indexData,
var  skin = nullptr 
)
static

create mesh

local create ( local  name,
local  indexData,
local  skin = nullptr 
)
static

create mesh

const AABB& getAABB ( ) const
inline

get AABB

var getAABB ( )
inline

get AABB

local getAABB ( )
inline

get AABB

const BlendFunc& getBlendFunc ( ) const
var getBlendFunc ( )
local getBlendFunc ( )
GLProgram* getDefaultGLProgram ( bool  textured)
var getDefaultGLProgram ( var  textured)
local getDefaultGLProgram ( local  textured)
GLProgramState* getGLProgramState ( ) const
inline
var getGLProgramState ( )
inline
local getGLProgramState ( )
inline
GLuint getIndexBuffer ( ) const

get index buffer

var getIndexBuffer ( )

get index buffer

local getIndexBuffer ( )

get index buffer

ssize_t getIndexCount ( ) const

get index count

var getIndexCount ( )

get index count

local getIndexCount ( )

get index count

GLenum getIndexFormat ( ) const

get index format

var getIndexFormat ( )

get index format

local getIndexFormat ( )

get index format

MeshCommand& getMeshCommand ( )
inline
var getMeshCommand ( )
inline
local getMeshCommand ( )
inline
MeshIndexData* getMeshIndexData ( ) const
inline

mesh index data getter

var getMeshIndexData ( )
inline

mesh index data getter

local getMeshIndexData ( )
inline

mesh index data getter

ssize_t getMeshVertexAttribCount ( ) const

get mesh vertex attribute count

var getMeshVertexAttribCount ( )

get mesh vertex attribute count

local getMeshVertexAttribCount ( )

get mesh vertex attribute count

const MeshVertexAttrib&
getMeshVertexAttribute
( int  idx)

get MeshVertexAttribute by index

var getMeshVertexAttribute ( var  idx)

get MeshVertexAttribute by index

local getMeshVertexAttribute ( local  idx)

get MeshVertexAttribute by index

const std::string& getName ( ) const
inline

name getter

var getName ( )
inline

name getter

local getName ( )
inline

name getter

GLenum getPrimitiveType ( ) const

get primitive type

var getPrimitiveType ( )

get primitive type

local getPrimitiveType ( )

get primitive type

MeshSkin* getSkin ( ) const
inline

skin getter

var getSkin ( )
inline

skin getter

local getSkin ( )
inline

skin getter

Texture2D* getTexture ( ) const
inline
var getTexture ( )
inline
local getTexture ( )
inline
GLuint getVertexBuffer ( ) const

get vertex buffer

var getVertexBuffer ( )

get vertex buffer

local getVertexBuffer ( )

get vertex buffer

int getVertexSizeInBytes ( ) const

get per vertex size in bytes

var getVertexSizeInBytes ( )

get per vertex size in bytes

local getVertexSizeInBytes ( )

get per vertex size in bytes

bool hasVertexAttrib ( int  attrib) const

has vertex attribute?

var hasVertexAttrib ( var  attrib)

has vertex attribute?

local hasVertexAttrib ( local  attrib)

has vertex attribute?

bool isVisible ( ) const
inline
var isVisible ( )
inline
local isVisible ( )
inline
void setBlendFunc ( const BlendFunc blendFunc)
var setBlendFunc ( var  blendFunc)
local setBlendFunc ( local  blendFunc)
void setGLProgramState ( GLProgramState glProgramState)
var setGLProgramState ( var  glProgramState)
local setGLProgramState ( local  glProgramState)
void setMeshIndexData ( MeshIndexData indexdata)

Mesh index data setter.

var setMeshIndexData ( var  indexdata)

Mesh index data setter.

local setMeshIndexData ( local  indexdata)

Mesh index data setter.

void setName ( const std::string &  name)
inline

name setter

var setName ( var  name)
inline

name setter

local setName ( local  name)
inline

name setter

void setSkin ( MeshSkin skin)

skin setter

var setSkin ( var  skin)

skin setter

local setSkin ( local  skin)

skin setter

void setTexture ( const std::string &  texPath)

texture getter and setter

var setTexture ( var  texPath)

texture getter and setter

local setTexture ( local  texPath)

texture getter and setter

void setTexture ( Texture2D tex)
var setTexture ( var  tex)
local setTexture ( local  tex)
void setVisible ( bool  visible)

visible getter and setter

var setVisible ( var  visible)

visible getter and setter

local setVisible ( local  visible)

visible getter and setter

Friends And Related Function Documentation

friend class Sprite3D
friend
var Sprite3D
friend
local Sprite3D
friend

Member Data Documentation

AABB _aabb
protected
var _aabb
protected
local _aabb
protected
BlendFunc _blend
protected
var _blend
protected
local _blend
protected
GLProgramState* _glProgramState
protected
var _glProgramState
protected
local _glProgramState
protected
bool _isTransparent
protected
var _isTransparent
protected
local _isTransparent
protected
MeshCommand _meshCommand
protected
var _meshCommand
protected
local _meshCommand
protected
MeshIndexData* _meshIndexData
protected
var _meshIndexData
protected
local _meshIndexData
protected
std::string _name
protected
var _name
protected
local _name
protected
MeshSkin* _skin
protected
var _skin
protected
local _skin
protected
Texture2D* _texture
protected
var _texture
protected
local _texture
protected
bool _visible
protected
var _visible
protected
local _visible
protected
std::function<void()>
_visibleChanged
protected
var _visibleChanged
protected
local _visibleChanged
protected

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