Go to the source code of this file.
Functions |
void | b2Shape_Destroy (b2Shape *shape) |
| Call shape destructor.
|
b2Shape * | b2Shape_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
Clone the concrete shape using the provided allocator.
- Parameters:
-
shape | b2Shape instance to be manipulated. |
allocator | b2Allocator instance. |
- Returns:
- A new b2Shape instance cloned from the first.
Given a transform, compute the associated axis aligned bounding box for this shape.
- Parameters:
-
shape | The b2Shape instance. |
aabb | returns the axis aligned box. |
xf | the world transform of the shape. |
Compute the mass properties of this shape using its dimensions and density.
The inertia tensor is computed about the local origin.
- Parameters:
-
shape | The b2Shape instance. |
massData | returns the mass data for this shape. |
density | the density in kilograms per meter squared. |
void b2Shape_Destroy |
( |
b2Shape * |
shape | ) |
|
var b2Shape_GetRadius |
( |
b2Shape * |
shape | ) |
|
Get shape radius.
- Parameters:
-
- 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:
-
- Returns:
- the shape type.
- Parameters:
-
- Returns:
- The shape type
- E_UNKNOWN
- E_CIRCLE
- E_POLYGON
- E_TYPECOUNT
Cast a ray against this shape.
- Parameters:
-
shape | The b2Shape instance. |
output | The ray-cast results. |
input | The ray-cast input parameters. |
transform | The transform to be applied to the shape. |
void b2Shape_SetRadius |
( |
b2Shape * |
shape, |
|
|
var |
radius |
|
) |
| |
Set shape radius.
- Parameters:
-
shape | The shape. |
radius | The new radius. |
void b2Shape_SetType |
( |
b2Shape * |
shape, |
|
|
var |
type |
|
) |
| |
Set type.
Set the b2Shape type.
- Parameters:
-
shape | The shape. |
type | The new type. |
Test a point for containment in this shape.
This only works for convex shapes.
- Parameters:
-
shape | b2Shape instance. |
xf | the shape world transform. |
p | a point in world coordinates. |