ackb2d 0.9
3D Gamestudio Box 2d Wraper

b2Shape.h File Reference

Go to the source code of this file.

Functions

void b2Shape_Destroy (b2Shape *shape)
 Call shape destructor.
b2Shapeb2Shape_Clone (b2Shape *shape, b2BlockAllocator *allocator)
 Clone the concrete shape using the provided allocator.
var b2Shape_GetType (b2Shape *shape)
 Get the type of this shape. You can use this to down cast to the concrete shape.
var b2Shape_TestPoint (b2Shape *shape, const b2Transform *xf, const VECTOR *p)
 Test a point for containment in this shape.
var b2Shape_RayCast (b2Shape *shape, b2RayCastOutput *output, const b2RayCastInput *input, const b2Transform *transform)
 Cast a ray against this shape.
void b2Shape_ComputeAABB (b2Shape *shape, b2AABB *aabb, const b2Transform *xf)
 Given a transform, compute the associated axis aligned bounding box for this shape.
void b2Shape_ComputeMass (b2Shape *shape, b2MassData *massData, var density)
 Compute the mass properties of this shape using its dimensions and density.
void b2Shape_SetType (b2Shape *shape, var type)
 Set type.
void b2Shape_SetRadius (b2Shape *shape, var radius)
 Set shape radius.
var b2Shape_GetRadius (b2Shape *shape)
 Get shape radius.

Function Documentation

b2Shape* b2Shape_Clone ( b2Shape shape,
b2BlockAllocator allocator 
)

Clone the concrete shape using the provided allocator.

Parameters:
shapeb2Shape instance to be manipulated.
allocatorb2Allocator instance.
Returns:
A new b2Shape instance cloned from the first.
void b2Shape_ComputeAABB ( b2Shape shape,
b2AABB aabb,
const b2Transform xf 
)

Given a transform, compute the associated axis aligned bounding box for this shape.

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

Compute the mass properties of this shape using its dimensions and density.

The inertia tensor is computed about the local origin.

Parameters:
shapeThe b2Shape instance.
massDatareturns the mass data for this shape.
densitythe density in kilograms per meter squared.
void b2Shape_Destroy ( b2Shape shape)

Call shape destructor.

Release the memory occupied by the b2Shape instance b2CircleShape ou b2PolygonShape

Parameters:
shapeb2Shape instance to be released.
var b2Shape_GetRadius ( b2Shape shape)

Get shape radius.

Parameters:
shapeThe shape.
Returns:
The shape radius.
var b2Shape_GetType ( b2Shape shape)

Get the type of this shape. You can use this to down cast to the concrete shape.

Get shape type.

Parameters:
shapeb2Shape instance.
Returns:
the shape type.
Parameters:
shapeThe shape.
Returns:
The shape type
  • E_UNKNOWN
  • E_CIRCLE
  • E_POLYGON
  • E_TYPECOUNT
var b2Shape_RayCast ( b2Shape shape,
b2RayCastOutput output,
const b2RayCastInput input,
const b2Transform transform 
)

Cast a ray against this shape.

Parameters:
shapeThe b2Shape instance.
outputThe ray-cast results.
inputThe ray-cast input parameters.
transformThe transform to be applied to the shape.
void b2Shape_SetRadius ( b2Shape shape,
var  radius 
)

Set shape radius.

Parameters:
shapeThe shape.
radiusThe new radius.
void b2Shape_SetType ( b2Shape shape,
var  type 
)

Set type.

Set the b2Shape type.

Parameters:
shapeThe shape.
typeThe new type.
var b2Shape_TestPoint ( b2Shape shape,
const b2Transform xf,
const VECTOR *  p 
)

Test a point for containment in this shape.

This only works for convex shapes.

Parameters:
shapeb2Shape instance.
xfthe shape world transform.
pa point in world coordinates.
 All Data Structures Files Functions Variables Typedefs Defines