PhysicsShape Class Reference

All shapes are defined as convex type. More...

List of all members.

Public Member Functions

 PhysicsShape ()
 Default Constructor.
 PhysicsShape (float radius)
 Sphere Constructor.
 PhysicsShape (Vector2 width)
 Box Constructor.
 PhysicsShape (Vector2[] pos, int num)
 Convex Constructor.
 PhysicsShape (Vector2[] pos, int num, bool flag)
 Chain of Line Segments Constructor.
 PhysicsShape (PhysicsShape con)
 PhysicsShape Copy Constructor.

Static Public Member Functions

static PhysicsShape CreateConvexHull (Vector2[] vertList, int num)
 create convex shape from random point

Public Attributes

int numVert
 number of points
Vector2[] vertList = new Vector2[30]
 list of points
uint hint
 hint for PhysicsShape

Properties

int NumVert [get, set]
 setter and getter of numVert
Vector2[] VertList [get, set]
 setter and getter of vertList
uint Hint [get, set]
 setter and getter of hint

Detailed Description

All shapes are defined as convex type.


Constructor & Destructor Documentation

PhysicsShape ( float  radius)

Sphere Constructor.

Parameters:
radiusradius of sphere
PhysicsShape ( Vector2  width)

Box Constructor.

Parameters:
widthhalf width of box

width param is half width of box

PhysicsShape ( Vector2[]  pos,
int  num 
)

Convex Constructor.

Parameters:
pospoint list for convex shape
numnum of point list for convex shape

the limitation of number of point list containd by convex shape is 30

PhysicsShape ( Vector2[]  pos,
int  num,
bool  flag 
)

Chain of Line Segments Constructor.

Parameters:
pospoint list for line shape
numnum of point list for convex shape
flagtrue should be given

the limitation of number of point list containd by convex shape is 30, and this is only for static rigid body

PhysicsShape Copy Constructor.

Parameters:
conshape of rigid body

Member Function Documentation

static PhysicsShape CreateConvexHull ( Vector2[]  vertList,
int  num 
) [static]

create convex shape from random point

Parameters:
vertListrandom point set
numnumber of random point set
Returns:
convex shape

Member Data Documentation

uint hint

hint for PhysicsShape

hint defines symmetry of PhysicsShape hint=1 means non symmetry, hint=2 means symmetry except for sphere and box, convex shape should define this property to accelarate the simulation when usr uses convex shape

Vector2 [] vertList = new Vector2[30]

list of points

assume maximum number of vertex = 30, numVert = 0 means sphere, this is the special case and the first x-coordinate of the point holds radius