chipmunk2d_physics_ffi_bindings_generated library

Classes

cpArbiter
cpBB
Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)
cpBody
cpConstraint
cpContactPointSet
A struct that wraps up the important collision data for an arbiter.
cpPointQueryInfo
Point query info struct.
cpSegmentQueryInfo
Segment query info struct.
cpShape
cpShapeFilter
Fast collision filtering type that is used to determine if two objects collide before calling collision or query callbacks.
cpSpace
cpTransform
Column major affine transform.
cpVect
Chipmunk's 2D vector type. @addtogroup cpVect
UnnamedStruct
The array of contact points.

Functions

cp_arbiter_get_bodies(Pointer<cpArbiter> arb, Pointer<Pointer<cpBody>> a, Pointer<Pointer<cpBody>> b) → void
cp_arbiter_get_contact_point_set(Pointer<cpArbiter> arb) cpContactPointSet
cp_arbiter_get_count(Pointer<cpArbiter> arb) int
cp_arbiter_get_depth(Pointer<cpArbiter> arb, int i) double
cp_arbiter_get_friction(Pointer<cpArbiter> arb) double
cp_arbiter_get_normal(Pointer<cpArbiter> arb) cpVect
cp_arbiter_get_point_a(Pointer<cpArbiter> arb, int i) cpVect
cp_arbiter_get_point_b(Pointer<cpArbiter> arb, int i) cpVect
cp_arbiter_get_restitution(Pointer<cpArbiter> arb) double
Arbiter
cp_arbiter_get_shapes(Pointer<cpArbiter> arb, Pointer<Pointer<cpShape>> a, Pointer<Pointer<cpShape>> b) → void
cp_arbiter_get_surface_velocity(Pointer<cpArbiter> arb) cpVect
cp_arbiter_ignore(Pointer<cpArbiter> arb) int
cp_arbiter_is_first_contact(Pointer<cpArbiter> arb) int
cp_arbiter_is_removal(Pointer<cpArbiter> arb) int
cp_arbiter_set_contact_point_set(Pointer<cpArbiter> arb, Pointer<cpContactPointSet> set) → void
cp_arbiter_set_friction(Pointer<cpArbiter> arb, double friction) → void
cp_arbiter_set_restitution(Pointer<cpArbiter> arb, double restitution) → void
cp_arbiter_set_surface_velocity(Pointer<cpArbiter> arb, cpVect vr) → void
cp_arbiter_total_impulse(Pointer<cpArbiter> arb) cpVect
cp_arbiter_total_ke(Pointer<cpArbiter> arb) double
cp_area_for_circle(double r1, double r2) double
cp_area_for_poly(int count, Pointer<cpVect> verts, double radius) double
cp_area_for_segment(cpVect a, cpVect b, double radius) double
cp_body_activate(Pointer<cpBody> body) → void
cp_body_activate_static(Pointer<cpBody> body, Pointer<cpShape> filter) → void
cp_body_apply_force_at_local_point(Pointer<cpBody> body, cpVect force, cpVect point) → void
cp_body_apply_force_at_world_point(Pointer<cpBody> body, cpVect force, cpVect point) → void
cp_body_apply_impulse_at_local_point(Pointer<cpBody> body, cpVect impulse, cpVect point) → void
cp_body_apply_impulse_at_world_point(Pointer<cpBody> body, cpVect impulse, cpVect point) → void
cp_body_free(Pointer<cpBody> body) → void
cp_body_get_angle(Pointer<cpBody> body) double
cp_body_get_angular_velocity(Pointer<cpBody> body) double
cp_body_get_center_of_gravity(Pointer<cpBody> body) cpVect
cp_body_get_force(Pointer<cpBody> body) cpVect
cp_body_get_mass(Pointer<cpBody> body) double
cp_body_get_moment(Pointer<cpBody> body) double
cp_body_get_position(Pointer<cpBody> body) cpVect
cp_body_get_rotation(Pointer<cpBody> body) cpVect
cp_body_get_space(Pointer<cpBody> body) Pointer<cpSpace>
cp_body_get_torque(Pointer<cpBody> body) double
cp_body_get_type(Pointer<cpBody> body) int
cp_body_get_velocity(Pointer<cpBody> body) cpVect
cp_body_get_velocity_at_local_point(Pointer<cpBody> body, cpVect point) cpVect
cp_body_get_velocity_at_world_point(Pointer<cpBody> body, cpVect point) cpVect
cp_body_is_sleeping(Pointer<cpBody> body) int
cp_body_kinetic_energy(Pointer<cpBody> body) double
cp_body_local_to_world(Pointer<cpBody> body, cpVect point) cpVect
cp_body_new(double mass, double moment) Pointer<cpBody>
Body management
cp_body_new_kinematic() Pointer<cpBody>
cp_body_new_static() Pointer<cpBody>
cp_body_set_angle(Pointer<cpBody> body, double angle) → void
cp_body_set_angular_velocity(Pointer<cpBody> body, double angularVelocity) → void
cp_body_set_center_of_gravity(Pointer<cpBody> body, cpVect cog) → void
cp_body_set_force(Pointer<cpBody> body, cpVect force) → void
cp_body_set_mass(Pointer<cpBody> body, double mass) → void
cp_body_set_moment(Pointer<cpBody> body, double moment) → void
cp_body_set_position(Pointer<cpBody> body, cpVect pos) → void
cp_body_set_torque(Pointer<cpBody> body, double torque) → void
cp_body_set_type(Pointer<cpBody> body, int type) → void
cp_body_set_velocity(Pointer<cpBody> body, cpVect velocity) → void
cp_body_sleep(Pointer<cpBody> body) → void
cp_body_sleep_with_group(Pointer<cpBody> body, Pointer<cpBody> group) → void
cp_body_world_to_local(Pointer<cpBody> body, cpVect point) cpVect
cp_box_shape_new(Pointer<cpBody> body, double width, double height, double radius) Pointer<cpShape>
cp_box_shape_new2(Pointer<cpBody> body, cpBB box, double radius) Pointer<cpShape>
cp_centroid_for_poly(int count, Pointer<cpVect> verts) cpVect
cp_circle_shape_get_offset(Pointer<cpShape> shape) cpVect
Circle shape specific
cp_circle_shape_get_radius(Pointer<cpShape> shape) double
cp_circle_shape_new(Pointer<cpBody> body, double radius, cpVect offset) Pointer<cpShape>
Shape management
cp_constraint_free(Pointer<cpConstraint> constraint) → void
Constraint management
cp_constraint_get_body_a(Pointer<cpConstraint> constraint) Pointer<cpBody>
cp_constraint_get_body_b(Pointer<cpConstraint> constraint) Pointer<cpBody>
cp_constraint_get_collide_bodies(Pointer<cpConstraint> constraint) int
cp_constraint_get_error_bias(Pointer<cpConstraint> constraint) double
cp_constraint_get_impulse(Pointer<cpConstraint> constraint) double
cp_constraint_get_max_bias(Pointer<cpConstraint> constraint) double
cp_constraint_get_max_force(Pointer<cpConstraint> constraint) double
cp_constraint_get_space(Pointer<cpConstraint> constraint) Pointer<cpSpace>
cp_constraint_set_collide_bodies(Pointer<cpConstraint> constraint, int collideBodies) → void
cp_constraint_set_error_bias(Pointer<cpConstraint> constraint, double errorBias) → void
cp_constraint_set_max_bias(Pointer<cpConstraint> constraint, double maxBias) → void
cp_constraint_set_max_force(Pointer<cpConstraint> constraint, double maxForce) → void
cp_convex_hull(int count, Pointer<cpVect> verts, Pointer<cpVect> result, Pointer<Int> first, double tol) int
cp_damped_rotary_spring_get_damping(Pointer<cpConstraint> constraint) double
cp_damped_rotary_spring_get_rest_angle(Pointer<cpConstraint> constraint) double
cp_damped_rotary_spring_get_stiffness(Pointer<cpConstraint> constraint) double
cp_damped_rotary_spring_new(Pointer<cpBody> a, Pointer<cpBody> b, double restAngle, double stiffness, double damping) Pointer<cpConstraint>
Damped rotary spring
cp_damped_rotary_spring_set_damping(Pointer<cpConstraint> constraint, double damping) → void
cp_damped_rotary_spring_set_rest_angle(Pointer<cpConstraint> constraint, double restAngle) → void
cp_damped_rotary_spring_set_stiffness(Pointer<cpConstraint> constraint, double stiffness) → void
cp_damped_spring_get_anchor_a(Pointer<cpConstraint> constraint) cpVect
cp_damped_spring_get_anchor_b(Pointer<cpConstraint> constraint) cpVect
cp_damped_spring_get_damping(Pointer<cpConstraint> constraint) double
cp_damped_spring_get_rest_length(Pointer<cpConstraint> constraint) double
cp_damped_spring_get_stiffness(Pointer<cpConstraint> constraint) double
cp_damped_spring_new(Pointer<cpBody> a, Pointer<cpBody> b, cpVect anchorA, cpVect anchorB, double restLength, double stiffness, double damping) Pointer<cpConstraint>
Damped spring
cp_damped_spring_set_anchor_a(Pointer<cpConstraint> constraint, cpVect anchorA) → void
cp_damped_spring_set_anchor_b(Pointer<cpConstraint> constraint, cpVect anchorB) → void
cp_damped_spring_set_damping(Pointer<cpConstraint> constraint, double damping) → void
cp_damped_spring_set_rest_length(Pointer<cpConstraint> constraint, double restLength) → void
cp_damped_spring_set_stiffness(Pointer<cpConstraint> constraint, double stiffness) → void
cp_gear_joint_get_phase(Pointer<cpConstraint> constraint) double
cp_gear_joint_get_ratio(Pointer<cpConstraint> constraint) double
cp_gear_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, double phase, double ratio) Pointer<cpConstraint>
Gear joint
cp_gear_joint_set_phase(Pointer<cpConstraint> constraint, double phase) → void
cp_gear_joint_set_ratio(Pointer<cpConstraint> constraint, double ratio) → void
cp_groove_joint_get_anchor_b(Pointer<cpConstraint> constraint) cpVect
cp_groove_joint_get_groove_a(Pointer<cpConstraint> constraint) cpVect
cp_groove_joint_get_groove_b(Pointer<cpConstraint> constraint) cpVect
cp_groove_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, cpVect groove_a, cpVect groove_b, cpVect anchorB) Pointer<cpConstraint>
Groove joint
cp_groove_joint_set_anchor_b(Pointer<cpConstraint> constraint, cpVect anchorB) → void
cp_groove_joint_set_groove_a(Pointer<cpConstraint> constraint, cpVect grooveA) → void
cp_groove_joint_set_groove_b(Pointer<cpConstraint> constraint, cpVect grooveB) → void
cp_moment_for_box(double m, double width, double height) double
cp_moment_for_box2(double m, cpBB box) double
cp_moment_for_circle(double m, double r1, double r2, cpVect offset) double
Utility functions
cp_moment_for_poly(double m, int count, Pointer<cpVect> verts, cpVect offset, double radius) double
cp_moment_for_segment(double m, cpVect a, cpVect b, double radius) double
cp_pin_joint_get_anchor_a(Pointer<cpConstraint> constraint) cpVect
cp_pin_joint_get_anchor_b(Pointer<cpConstraint> constraint) cpVect
cp_pin_joint_get_dist(Pointer<cpConstraint> constraint) double
cp_pin_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, cpVect anchorA, cpVect anchorB) Pointer<cpConstraint>
Pin joint
cp_pin_joint_set_anchor_a(Pointer<cpConstraint> constraint, cpVect anchorA) → void
cp_pin_joint_set_anchor_b(Pointer<cpConstraint> constraint, cpVect anchorB) → void
cp_pin_joint_set_dist(Pointer<cpConstraint> constraint, double dist) → void
cp_pivot_joint_get_anchor_a(Pointer<cpConstraint> constraint) cpVect
cp_pivot_joint_get_anchor_b(Pointer<cpConstraint> constraint) cpVect
cp_pivot_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, cpVect pivot) Pointer<cpConstraint>
Pivot joint
cp_pivot_joint_new2(Pointer<cpBody> a, Pointer<cpBody> b, cpVect anchorA, cpVect anchorB) Pointer<cpConstraint>
cp_pivot_joint_set_anchor_a(Pointer<cpConstraint> constraint, cpVect anchorA) → void
cp_pivot_joint_set_anchor_b(Pointer<cpConstraint> constraint, cpVect anchorB) → void
cp_poly_shape_get_count(Pointer<cpShape> shape) int
Poly shape specific
cp_poly_shape_get_radius(Pointer<cpShape> shape) double
cp_poly_shape_get_vert(Pointer<cpShape> shape, int index) cpVect
cp_poly_shape_new(Pointer<cpBody> body, int count, Pointer<cpVect> verts, cpTransform transform, double radius) Pointer<cpShape>
cp_poly_shape_new_raw(Pointer<cpBody> body, int count, Pointer<cpVect> verts, double radius) Pointer<cpShape>
cp_ratchet_joint_get_angle(Pointer<cpConstraint> constraint) double
cp_ratchet_joint_get_phase(Pointer<cpConstraint> constraint) double
cp_ratchet_joint_get_ratchet(Pointer<cpConstraint> constraint) double
cp_ratchet_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, double phase, double ratchet) Pointer<cpConstraint>
Ratchet joint
cp_ratchet_joint_set_angle(Pointer<cpConstraint> constraint, double angle) → void
cp_ratchet_joint_set_phase(Pointer<cpConstraint> constraint, double phase) → void
cp_ratchet_joint_set_ratchet(Pointer<cpConstraint> constraint, double ratchet) → void
cp_rotary_limit_joint_get_max(Pointer<cpConstraint> constraint) double
cp_rotary_limit_joint_get_min(Pointer<cpConstraint> constraint) double
cp_rotary_limit_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, double min, double max) Pointer<cpConstraint>
Rotary limit joint
cp_rotary_limit_joint_set_max(Pointer<cpConstraint> constraint, double max) → void
cp_rotary_limit_joint_set_min(Pointer<cpConstraint> constraint, double min) → void
cp_segment_shape_get_a(Pointer<cpShape> shape) cpVect
Segment shape specific
cp_segment_shape_get_b(Pointer<cpShape> shape) cpVect
cp_segment_shape_get_normal(Pointer<cpShape> shape) cpVect
cp_segment_shape_get_radius(Pointer<cpShape> shape) double
cp_segment_shape_new(Pointer<cpBody> body, cpVect a, cpVect b, double radius) Pointer<cpShape>
cp_segment_shape_set_neighbors(Pointer<cpShape> shape, cpVect prev, cpVect next) → void
cp_shape_filter_new(int group, int categories, int mask) cpShapeFilter
cp_shape_free(Pointer<cpShape> shape) → void
cp_shape_get_area(Pointer<cpShape> shape) double
cp_shape_get_bb(Pointer<cpShape> shape) cpBB
cp_shape_get_body(Pointer<cpShape> shape) Pointer<cpBody>
cp_shape_get_center_of_gravity(Pointer<cpShape> shape) cpVect
cp_shape_get_collision_type(Pointer<cpShape> shape) int
cp_shape_get_density(Pointer<cpShape> shape) double
cp_shape_get_elasticity(Pointer<cpShape> shape) double
cp_shape_get_filter(Pointer<cpShape> shape) cpShapeFilter
cp_shape_get_friction(Pointer<cpShape> shape) double
cp_shape_get_mass(Pointer<cpShape> shape) double
cp_shape_get_moment(Pointer<cpShape> shape) double
cp_shape_get_sensor(Pointer<cpShape> shape) int
cp_shape_get_space(Pointer<cpShape> shape) Pointer<cpSpace>
cp_shape_get_surface_velocity(Pointer<cpShape> shape) cpVect
cp_shape_point_query(Pointer<cpShape> shape, cpVect p, Pointer<cpPointQueryInfo> out) double
cp_shape_segment_query(Pointer<cpShape> shape, cpVect a, cpVect b, double radius, Pointer<cpSegmentQueryInfo> info) int
cp_shape_set_body(Pointer<cpShape> shape, Pointer<cpBody> body) → void
cp_shape_set_collision_type(Pointer<cpShape> shape, int collisionType) → void
cp_shape_set_density(Pointer<cpShape> shape, double density) → void
cp_shape_set_elasticity(Pointer<cpShape> shape, double elasticity) → void
cp_shape_set_filter(Pointer<cpShape> shape, cpShapeFilter filter) → void
cp_shape_set_friction(Pointer<cpShape> shape, double friction) → void
cp_shape_set_mass(Pointer<cpShape> shape, double mass) → void
cp_shape_set_sensor(Pointer<cpShape> shape, int sensor) → void
cp_shape_set_surface_velocity(Pointer<cpShape> shape, cpVect surfaceVelocity) → void
cp_shapes_collide(Pointer<cpShape> a, Pointer<cpShape> b) cpContactPointSet
cp_simple_motor_get_rate(Pointer<cpConstraint> constraint) double
cp_simple_motor_new(Pointer<cpBody> a, Pointer<cpBody> b, double rate) Pointer<cpConstraint>
Simple motor
cp_simple_motor_set_rate(Pointer<cpConstraint> constraint, double rate) → void
cp_slide_joint_get_anchor_a(Pointer<cpConstraint> constraint) cpVect
cp_slide_joint_get_anchor_b(Pointer<cpConstraint> constraint) cpVect
cp_slide_joint_get_max(Pointer<cpConstraint> constraint) double
cp_slide_joint_get_min(Pointer<cpConstraint> constraint) double
cp_slide_joint_new(Pointer<cpBody> a, Pointer<cpBody> b, cpVect anchorA, cpVect anchorB, double min, double max) Pointer<cpConstraint>
Slide joint
cp_slide_joint_set_anchor_a(Pointer<cpConstraint> constraint, cpVect anchorA) → void
cp_slide_joint_set_anchor_b(Pointer<cpConstraint> constraint, cpVect anchorB) → void
cp_slide_joint_set_max(Pointer<cpConstraint> constraint, double max) → void
cp_slide_joint_set_min(Pointer<cpConstraint> constraint, double min) → void
cp_space_add_body(Pointer<cpSpace> space, Pointer<cpBody> body) → void
Space-Body-Shape relationships
cp_space_add_constraint(Pointer<cpSpace> space, Pointer<cpConstraint> constraint) → void
cp_space_add_shape(Pointer<cpSpace> space, Pointer<cpShape> shape) → void
cp_space_contains_body(Pointer<cpSpace> space, Pointer<cpBody> body) int
cp_space_contains_constraint(Pointer<cpSpace> space, Pointer<cpConstraint> constraint) int
cp_space_contains_shape(Pointer<cpSpace> space, Pointer<cpShape> shape) int
cp_space_free(Pointer<cpSpace> space) → void
cp_space_get_collision_bias(Pointer<cpSpace> space) double
cp_space_get_collision_persistence(Pointer<cpSpace> space) int
cp_space_get_collision_slop(Pointer<cpSpace> space) double
cp_space_get_current_time_step(Pointer<cpSpace> space) double
cp_space_get_damping(Pointer<cpSpace> space) double
cp_space_get_gravity(Pointer<cpSpace> space) cpVect
cp_space_get_idle_speed_threshold(Pointer<cpSpace> space) double
cp_space_get_iterations(Pointer<cpSpace> space) int
cp_space_get_sleep_time_threshold(Pointer<cpSpace> space) double
cp_space_get_static_body(Pointer<cpSpace> space) Pointer<cpBody>
cp_space_is_locked(Pointer<cpSpace> space) int
cp_space_new() Pointer<cpSpace>
Space management
cp_space_point_query_nearest(Pointer<cpSpace> space, cpVect point, double maxDistance, cpShapeFilter filter, Pointer<cpPointQueryInfo> out) Pointer<cpShape>
Collision detection and spatial queries
cp_space_reindex_shape(Pointer<cpSpace> space, Pointer<cpShape> shape) → void
cp_space_reindex_shapes_for_body(Pointer<cpSpace> space, Pointer<cpBody> body) → void
cp_space_reindex_static(Pointer<cpSpace> space) → void
cp_space_remove_body(Pointer<cpSpace> space, Pointer<cpBody> body) → void
cp_space_remove_constraint(Pointer<cpSpace> space, Pointer<cpConstraint> constraint) → void
cp_space_remove_shape(Pointer<cpSpace> space, Pointer<cpShape> shape) → void
cp_space_segment_query_first(Pointer<cpSpace> space, cpVect start, cpVect end, double radius, cpShapeFilter filter, Pointer<cpSegmentQueryInfo> out) Pointer<cpShape>
cp_space_set_collision_bias(Pointer<cpSpace> space, double collisionBias) → void
cp_space_set_collision_persistence(Pointer<cpSpace> space, int collisionPersistence) → void
cp_space_set_collision_slop(Pointer<cpSpace> space, double collisionSlop) → void
cp_space_set_damping(Pointer<cpSpace> space, double damping) → void
cp_space_set_gravity(Pointer<cpSpace> space, cpVect gravity) → void
cp_space_set_idle_speed_threshold(Pointer<cpSpace> space, double idleSpeedThreshold) → void
cp_space_set_iterations(Pointer<cpSpace> space, int iterations) → void
cp_space_set_sleep_time_threshold(Pointer<cpSpace> space, double sleepTimeThreshold) → void
cp_space_shape_query(Pointer<cpSpace> space, Pointer<cpShape> shape, Pointer<Void> func, Pointer<Void> data) int
cp_space_step(Pointer<cpSpace> space, double dt) → void
cp_vect_get_x(cpVect v) double
cp_vect_get_y(cpVect v) double
cp_vect_new(double x, double y) cpVect
Vector utilities

Typedefs

cpBitmask = UnsignedInt
Type used for cpShapeFilter category and mask.
cpFloat = Double
Chipmunk's floating point type. Can be reconfigured at compile time.
cpGroup = UintPtr
Type used for cpShape.group.
DartcpBitmask = int
DartcpFloat = double
DartcpGroup = int