cocos2d-x  3.3
 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

virtual void clear ()
local clear ()
virtual bool load (const std::string &path)
 load a file. More...
 
virtual bool loadSkinData (const std::string &id, SkinData *skindata)
 load skin data from bundle More...
 
virtual bool loadAnimationData (const std::string &id, Animation3DData *animationdata)
 load material data from bundle More...
 
var loadAnimationData ( var id, var animationdata)
 load material data from bundle More...
 
local loadAnimationData ( local id, local animationdata)
 load material data from bundle More...
 
virtual bool loadMeshDatas (MeshDatas &meshdatas)
var loadMeshDatas ( var meshdatas)
local loadMeshDatas ( local meshdatas)
virtual bool loadNodes (NodeDatas &nodedatas)
var loadNodes ( var nodedatas)
local loadNodes ( local nodedatas)
virtual bool loadMaterials (MaterialDatas &materialdatas)
local loadMaterials ( local materialdatas)

Static Public Member Functions

static void setBundleInstance (Bundle3D *bundleInstance)
 you can define yourself bundle and set it, use default bundle otherwise More...
 
var setBundleInstance ( var bundleInstance)
 you can define yourself bundle and set it, use default bundle otherwise More...
 
local setBundleInstance ( local bundleInstance)
 you can define yourself bundle and set it, use default bundle otherwise More...
 
static Bundle3DgetInstance ()
static void destroyInstance ()
var destroyInstance ()
local destroyInstance ()
static bool loadObj (MeshDatas &meshdatas, MaterialDatas &materialdatas, NodeDatas &nodedatas, const std::string &fullPath, const char *mtl_basepath=nullptr)
static AABB calculateAABB (const std::vector< float > &vertex, int stride, const std::vector< unsigned short > &index)
local calculateAABB ( local vertex, local stride, local index)

Protected Member Functions

bool loadJson (const std::string &path)
bool loadBinary (const std::string &path)
var loadBinary ( var path)
local loadBinary ( local path)
bool loadMeshDatasJson (MeshDatas &meshdatas)
var loadMeshDatasJson ( var meshdatas)
local loadMeshDatasJson ( local meshdatas)
bool loadMeshDataJson_0_1 (MeshDatas &meshdatas)
var loadMeshDataJson_0_1 ( var meshdatas)
local loadMeshDataJson_0_1 ( local meshdatas)
bool loadMeshDataJson_0_2 (MeshDatas &meshdatas)
var loadMeshDataJson_0_2 ( var meshdatas)
local loadMeshDataJson_0_2 ( local meshdatas)
bool loadMeshDatasBinary (MeshDatas &meshdatas)
var loadMeshDatasBinary ( var meshdatas)
local loadMeshDatasBinary ( local meshdatas)
bool loadMeshDatasBinary_0_1 (MeshDatas &meshdatas)
var loadMeshDatasBinary_0_1 ( var meshdatas)
local loadMeshDatasBinary_0_1 ( local meshdatas)
bool loadMeshDatasBinary_0_2 (MeshDatas &meshdatas)
var loadMeshDatasBinary_0_2 ( var meshdatas)
local loadMeshDatasBinary_0_2 ( local meshdatas)
bool loadMaterialsJson (MaterialDatas &materialdatas)
var loadMaterialsJson ( var materialdatas)
local loadMaterialsJson ( local materialdatas)
bool loadMaterialDataJson_0_1 (MaterialDatas &materialdatas)
var loadMaterialDataJson_0_1 ( var materialdatas)
local loadMaterialDataJson_0_1 ( local materialdatas)
bool loadMaterialDataJson_0_2 (MaterialDatas &materialdatas)
var loadMaterialDataJson_0_2 ( var materialdatas)
local loadMaterialDataJson_0_2 ( local materialdatas)
bool loadMaterialsBinary (MaterialDatas &materialdatas)
var loadMaterialsBinary ( var materialdatas)
local loadMaterialsBinary ( local materialdatas)
bool loadMaterialsBinary_0_1 (MaterialDatas &materialdatas)
var loadMaterialsBinary_0_1 ( var materialdatas)
local loadMaterialsBinary_0_1 ( local materialdatas)
bool loadMaterialsBinary_0_2 (MaterialDatas &materialdatas)
var loadMaterialsBinary_0_2 ( var materialdatas)
local loadMaterialsBinary_0_2 ( local materialdatas)
bool loadMeshDataJson (MeshData *meshdata)
var loadMeshDataJson ( var meshdata)
local loadMeshDataJson ( local meshdata)
bool loadMeshDataJson_0_1 (MeshData *meshdata)
var loadMeshDataJson_0_1 ( var meshdata)
local loadMeshDataJson_0_1 ( local meshdata)
bool loadMeshDataJson_0_2 (MeshData *meshdata)
var loadMeshDataJson_0_2 ( var meshdata)
local loadMeshDataJson_0_2 ( local meshdata)
bool loadSkinDataJson (SkinData *skindata)
var loadSkinDataJson ( var skindata)
local loadSkinDataJson ( local skindata)
bool loadSkinDataBinary (SkinData *skindata)
var loadSkinDataBinary ( var skindata)
local loadSkinDataBinary ( local skindata)
bool loadMaterialDataJson (MaterialData *materialdata)
var loadMaterialDataJson ( var materialdata)
local loadMaterialDataJson ( local materialdata)
bool loadMaterialDataJson_0_1 (MaterialData *materialdata)
var loadMaterialDataJson_0_1 ( var materialdata)
local loadMaterialDataJson_0_1 ( local materialdata)
bool loadMaterialDataJson_0_2 (MaterialData *materialdata)
var loadMaterialDataJson_0_2 ( var materialdata)
local loadMaterialDataJson_0_2 ( local materialdata)
bool loadAnimationDataJson (const std::string &id, Animation3DData *animationdata)
var loadAnimationDataJson ( var id, var animationdata)
local loadAnimationDataJson ( local id, local animationdata)
bool loadAnimationDataBinary (const std::string &id, Animation3DData *animationdata)
var loadAnimationDataBinary ( var id, var animationdata)
local loadAnimationDataBinary ( local id, local animationdata)
bool loadNodesJson (NodeDatas &nodedatas)
 load nodes of json More...
 
var loadNodesJson ( var nodedatas)
 load nodes of json More...
 
local loadNodesJson ( local nodedatas)
 load nodes of json More...
 
NodeDataparseNodesRecursivelyJson (const rapidjson::Value &jvalue)
bool loadNodesBinary (NodeDatas &nodedatas)
 load nodes of binary More...
 
var loadNodesBinary ( var nodedatas)
 load nodes of binary More...
 
local loadNodesBinary ( local nodedatas)
 load nodes of binary More...
 
NodeDataparseNodesRecursivelyBinary (bool &skeleton)
var parseNodesRecursivelyBinary ( var skeleton)
local parseNodesRecursivelyBinary ( local skeleton)
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...
 
NTextureData::Usage parseGLTextureType (const std::string &str)
 get define data type More...
 
var parseGLTextureType ( var str)
 get define data type More...
 
local parseGLTextureType ( local str)
 get define data type More...
 
unsigned int parseGLProgramAttribute (const std::string &str)
 get vertex attribute type More...
 
local parseGLProgramAttribute ( local str)
 get vertex attribute type More...
 
void getModelRelativePath (const std::string &path)
var getModelRelativePath ( var path)
local getModelRelativePath ( local path)
ReferenceseekToFirstType (unsigned int type, const std::string &id="")
var seekToFirstType ( var type)
local seekToFirstType ( local type)
virtual ~Bundle3D ()
var ~Bundle3D ()
local ~Bundle3D ()

Protected Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: Bundle3D()
std::string _modelPath
var _modelPath
local _modelPath
std::string _path
var _path
local _path
std::string _version
var _version
local _version
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
var _instance
local _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

virtual ~Bundle3D ( )
protectedvirtual
var ~Bundle3D ( )
protectedvirtual
local ~Bundle3D ( )
protectedvirtual

Member Function Documentation

static AABB calculateAABB ( const std::vector< float > &  vertex,
int  stride,
const std::vector< unsigned short > &  index 
)
static
var calculateAABB ( var  vertex,
var  stride,
var  index 
)
static
local calculateAABB ( local  vertex,
local  stride,
local  index 
)
static
virtual void clear ( )
virtual
var clear ( )
virtual
local clear ( )
virtual
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
virtual bool load ( const std::string &  path)
virtual

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)
virtual

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)
virtual

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
virtual bool loadAnimationData ( const std::string &  id,
Animation3DData animationdata 
)
virtual

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 
)
virtual

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 
)
virtual

load material data from bundle

Parameters
idThe ID of the animation, load the first animation in the bundle if it is empty
bool loadAnimationDataBinary ( const std::string &  id,
Animation3DData animationdata 
)
protected
var loadAnimationDataBinary ( var  id,
var  animationdata 
)
protected
local loadAnimationDataBinary ( local  id,
local  animationdata 
)
protected
bool loadAnimationDataJson ( const std::string &  id,
Animation3DData animationdata 
)
protected
var loadAnimationDataJson ( var  id,
var  animationdata 
)
protected
local loadAnimationDataJson ( local  id,
local  animationdata 
)
protected
bool loadBinary ( const std::string &  path)
protected
var loadBinary ( var  path)
protected
local loadBinary ( local  path)
protected
bool loadJson ( const std::string &  path)
protected
var loadJson ( var  path)
protected
local loadJson ( local  path)
protected
bool loadMaterialDataJson ( MaterialData materialdata)
inlineprotected
var loadMaterialDataJson ( var  materialdata)
inlineprotected
local loadMaterialDataJson ( local  materialdata)
inlineprotected
bool loadMaterialDataJson_0_1 ( MaterialDatas materialdatas)
protected
var loadMaterialDataJson_0_1 ( var  materialdatas)
protected
local loadMaterialDataJson_0_1 ( local  materialdatas)
protected
bool loadMaterialDataJson_0_1 ( MaterialData materialdata)
inlineprotected
var loadMaterialDataJson_0_1 ( var  materialdata)
inlineprotected
local loadMaterialDataJson_0_1 ( local  materialdata)
inlineprotected
bool loadMaterialDataJson_0_2 ( MaterialDatas materialdatas)
protected
var loadMaterialDataJson_0_2 ( var  materialdatas)
protected
local loadMaterialDataJson_0_2 ( local  materialdatas)
protected
bool loadMaterialDataJson_0_2 ( MaterialData materialdata)
inlineprotected
var loadMaterialDataJson_0_2 ( var  materialdata)
inlineprotected
local loadMaterialDataJson_0_2 ( local  materialdata)
inlineprotected
virtual bool loadMaterials ( MaterialDatas materialdatas)
virtual
var loadMaterials ( var  materialdatas)
virtual
local loadMaterials ( local  materialdatas)
virtual
bool loadMaterialsBinary ( MaterialDatas materialdatas)
protected
var loadMaterialsBinary ( var  materialdatas)
protected
local loadMaterialsBinary ( local  materialdatas)
protected
bool loadMaterialsBinary_0_1 ( MaterialDatas materialdatas)
protected
var loadMaterialsBinary_0_1 ( var  materialdatas)
protected
local loadMaterialsBinary_0_1 ( local  materialdatas)
protected
bool loadMaterialsBinary_0_2 ( MaterialDatas materialdatas)
protected
var loadMaterialsBinary_0_2 ( var  materialdatas)
protected
local loadMaterialsBinary_0_2 ( local  materialdatas)
protected
bool loadMaterialsJson ( MaterialDatas materialdatas)
protected
var loadMaterialsJson ( var  materialdatas)
protected
local loadMaterialsJson ( local  materialdatas)
protected
bool loadMeshDataJson ( MeshData meshdata)
inlineprotected
var loadMeshDataJson ( var  meshdata)
inlineprotected
local loadMeshDataJson ( local  meshdata)
inlineprotected
bool loadMeshDataJson_0_1 ( MeshDatas meshdatas)
protected
var loadMeshDataJson_0_1 ( var  meshdatas)
protected
local loadMeshDataJson_0_1 ( local  meshdatas)
protected
bool loadMeshDataJson_0_1 ( MeshData meshdata)
inlineprotected
var loadMeshDataJson_0_1 ( var  meshdata)
inlineprotected
local loadMeshDataJson_0_1 ( local  meshdata)
inlineprotected
bool loadMeshDataJson_0_2 ( MeshDatas meshdatas)
protected
var loadMeshDataJson_0_2 ( var  meshdatas)
protected
local loadMeshDataJson_0_2 ( local  meshdatas)
protected
bool loadMeshDataJson_0_2 ( MeshData meshdata)
inlineprotected
var loadMeshDataJson_0_2 ( var  meshdata)
inlineprotected
local loadMeshDataJson_0_2 ( local  meshdata)
inlineprotected
virtual bool loadMeshDatas ( MeshDatas meshdatas)
virtual
var loadMeshDatas ( var  meshdatas)
virtual
local loadMeshDatas ( local  meshdatas)
virtual
bool loadMeshDatasBinary ( MeshDatas meshdatas)
protected
var loadMeshDatasBinary ( var  meshdatas)
protected
local loadMeshDatasBinary ( local  meshdatas)
protected
bool loadMeshDatasBinary_0_1 ( MeshDatas meshdatas)
protected
var loadMeshDatasBinary_0_1 ( var  meshdatas)
protected
local loadMeshDatasBinary_0_1 ( local  meshdatas)
protected
bool loadMeshDatasBinary_0_2 ( MeshDatas meshdatas)
protected
var loadMeshDatasBinary_0_2 ( var  meshdatas)
protected
local loadMeshDatasBinary_0_2 ( local  meshdatas)
protected
bool loadMeshDatasJson ( MeshDatas meshdatas)
protected
var loadMeshDatasJson ( var  meshdatas)
protected
local loadMeshDatasJson ( local  meshdatas)
protected
virtual bool loadNodes ( NodeDatas nodedatas)
virtual
var loadNodes ( var  nodedatas)
virtual
local loadNodes ( local  nodedatas)
virtual
bool loadNodesBinary ( NodeDatas nodedatas)
protected

load nodes of binary

var loadNodesBinary ( var  nodedatas)
protected

load nodes of binary

local loadNodesBinary ( local  nodedatas)
protected

load nodes of binary

bool loadNodesJson ( NodeDatas nodedatas)
protected

load nodes of json

var loadNodesJson ( var  nodedatas)
protected

load nodes of json

local loadNodesJson ( local  nodedatas)
protected

load nodes of json

static bool loadObj ( MeshDatas meshdatas,
MaterialDatas materialdatas,
NodeDatas nodedatas,
const std::string &  fullPath,
const char *  mtl_basepath = nullptr 
)
static
var loadObj ( var  meshdatas,
var  materialdatas,
var  nodedatas,
var  fullPath,
var  mtl_basepath = nullptr 
)
static
local loadObj ( local  meshdatas,
local  materialdatas,
local  nodedatas,
local  fullPath,
local  mtl_basepath = nullptr 
)
static
virtual bool loadSkinData ( const std::string &  id,
SkinData skindata 
)
virtual

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 
)
virtual

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 
)
virtual

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
var loadSkinDataBinary ( var  skindata)
protected
local loadSkinDataBinary ( local  skindata)
protected
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
NTextureData::Usage
parseGLTextureType
( const std::string &  str)
protected

get define data type

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

get define data type

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

get define data 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
NodeData*
parseNodesRecursivelyBinary
( bool &  skeleton)
protected
var parseNodesRecursivelyBinary ( var  skeleton)
protected
local parseNodesRecursivelyBinary ( local  skeleton)
protected
NodeData* parseNodesRecursivelyJson ( const rapidjson::Value &  jvalue)
protected
var parseNodesRecursivelyJson ( var  jvalue)
protected
local parseNodesRecursivelyJson ( local  jvalue)
protected
Reference* seekToFirstType ( unsigned int  type,
const std::string &  id = "" 
)
protected
var seekToFirstType ( var  type,
var  id = "" 
)
protected
local seekToFirstType ( local  type,
local  id = "" 
)
protected
static void setBundleInstance ( Bundle3D bundleInstance)
static

you can define yourself bundle and set it, use default bundle otherwise

var setBundleInstance ( var  bundleInstance)
static

you can define yourself bundle and set it, use default bundle otherwise

local setBundleInstance ( local  bundleInstance)
static

you can define yourself bundle and set it, use default bundle otherwise

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
var _instance
staticprotected
local _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 _modelPath
protected
var _modelPath
protected
local _modelPath
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
std::string _version
protected
var _version
protected
local _version
protected

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