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

Defines a bundle file that contains a collection of assets. More...

#include <CCBundle3D.h>

Public Member Functions

void clear ()
var clear ()
local clear ()
bool load (const std::string &path)
 load a file. More...
 
var load ( var path)
 load a file. More...
 
local load ( local path)
 load a file. More...
 
bool loadMeshData (const std::string &id, MeshData *meshdata)
 load mesh data from bundle More...
 
bool loadSkinData (const std::string &id, SkinData *skindata)
 load skin data from bundle More...
 
var loadSkinData ( var id, var skindata)
 load skin data from bundle More...
 
local loadSkinData ( local id, local skindata)
 load skin data from bundle More...
 
bool loadMaterialData (const std::string &id, MaterialData *materialdata)
 load material data from bundle More...
 
var loadMaterialData ( var id, var materialdata)
 load material data from bundle More...
 
local loadMaterialData ( local id, local materialdata)
 load material data from bundle More...
 
bool loadAnimationData (const std::string &id, Animation3DData *animationdata)
 load material data from bundle More...
 

Static Public Member Functions

static Bundle3DgetInstance ()
local getInstance ()
static void destroyInstance ()
var destroyInstance ()
local destroyInstance ()

Protected Member Functions

bool loadJson (const std::string &path)
var loadJson ( var path)
local loadJson ( local path)
bool loadMeshDataJson (MeshData *meshdata)
bool loadSkinDataJson (SkinData *skindata)
var loadSkinDataJson ( var skindata)
local loadSkinDataJson ( local skindata)
bool loadMaterialDataJson (MaterialData *materialdata)
local loadMaterialDataJson ( local materialdata)
bool loadAnimationDataJson (Animation3DData *animationdata)
bool loadBinary (const std::string &path)
 load data in binary More...
 
var loadBinary ( var path)
 load data in binary More...
 
local loadBinary ( local path)
 load data in binary More...
 
bool loadMeshDataBinary (MeshData *meshdata)
 load mesh data in binary More...
 
var loadMeshDataBinary ( var meshdata)
 load mesh data in binary More...
 
local loadMeshDataBinary ( local meshdata)
 load mesh data in binary More...
 
bool loadSkinDataBinary (SkinData *skindata)
 load skin data in binary More...
 
var loadSkinDataBinary ( var skindata)
 load skin data in binary More...
 
local loadSkinDataBinary ( local skindata)
 load skin data in binary More...
 
bool loadMaterialDataBinary (MaterialData *materialdata)
 load material data in binary More...
 
local loadMaterialDataBinary ( local materialdata)
 load material data in binary More...
 
bool loadAnimationDataBinary (Animation3DData *animationdata)
 load animation data in binary More...
 
local loadAnimationDataBinary ( local animationdata)
 load animation data in binary More...
 
GLenum parseGLType (const std::string &str)
 get define data type More...
 
var parseGLType ( var str)
 get define data type More...
 
local parseGLType ( local str)
 get define data type More...
 
unsigned int parseGLProgramAttribute (const std::string &str)
 get vertex attribute type More...
 
void getModelRelativePath (const std::string &path)
var getModelRelativePath ( var path)
local getModelRelativePath ( local path)
ReferenceseekToFirstType (unsigned int type)
local seekToFirstType ( local type)
 ~Bundle3D ()
 ~Bundle3D ()

Protected Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: Bundle3D()
std::string _modelRelativePath
local _modelRelativePath
std::string _path
var _path
local _path
char * _jsonBuffer
var _jsonBuffer
local _jsonBuffer
rapidjson::Document _jsonReader
var _jsonReader
local _jsonReader
Data_binaryBuffer
var _binaryBuffer
local _binaryBuffer
BundleReader _binaryReader
var _binaryReader
local _binaryReader
unsigned int _referenceCount
var _referenceCount
local _referenceCount
Reference_references
var _references
local _references
bool _isBinary
var _isBinary
local _isBinary

Static Protected Attributes

static Bundle3D_instance

Detailed Description

Defines a bundle file that contains a collection of assets.

Mesh, Material, MeshSkin, Animation There are two types of bundle files, c3t and c3b. c3t text file c3b binary file

Constructor & Destructor Documentation

~Bundle3D ( )
protected
var ~Bundle3D ( )
protected
local ~Bundle3D ( )
protected

Member Function Documentation

void clear ( )
var clear ( )
local clear ( )
static void destroyInstance ( )
static
var destroyInstance ( )
static
local destroyInstance ( )
static
static Bundle3D* getInstance ( )
static
var getInstance ( )
static
local getInstance ( )
static
void getModelRelativePath ( const std::string &  path)
protected
var getModelRelativePath ( var  path)
protected
local getModelRelativePath ( local  path)
protected
bool load ( const std::string &  path)

load a file.

You must load a file first, then call loadMeshData, loadSkinData, and so on

Parameters
pathFile to be loaded
Returns
result of load
var load ( var  path)

load a file.

You must load a file first, then call loadMeshData, loadSkinData, and so on

Parameters
pathFile to be loaded
Returns
result of load
local load ( local  path)

load a file.

You must load a file first, then call loadMeshData, loadSkinData, and so on

Parameters
pathFile to be loaded
Returns
result of load
bool loadAnimationData ( const std::string &  id,
Animation3DData animationdata 
)

load material data from bundle

Parameters
idThe ID of the animation, load the first animation in the bundle if it is empty
var loadAnimationData ( var  id,
var  animationdata 
)

load material data from bundle

Parameters
idThe ID of the animation, load the first animation in the bundle if it is empty
local loadAnimationData ( local  id,
local  animationdata 
)

load material data from bundle

Parameters
idThe ID of the animation, load the first animation in the bundle if it is empty
bool loadAnimationDataBinary ( Animation3DData animationdata)
protected

load animation data in binary

Parameters
animationdataThe animation data pointer
var loadAnimationDataBinary ( var  animationdata)
protected

load animation data in binary

Parameters
animationdataThe animation data pointer
local loadAnimationDataBinary ( local  animationdata)
protected

load animation data in binary

Parameters
animationdataThe animation data pointer
bool loadAnimationDataJson ( Animation3DData animationdata)
protected
var loadAnimationDataJson ( var  animationdata)
protected
local loadAnimationDataJson ( local  animationdata)
protected
bool loadBinary ( const std::string &  path)
protected

load data in binary

Parameters
pathThe c3b file path
var loadBinary ( var  path)
protected

load data in binary

Parameters
pathThe c3b file path
local loadBinary ( local  path)
protected

load data in binary

Parameters
pathThe c3b file path
bool loadJson ( const std::string &  path)
protected
var loadJson ( var  path)
protected
local loadJson ( local  path)
protected
bool loadMaterialData ( const std::string &  id,
MaterialData materialdata 
)

load material data from bundle

Parameters
idThe ID of the material, load the first Material in the bundle if it is empty
var loadMaterialData ( var  id,
var  materialdata 
)

load material data from bundle

Parameters
idThe ID of the material, load the first Material in the bundle if it is empty
local loadMaterialData ( local  id,
local  materialdata 
)

load material data from bundle

Parameters
idThe ID of the material, load the first Material in the bundle if it is empty
bool loadMaterialDataBinary ( MaterialData materialdata)
protected

load material data in binary

Parameters
materialdataThe material pointer
var loadMaterialDataBinary ( var  materialdata)
protected

load material data in binary

Parameters
materialdataThe material pointer
local loadMaterialDataBinary ( local  materialdata)
protected

load material data in binary

Parameters
materialdataThe material pointer
bool loadMaterialDataJson ( MaterialData materialdata)
protected
var loadMaterialDataJson ( var  materialdata)
protected
local loadMaterialDataJson ( local  materialdata)
protected
bool loadMeshData ( const std::string &  id,
MeshData meshdata 
)

load mesh data from bundle

Parameters
idThe ID of the mesh, load the first Mesh in the bundle if it is empty
var loadMeshData ( var  id,
var  meshdata 
)

load mesh data from bundle

Parameters
idThe ID of the mesh, load the first Mesh in the bundle if it is empty
local loadMeshData ( local  id,
local  meshdata 
)

load mesh data from bundle

Parameters
idThe ID of the mesh, load the first Mesh in the bundle if it is empty
bool loadMeshDataBinary ( MeshData meshdata)
protected

load mesh data in binary

Parameters
meshdataThe mesh data pointer
var loadMeshDataBinary ( var  meshdata)
protected

load mesh data in binary

Parameters
meshdataThe mesh data pointer
local loadMeshDataBinary ( local  meshdata)
protected

load mesh data in binary

Parameters
meshdataThe mesh data pointer
bool loadMeshDataJson ( MeshData meshdata)
protected
var loadMeshDataJson ( var  meshdata)
protected
local loadMeshDataJson ( local  meshdata)
protected
bool loadSkinData ( const std::string &  id,
SkinData skindata 
)

load skin data from bundle

Parameters
idThe ID of the skin, load the first Skin in the bundle if it is empty
var loadSkinData ( var  id,
var  skindata 
)

load skin data from bundle

Parameters
idThe ID of the skin, load the first Skin in the bundle if it is empty
local loadSkinData ( local  id,
local  skindata 
)

load skin data from bundle

Parameters
idThe ID of the skin, load the first Skin in the bundle if it is empty
bool loadSkinDataBinary ( SkinData skindata)
protected

load skin data in binary

Parameters
skindataThe skin data pointer
var loadSkinDataBinary ( var  skindata)
protected

load skin data in binary

Parameters
skindataThe skin data pointer
local loadSkinDataBinary ( local  skindata)
protected

load skin data in binary

Parameters
skindataThe skin data pointer
bool loadSkinDataJson ( SkinData skindata)
protected
var loadSkinDataJson ( var  skindata)
protected
local loadSkinDataJson ( local  skindata)
protected
unsigned int
parseGLProgramAttribute
( const std::string &  str)
protected

get vertex attribute type

Parameters
strThe type in string
var parseGLProgramAttribute ( var  str)
protected

get vertex attribute type

Parameters
strThe type in string
local parseGLProgramAttribute ( local  str)
protected

get vertex attribute type

Parameters
strThe type in string
GLenum parseGLType ( const std::string &  str)
protected

get define data type

Parameters
strThe type in string
var parseGLType ( var  str)
protected

get define data type

Parameters
strThe type in string
local parseGLType ( local  str)
protected

get define data type

Parameters
strThe type in string
Reference* seekToFirstType ( unsigned int  type)
protected
var seekToFirstType ( var  type)
protected
local seekToFirstType ( local  type)
protected

Member Data Documentation

CC_CONSTRUCTOR_ACCESS __pad0__
protected
var __pad0__
protected
local __pad0__
protected
Data* _binaryBuffer
protected
var _binaryBuffer
protected
local _binaryBuffer
protected
BundleReader _binaryReader
protected
var _binaryReader
protected
local _binaryReader
protected
Bundle3D* _instance
staticprotected
bool _isBinary
protected
var _isBinary
protected
local _isBinary
protected
char* _jsonBuffer
protected
var _jsonBuffer
protected
local _jsonBuffer
protected
rapidjson::Document _jsonReader
protected
var _jsonReader
protected
local _jsonReader
protected
std::string _modelRelativePath
protected
var _modelRelativePath
protected
local _modelRelativePath
protected
std::string _path
protected
var _path
protected
local _path
protected
unsigned int _referenceCount
protected
var _referenceCount
protected
local _referenceCount
protected
Reference* _references
protected
var _references
protected
local _references
protected

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