ackb2d 0.9
3D Gamestudio Box 2d Wraper

b2Types.h File Reference

Go to the source code of this file.

Data Structures

struct  b2FixtureDef
struct  b2Fixture
struct  b2BodyDef
struct  b2Body
 A rigid body. These are created via b2World::CreateBody. More...
struct  b2World
struct  b2Filter
struct  b2DestructionListener
struct  b2ContactFilter
struct  b2ContactListener
struct  b2QueryCallback
struct  b2RayCastCallback
struct  b2DebugDraw
struct  ackDebugDraw
 Default debug draw function for use with lite - C. More...
struct  b2Contact
struct  b2ContactEdge
struct  b2JointDef
 Joint definitions are used to construct joints. More...
struct  b2Joint
struct  b2JointEdge
struct  b2LineJointDef
struct  b2LineJoint
struct  b2GearJointDef
struct  b2GearJoint
struct  b2FrictionJointDef
 Friction joint definition. More...
struct  b2FrictionJoint
struct  b2DistanceJointDef
struct  b2DistanceJoint
struct  b2MouseJointDef
struct  b2MouseJoint
struct  b2PrismaticJointDef
struct  b2PrismaticJoint
struct  b2PulleyJointDef
struct  b2PulleyJoint
struct  b2RevoluteJointDef
struct  b2RevoluteJoint
struct  b2WeldJointDef
struct  b2WeldJoint
struct  b2RayCastInput
 Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). More...
struct  b2RayCastOutput
struct  b2AABB
 An axis aligned bounding box. More...
struct  b2MassData
 This holds the mass data computed for a shape. More...
struct  b2DistanceProxy
struct  b2TOIInput
 Input parameters for b2TimeOfImpact. More...
struct  b2TOIOutput
 Output parameters for b2TimeOfImpact. More...
struct  b2SimplexCache
 Used to warm start b2Distance. More...
struct  b2DistanceInput
 Input for b2Distance. More...
struct  b2DistanceOutput
 Acknex version of output for b2Distance. More...
struct  b2ManifoldPoint
struct  b2Manifold
struct  b2WorldManifold
 This is used to compute the current state of a contact manifold. More...
struct  b2ClipVertex
 Used for computing contact manifolds. More...
struct  b2Shape
struct  b2CircleShape
 A circle shape. More...
struct  b2PolygonShape
struct  b2StackAllocator
struct  b2BlockAllocator
struct  b2Transform
struct  b2Sweep

Typedefs

typedef struct b2FixtureDef b2FixtureDef
typedef struct b2Fixture b2Fixture
typedef struct b2BodyDef b2BodyDef
typedef struct b2Body b2Body
 A rigid body. These are created via b2World::CreateBody.
typedef struct b2World b2World
typedef struct b2Filter b2Filter
typedef struct
b2DestructionListener 
b2DestructionListener
typedef struct b2ContactFilter b2ContactFilter
typedef struct b2ContactListener b2ContactListener
typedef struct b2QueryCallback b2QueryCallback
typedef struct b2RayCastCallback b2RayCastCallback
typedef struct b2DebugDraw b2DebugDraw
typedef struct ackDebugDraw ackDebugDraw
 Default debug draw function for use with lite - C.
typedef struct b2Contact b2Contact
typedef struct b2ContactEdge b2ContactEdge
typedef struct b2JointDef b2JointDef
 Joint definitions are used to construct joints.
typedef struct b2Joint b2Joint
typedef struct b2JointEdge b2JointEdge
typedef struct b2LineJointDef b2LineJointDef
typedef struct b2LineJoint b2LineJoint
typedef struct b2GearJointDef b2GearJointDef
typedef struct b2GearJoint b2GearJoint
typedef struct b2FrictionJointDef b2FrictionJointDef
 Friction joint definition.
typedef struct b2FrictionJoint b2FrictionJoint
typedef struct b2DistanceJointDef b2DistanceJointDef
typedef struct b2DistanceJoint b2DistanceJoint
typedef struct b2MouseJointDef b2MouseJointDef
typedef struct b2MouseJoint b2MouseJoint
typedef struct b2PrismaticJointDef b2PrismaticJointDef
typedef struct b2PrismaticJoint b2PrismaticJoint
typedef struct b2PulleyJointDef b2PulleyJointDef
typedef struct b2PulleyJoint b2PulleyJoint
typedef struct b2RevoluteJointDef b2RevoluteJointDef
typedef struct b2RevoluteJoint b2RevoluteJoint
typedef struct b2WeldJointDef b2WeldJointDef
typedef struct b2WeldJoint b2WeldJoint
typedef struct b2RayCastInput b2RayCastInput
 Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).
typedef struct b2RayCastOutput b2RayCastOutput
typedef struct b2AABB b2AABB
 An axis aligned bounding box.
typedef struct b2MassData b2MassData
 This holds the mass data computed for a shape.
typedef struct b2DistanceProxy b2DistanceProxy
typedef struct b2TOIInput b2TOIInput
 Input parameters for b2TimeOfImpact.
typedef struct b2TOIOutput b2TOIOutput
 Output parameters for b2TimeOfImpact.
typedef struct b2SimplexCache b2SimplexCache
 Used to warm start b2Distance.
typedef struct b2DistanceInput b2DistanceInput
 Input for b2Distance.
typedef struct b2DistanceOutput b2DistanceOutput
 Acknex version of output for b2Distance.
typedef struct b2ManifoldPoint b2ManifoldPoint
typedef struct b2Manifold b2Manifold
typedef struct b2WorldManifold b2WorldManifold
 This is used to compute the current state of a contact manifold.
typedef struct b2ClipVertex b2ClipVertex
 Used for computing contact manifolds.
typedef struct b2Shape b2Shape
typedef struct b2CircleShape b2CircleShape
 A circle shape.
typedef struct b2PolygonShape b2PolygonShape
typedef struct b2StackAllocator b2StackAllocator
typedef struct b2BlockAllocator b2BlockAllocator
typedef struct b2Transform b2Transform
typedef struct b2Sweep b2Sweep

Typedef Documentation

typedef struct ackDebugDraw ackDebugDraw

Default debug draw function for use with lite - C.

It must be created with the corresponding creator function

typedef struct b2AABB b2AABB

An axis aligned bounding box.

typedef struct b2Body b2Body

A rigid body. These are created via b2World::CreateBody.

typedef struct b2BodyDef b2BodyDef

The body type. static: zero mass, zero velocity, may be manually moved kinematic: zero mass, non-zero velocity set by user, moved by solver dynamic: positive mass, non-zero velocity determined by forces, moved by solver

typedef struct b2CircleShape b2CircleShape

A circle shape.

typedef struct b2ClipVertex b2ClipVertex

Used for computing contact manifolds.

typedef struct b2Contact b2Contact
typedef struct b2ContactEdge b2ContactEdge

A contact edge is used to connect bodies and contacts together in a contact graph where each body is a node and each contact is an edge. A contact edge belongs to a doubly linked list maintained in each attached body. Each contact has two contact nodes, one for each attached body.

Implement this class to provide collision filtering. In other words, you can implement this class if you want finer control over contact creation.

Implement this class to get contact information. You can use these results for things like sounds and game logic. You can also get contact results by traversing the contact lists after the time step. However, you might miss some contacts because continuous physics leads to sub-stepping. Additionally you may receive multiple callbacks for the same contact in a single time step. You should strive to make your callbacks efficient because there may be many callbacks per time step.

Warning:
You cannot create/destroy Box2D entities inside these callbacks.
typedef struct b2DebugDraw b2DebugDraw

Implement and register this class with a b2World to provide debug drawing of physics entities in your game.

Joints and fixtures are destroyed when their associated body is destroyed. Implement this listener so that you may nullify references to these joints and shapes.

Input for b2Distance.

Not directly useable in 3DGD because of its member complexity All members must be accessed through corresponding functions You have to option to use the shape radii in the computation. Even

A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.

Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.

Warning:
Do not use a zero or short length.

Acknex version of output for b2Distance.

This structure can be used directly

A distance proxy is used by the GJK algorithm. It encapsulates any shape

typedef struct b2Filter b2Filter

This holds contact filtering data.

typedef struct b2Fixture b2Fixture

A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via b2Body::CreateFixture.

Warning:
you cannot reuse fixtures.
typedef struct b2FixtureDef b2FixtureDef

A fixture definition is used to create a fixture. This class defines an abstract fixture definition. You can reuse fixture definitions safely.

Friction joint. This is used for top-down friction. It provides 2D translational friction and angular friction.

Friction joint definition.

typedef struct b2GearJoint b2GearJoint

A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length.

Warning:
The revolute and prismatic joints must be attached to fixed bodies (which must be body1 on those joints).

Gear joint definition. This definition requires two existing revolute or prismatic joints (any combination will work). The provided joints must attach a dynamic body to a static body.

typedef struct b2Joint b2Joint

The base joint class. Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.

typedef struct b2JointDef b2JointDef

Joint definitions are used to construct joints.

typedef struct b2JointEdge b2JointEdge

A joint edge is used to connect bodies and joints together in a joint graph where each body is a node and each joint is an edge. A joint edge belongs to a doubly linked list maintained in each attached body. Each joint has two joint nodes, one for each attached body.

typedef struct b2LineJoint b2LineJoint

A line joint. This joint provides two degrees of freedom: translation along an axis fixed in body1 and rotation in the plane. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.

Line joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

typedef struct b2Manifold b2Manifold

A manifold for two touching convex shapes. Box2D supports multiple types of contact:

  • clip point versus plane with radius
  • point versus point with radius (circles) The local point usage depends on the manifold type: -e_circles: the local center of circleA -e_faceA: the center of faceA -e_faceB: the center of faceB Similarly the local normal usage: -e_circles: not used -e_faceA: the normal on polygonA -e_faceB: the normal on polygonB We store contacts in this way so that position correction can account for movement, which is critical for continuous physics. All contact scenarios must be expressed in one of these types. This structure is stored across time steps, so we keep it small.

A manifold point is a contact point belonging to a contact manifold. It holds details related to the geometry and dynamics of the contact points. The local point usage depends on the manifold type: -e_circles: the local center of circleB -e_faceA: the local center of cirlceB or the clip point of polygonB -e_faceB: the clip point of polygonA This structure is stored across time steps, so we keep it small. Note: the impulses are used for internal caching and may not provide reliable contact forces, especially for high speed collisions.

typedef struct b2MassData b2MassData

This holds the mass data computed for a shape.

typedef struct b2MouseJoint b2MouseJoint

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces. NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

Mouse joint definition. This requires a world target point, tuning parameters, and the time step.

A convex polygon. It is assumed that the interior of the polygon is to the left of each edge.

A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.

Prismatic joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Warning:
at least one body should by dynamic with a non-fixed rotation.
typedef struct b2PulleyJoint b2PulleyJoint

The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio * length2 <= constant Yes, the force transmitted is scaled by the ratio. The pulley also enforces a maximum length limit on both sides. This is useful to prevent one side of the pulley hitting the top.

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio.

Callback class for AABB queries. See b2World::Query

Callback class for ray casts. See b2World::RayCast

Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).

Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 come from b2RayCastInput.

A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.

Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because: 1. you might not know where the center of mass will be. 2. if you add/remove shapes from a body and recompute the mass, the joints will be broken.

typedef struct b2Shape b2Shape

A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in b2World are created automatically when a b2Fixture is created.

Used to warm start b2Distance.

Set count to zero on first call.

typedef struct b2Sweep b2Sweep

This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may no coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.

typedef struct b2TOIInput b2TOIInput

Input parameters for b2TimeOfImpact.

Not directly useable in 3DGD because of its methods All members must be accessed through corresponding functions

typedef struct b2TOIOutput b2TOIOutput

Output parameters for b2TimeOfImpact.

Can be used directly in 3DGS

typedef struct b2Transform b2Transform

A transform contains translation and rotation. It is used to represent the position and orientation of rigid frames.

typedef struct b2WeldJoint b2WeldJoint

A weld joint essentially glues two bodies together. A weld joint may distort somewhat because the island constraint solver is approximate.

Weld joint definition. You need to specify local anchor points where they are attached and the relative body angle. The position of the anchor points is important for computing the reaction torque.

typedef struct b2World b2World

The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient memory management facilities.

This is used to compute the current state of a contact manifold.

 All Data Structures Files Functions Variables Typedefs Defines