Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Bundle3D Class Reference

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

Public Member Functions

virtual void clear ()
 Clear the Bundle3D object's buffer.
 
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 animation data from bundle The ID of the animation, load the first animation in the bundle if it is empty The Animation3DData which you need. More...
 

Static Public Member Functions

static Bundle3DcreateBundle ()
 Create a new bundle, destroy it when finish using it The Bundle3D object.
 
static void destroyBundle (Bundle3D *bundle)
 Destroy the specified Bundle3D object.
 
static std::vector< Vec3getTrianglesList (const std::string &path)
 Load triangle list The file path to load. More...
 
static bool loadObj (MeshDatas &meshdatas, MaterialDatas &materialdatas, NodeDatas &nodedatas, const std::string &fullPath, const char *mtl_basepath=nullptr)
 Load .obj format. More...
 
static AABB calculateAABB (const std::vector< float > &vertex, int stride, const std::vector< unsigned short > &index)
 Calculate the AABB. More...
 

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

Member Function Documentation

virtual bool load ( const std::string &  path)
virtual

Load a file.

You must load a file first, then call loadMeshData, loadSkinData, and so on File to be loaded result of load

virtual bool loadSkinData ( const std::string &  id,
SkinData skindata 
)
virtual

load skin data from bundle.

The ID of the skin, load the first Skin in the bundle if it is empty. the SkinData which you need. Result of the load.

virtual bool loadAnimationData ( const std::string &  id,
Animation3DData animationdata 
)
virtual

Load animation data from bundle The ID of the animation, load the first animation in the bundle if it is empty The Animation3DData which you need.

Result of the load

static std::vector<Vec3>
getTrianglesList
( const std::string &  path)
static

Load triangle list The file path to load.

The std::vector which contatin triangles.

static bool loadObj ( MeshDatas meshdatas,
MaterialDatas materialdatas,
NodeDatas nodedatas,
const std::string &  fullPath,
const char *  mtl_basepath = nullptr 
)
static

Load .obj format.

The mesh datas. The materialdatas. The node data. The .obj file path. The material base path. The result of the load.

static AABB calculateAABB ( const std::vector< float > &  vertex,
int  stride,
const std::vector< unsigned short > &  index 
)
static

Calculate the AABB.

Vertices list. The stride of the element. The indices list.


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