ackb2d 0.9
3D Gamestudio Box 2d Wraper

b2CircleShape.h File Reference

Go to the source code of this file.

Defines

#define b2CircleShape_SetType(shape, type)   b2Shape_SetType(shape, type)
 Set type.
#define b2CircleShape_GetType(shape)   b2Shape_GetType(shape)
 Get shape type.
#define b2CircleShape_SetRadius(shape, radius)   b2Shape_SetRadius(shape, radius)
 Set shape radius.
#define b2CircleShape_GetRadius(shape)   b2Shape_GetRadius(shape)
 Get shape radius.

Functions

b2CircleShapeb2CircleShape_Create ()
 Create b2CircleShape.
void b2CircleShape_Destroy (b2CircleShape *shape)
 Destroy b2Circle shape.
b2Shapeb2CircleShape_Clone (b2CircleShape *shape, b2BlockAllocator *allocator)
 Clone a b2CircleShape.
var b2CircleShape_TestPoint (b2CircleShape *shape, const b2Transform *transform, const VECTOR *p)
 Test if a point is contained inside a shape.
var b2CircleShape_RayCast (b2CircleShape *shape, b2RayCastOutput *output, const b2RayCastInput *input, const b2Transform *transform)
 Perform a raycast test with a b2CircleShape.
void b2CircleShape_ComputeAABB (b2CircleShape *shape, b2AABB *aabb, const b2Transform *transform)
 Compute shape AABB.
void b2CircleShape_ComputeMass (b2CircleShape *shape, b2MassData *massData, var density)
 Compute shape mass.
var b2CircleShape_GetSupport (b2CircleShape *shape, const VECTOR *d)
 Get the supporting vertex index in the given direction.
void b2CircleShape_GetSupportVertex (b2CircleShape *shape, const VECTOR *d, VECTOR *outSupport)
 Get the supporting vertex in the given direction.
var b2CircleShape_GetVertexCount (b2CircleShape *shape)
 Get the vertex count.
void b2CircleShape_GetVertex (b2CircleShape *shape, var index, VECTOR *outVertex)
 Get a vertex by index. Used by b2Distance.
void b2CircleShape_SetPosition (b2CircleShape *shape, const VECTOR *position)
 Set Position.
void b2CircleShape_GetPosition (b2CircleShape *shape, VECTOR *outPosition)
 Get Position.

Define Documentation

#define b2CircleShape_GetRadius (   shape)    b2Shape_GetRadius(shape)

Get shape radius.

Parameters:
shapeThe shape.
Returns:
The shape radius.

Definition at line 125 of file b2CircleShape.h.

#define b2CircleShape_GetType (   shape)    b2Shape_GetType(shape)

Get shape type.

Parameters:
shapeThe shape.
Returns:
The shape type
  • E_UNKNOWN
  • E_CIRCLE
  • E_POLYGON
  • E_TYPECOUNT

Definition at line 113 of file b2CircleShape.h.

#define b2CircleShape_SetRadius (   shape,
  radius 
)    b2Shape_SetRadius(shape, radius)

Set shape radius.

Parameters:
shapeThe shape.
radiusThe new radius.

Definition at line 119 of file b2CircleShape.h.

#define b2CircleShape_SetType (   shape,
  type 
)    b2Shape_SetType(shape, type)

Set type.

Set the b2Shape type.

Parameters:
shapeThe shape.
typeThe new type.

Definition at line 103 of file b2CircleShape.h.


Function Documentation

b2Shape* b2CircleShape_Clone ( b2CircleShape shape,
b2BlockAllocator allocator 
)

Clone a b2CircleShape.

Implement b2Shape.

Parameters:
shapeThe shape instance to be cloned.
allocatorThe b2BlockAllocator to be used.
Returns:
b2Shape The clone shape.
void b2CircleShape_ComputeAABB ( b2CircleShape shape,
b2AABB aabb,
const b2Transform transform 
)

Compute shape AABB.

See also:
b2Shape_ComputeAABB
Parameters:
shapeThe b2Shape instance.
aabbreturns the axis aligned box.
xfthe world transform of the shape.
void b2CircleShape_ComputeMass ( b2CircleShape shape,
b2MassData massData,
var  density 
)

Compute shape mass.

The inertia tensor is computed about the local origin.

See also:
b2Shape_ComputeMass
Parameters:
shapeThe b2Shape instance.
massDatareturns the mass data for this shape.
densitythe density in kilograms per meter squared.
b2CircleShape* b2CircleShape_Create ( )

Create b2CircleShape.

Returns:
b2CircleShape instance.
void b2CircleShape_Destroy ( b2CircleShape shape)

Destroy b2Circle shape.

Parameters:
shapeThe shape instance to destroy. The instance becomes invalid.
void b2CircleShape_GetPosition ( b2CircleShape shape,
VECTOR *  outPosition 
)

Get Position.

Parameters:
shapeThe shape instance.
outPositionA pre-initialized vector to receive the position.
var b2CircleShape_GetSupport ( b2CircleShape shape,
const VECTOR *  d 
)

Get the supporting vertex index in the given direction.

Parameters:
shapeThe b2Shape instance.
dThe direction vector.
Returns:
The supporting vertex index.
void b2CircleShape_GetSupportVertex ( b2CircleShape shape,
const VECTOR *  d,
VECTOR *  outSupport 
)

Get the supporting vertex in the given direction.

Parameters:
shapeThe b2Shape instance.
dThe direction vector.
outSupportA pre-initialized VECTOR to receive the support vertex.
void b2CircleShape_GetVertex ( b2CircleShape shape,
var  index,
VECTOR *  outVertex 
)

Get a vertex by index. Used by b2Distance.

Parameters:
shapeThe b2Shape instance.
indexThe vertex index.
outVertexA pre-initialized VECTOR to receive the vertex position.
var b2CircleShape_GetVertexCount ( b2CircleShape shape)

Get the vertex count.

Parameters:
shapeThe shape index.
Returns:
The vertex count
var b2CircleShape_RayCast ( b2CircleShape shape,
b2RayCastOutput output,
const b2RayCastInput input,
const b2Transform transform 
)

Perform a raycast test with a b2CircleShape.

Implement b2Shape.

Parameters:
shapeThe shape instance.
outputA pre initialized b2RayCastOutput to receive the result.
inputThe raycast input parameters.
Returns:
1 if the raycast succeded, 0 otherwise.
void b2CircleShape_SetPosition ( b2CircleShape shape,
const VECTOR *  position 
)

Set Position.

Parameters:
shapeThe b2Shape instance.
positionThe desired position as a vector.
var b2CircleShape_TestPoint ( b2CircleShape shape,
const b2Transform transform,
const VECTOR *  p 
)

Test if a point is contained inside a shape.

Implement b2Shape.

Parameters:
shapeThe shape instance.
transformThe b2Transform to be used.
pThe point to be tested.
Returns:
1 if the point is contained in the shape, 0 otherwise.
 All Data Structures Files Functions Variables Typedefs Defines