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

Create a physical shape(box, sphere, cylinder, capsule, convexhull, mesh and heightfield) More...

Inherits Ref.

Public Member Functions

virtual ShapeType getShapeType () const
 get shape type
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static Physics3DShapecreateBox (const cocos2d::Vec3 &extent)
 create box shape The extent of sphere.
 
local createBox ( local extent)
 create box shape The extent of sphere.
 
static Physics3DShapecreateSphere (float radius)
 create sphere shape The radius of sphere.
 
local createSphere ( local radius)
 create sphere shape The radius of sphere.
 
static Physics3DShapecreateCylinder (float radius, float height)
 create cylinder shape The radius of cylinder. More...
 
static Physics3DShapecreateCapsule (float radius, float height)
 create capsule shape The radius of casule. More...
 
static Physics3DShapecreateConvexHull (const cocos2d::Vec3 *points, int numPoints)
 create convex hull The vertices of convex hull The number of vertices.
 
local createConvexHull ( local points, local numPoints)
 create convex hull The vertices of convex hull The number of vertices.
 
static Physics3DShapecreateMesh (const cocos2d::Vec3 *triangles, int numTriangles)
 create mesh The pointer of triangle list The number of triangles.
 
local createMesh ( local triangles, local numTriangles)
 create mesh The pointer of triangle list The number of triangles.
 
static Physics3DShapecreateHeightfield (int heightStickWidth, int heightStickLength, const void *heightfieldData, float heightScale, float minHeight, float maxHeight, bool useFloatDatam, bool flipQuadEdges, bool useDiamondSubdivision=false)
 create heightfield The Width of heightfield The Length of heightfield. More...
 
var createHeightfield ( var heightStickWidth, var heightStickLength, var heightfieldData, var heightScale, var minHeight, var maxHeight, var useFloatDatam, var flipQuadEdges, var false)
 create heightfield The Width of heightfield The Length of heightfield. More...
 
local createHeightfield ( local heightStickWidth, local heightStickLength, local heightfieldData, local heightScale, local minHeight, local maxHeight, local useFloatDatam, local flipQuadEdges, local false)
 create heightfield The Width of heightfield The Length of heightfield. More...
 
static Physics3DShapecreateCompoundShape (const std::vector< std::pair< Physics3DShape *, Mat4 >> &shapes)
 create Compound Shape The list of child shape
 
local createCompoundShape ( local shapes)
 create Compound Shape The list of child shape
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Create a physical shape(box, sphere, cylinder, capsule, convexhull, mesh and heightfield)

Member Function Documentation

static Physics3DShape*
createCylinder
( float  radius,
float  height 
)
static

create cylinder shape The radius of cylinder.

The height.

var createCylinder ( var  radius,
var  height 
)
static

create cylinder shape The radius of cylinder.

The height.

local createCylinder ( local  radius,
local  height 
)
static

create cylinder shape The radius of cylinder.

The height.

static Physics3DShape*
createCapsule
( float  radius,
float  height 
)
static

create capsule shape The radius of casule.

The height (cylinder part).

var createCapsule ( var  radius,
var  height 
)
static

create capsule shape The radius of casule.

The height (cylinder part).

local createCapsule ( local  radius,
local  height 
)
static

create capsule shape The radius of casule.

The height (cylinder part).

static Physics3DShape*
createHeightfield
( int  heightStickWidth,
int  heightStickLength,
const void *  heightfieldData,
float  heightScale,
float  minHeight,
float  maxHeight,
bool  useFloatDatam,
bool  flipQuadEdges,
bool  useDiamondSubdivision = false 
)
static

create heightfield The Width of heightfield The Length of heightfield.

The Data of heightfield. heightScale。. The minHeight of heightfield. The maxHeight of heightfield. useFloatDatam if flip QuadEdges useDiamondSubdivision

var createHeightfield ( var  heightStickWidth,
var  heightStickLength,
var  heightfieldData,
var  heightScale,
var  minHeight,
var  maxHeight,
var  useFloatDatam,
var  flipQuadEdges,
var  useDiamondSubdivision = false 
)
static

create heightfield The Width of heightfield The Length of heightfield.

The Data of heightfield. heightScale。. The minHeight of heightfield. The maxHeight of heightfield. useFloatDatam if flip QuadEdges useDiamondSubdivision

local createHeightfield ( local  heightStickWidth,
local  heightStickLength,
local  heightfieldData,
local  heightScale,
local  minHeight,
local  maxHeight,
local  useFloatDatam,
local  flipQuadEdges,
local  useDiamondSubdivision = false 
)
static

create heightfield The Width of heightfield The Length of heightfield.

The Data of heightfield. heightScale。. The minHeight of heightfield. The maxHeight of heightfield. useFloatDatam if flip QuadEdges useDiamondSubdivision


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