ackb2d 0.9
3D Gamestudio Box 2d Wraper

b2PolygonShape.h File Reference

Go to the source code of this file.

Functions

b2PolygonShapeb2PolygonShape_Create ()
 Create b2PolygonShape.
void b2PolygonShape_Destroy (b2PolygonShape *shape)
 Destroy b2PolygonShape.
b2Shapeb2PolygonShape_Clone (b2PolygonShape *shape, b2BlockAllocator *allocator)
 Implement b2Shape.
void b2PolygonShape_Set (b2PolygonShape *shape, const VECTOR *vertices, var vertexCount)
void b2PolygonShape_SetAsBox1 (b2PolygonShape *shape, var hx, var hy)
void b2PolygonShape_SetAsBox2 (b2PolygonShape *shape, var hx, var hy, const VECTOR *center, var angle)
void b2PolygonShape_SetAsEdge (b2PolygonShape *shape, const VECTOR *v1, const VECTOR *v2)
 Set this as a single edge.
var b2PolygonShape_TestPoint (b2PolygonShape *shape, const b2Transform *transform, const VECTOR *p)
var b2PolygonShape_RayCast (b2PolygonShape *shape, b2RayCastOutput *output, const b2RayCastInput *input, const b2Transform *transform)
 Implement b2Shape.
void b2PolygonShape_ComputeAABB (b2PolygonShape *shape, b2AABB *aabb, const b2Transform *transform)
void b2PolygonShape_ComputeMass (b2PolygonShape *shape, b2MassData *massData, var density)
var b2PolygonShape_GetSupport (b2PolygonShape *shape, const VECTOR *d)
 Get the supporting vertex index in the given direction.
void b2PolygonShape_GetSupportVertex (b2PolygonShape *shape, const VECTOR *d, VECTOR *outSupport)
 Get the supporting vertex in the given direction.
var b2PolygonShape_GetVertexCount (b2PolygonShape *shape)
 Get the vertex count.
void b2PolygonShape_GetVertex (b2PolygonShape *shape, var index, VECTOR *outVertex)
 Get a vertex by index.
void b2PolygonShape_SetCentroid (b2PolygonShape *shape, const VECTOR *centroid)
 Set m_centroid property.
void b2PolygonShape_GetCentroid (b2PolygonShape *shape, VECTOR *outCentroid)
 Get m_centroid property.
void b2PolygonShape_SetVertex (b2PolygonShape *shape, const VECTOR *vertex, var index)
 Set vertex at index.
void b2PolygonShape_SetNormal (b2PolygonShape *shape, const VECTOR *normal, var index)
 Get vertex at index.
void b2PolygonShape_GetNormal (b2PolygonShape *shape, VECTOR *outNormal, var index)
 Get normal at index.

Function Documentation

b2Shape* b2PolygonShape_Clone ( b2PolygonShape shape,
b2BlockAllocator allocator 
)

Implement b2Shape.

void b2PolygonShape_ComputeAABB ( b2PolygonShape shape,
b2AABB aabb,
const b2Transform transform 
)
See also:
b2Shape::ComputeAABB
void b2PolygonShape_ComputeMass ( b2PolygonShape shape,
b2MassData massData,
var  density 
)
See also:
b2Shape::ComputeMass
b2PolygonShape* b2PolygonShape_Create ( )

Create b2PolygonShape.

void b2PolygonShape_Destroy ( b2PolygonShape shape)

Destroy b2PolygonShape.

void b2PolygonShape_GetCentroid ( b2PolygonShape shape,
VECTOR *  outCentroid 
)

Get m_centroid property.

void b2PolygonShape_GetNormal ( b2PolygonShape shape,
VECTOR *  outNormal,
var  index 
)

Get normal at index.

var b2PolygonShape_GetSupport ( b2PolygonShape shape,
const VECTOR *  d 
)

Get the supporting vertex index in the given direction.

void b2PolygonShape_GetSupportVertex ( b2PolygonShape shape,
const VECTOR *  d,
VECTOR *  outSupport 
)

Get the supporting vertex in the given direction.

void b2PolygonShape_GetVertex ( b2PolygonShape shape,
var  index,
VECTOR *  outVertex 
)

Get a vertex by index.

var b2PolygonShape_GetVertexCount ( b2PolygonShape shape)

Get the vertex count.

var b2PolygonShape_RayCast ( b2PolygonShape shape,
b2RayCastOutput output,
const b2RayCastInput input,
const b2Transform transform 
)

Implement b2Shape.

void b2PolygonShape_Set ( b2PolygonShape shape,
const VECTOR *  vertices,
var  vertexCount 
)

Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.

void b2PolygonShape_SetAsBox1 ( b2PolygonShape shape,
var  hx,
var  hy 
)

Build vertices to represent an axis-aligned box.

Parameters:
hxthe half-width.
hythe half-height.
void b2PolygonShape_SetAsBox2 ( b2PolygonShape shape,
var  hx,
var  hy,
const VECTOR *  center,
var  angle 
)

Build vertices to represent an oriented box.

Parameters:
hxthe half-width.
hythe half-height.
centerthe center of the box in local coordinates.
anglethe rotation of the box in local coordinates.
void b2PolygonShape_SetAsEdge ( b2PolygonShape shape,
const VECTOR *  v1,
const VECTOR *  v2 
)

Set this as a single edge.

void b2PolygonShape_SetCentroid ( b2PolygonShape shape,
const VECTOR *  centroid 
)

Set m_centroid property.

void b2PolygonShape_SetNormal ( b2PolygonShape shape,
const VECTOR *  normal,
var  index 
)

Get vertex at index.

Set normal at index

void b2PolygonShape_SetVertex ( b2PolygonShape shape,
const VECTOR *  vertex,
var  index 
)

Set vertex at index.

var b2PolygonShape_TestPoint ( b2PolygonShape shape,
const b2Transform transform,
const VECTOR *  p 
)
See also:
b2Shape::TestPoint
 All Data Structures Files Functions Variables Typedefs Defines