Character movement solver. More...
Data Structures | |
| struct | b2PlaneResult |
| These are the collision planes returned from b2World_CollideMover. More... | |
| struct | b2CollisionPlane |
| These are collision planes that can be fed to b2SolvePlanes. More... | |
| struct | b2PlaneSolverResult |
| Result returned by b2SolvePlanes. More... | |
Typedefs | |
| typedef bool | b2PlaneResultCallbackFcn(b2ShapeId shapeId, const b2PlaneResult *plane, void *context) |
| Used to collect collision planes for character movers. | |
Functions | |
| b2PlaneSolverResult | b2SolvePlanes (b2Vec2 targetDelta, b2CollisionPlane *planes, int count) |
| Solves the position of a mover that satisfies the given collision planes. | |
| b2Vec2 | b2ClipVector (b2Vec2 vector, const b2CollisionPlane *planes, int count) |
| Clips the velocity against the given collision planes. | |
Character movement solver.
| struct b2PlaneResult |
These are the collision planes returned from b2World_CollideMover.
The plane and point are relative to the query origin, matching the mover capsule.
| Data Fields | ||
|---|---|---|
| bool | hit | Did the collision register a hit? If not this plane should be ignored. |
| b2Plane | plane | The collision plane between the mover and a convex shape. |
| b2Vec2 | point | The collision point on the shape. |
| struct b2CollisionPlane |
These are collision planes that can be fed to b2SolvePlanes.
Normally this is assembled by the user from plane results in b2PlaneResult.
| Data Fields | ||
|---|---|---|
| bool | clipVelocity |
Indicates if b2ClipVector should clip against this plane. Should be false for soft collision. |
| b2Plane | plane | The collision plane between the mover and some shape. |
| float | push | The push on the mover determined by b2SolvePlanes. Usually in meters. |
| float | pushLimit |
Setting this to FLT_MAX makes the plane as rigid as possible. Lower values can make the plane collision soft. Usually in meters. |
| struct b2PlaneSolverResult |
Result returned by b2SolvePlanes.
| Data Fields | ||
|---|---|---|
| b2Vec2 | delta | The final relative translation. |
| int | iterationCount | The number of iterations used by the plane solver. For diagnostics. |
| typedef bool b2PlaneResultCallbackFcn(b2ShapeId shapeId, const b2PlaneResult *plane, void *context) |
Used to collect collision planes for character movers.
Return true to continue gathering planes.
| b2Vec2 b2ClipVector | ( | b2Vec2 | vector, |
| const b2CollisionPlane * | planes, | ||
| int | count ) |
Clips the velocity against the given collision planes.
Planes with zero push or clipVelocity set to false are skipped.
| b2PlaneSolverResult b2SolvePlanes | ( | b2Vec2 | targetDelta, |
| b2CollisionPlane * | planes, | ||
| int | count ) |
Solves the position of a mover that satisfies the given collision planes.
| targetDelta | the desired translation from the position used to generate the collision planes |
| planes | the collision planes |
| count | the number of collision planes |