dchip.cpBody

Undocumented in source.

Members

Aliases

cpBodyArbiterIteratorFunc
alias cpBodyArbiterIteratorFunc = void function(cpBody* bdy, cpArbiter* arbiter, void* data)

Body/arbiter iterator callback function type.

cpBodyConstraintIteratorFunc
alias cpBodyConstraintIteratorFunc = void function(cpBody* bdy, cpConstraint* constraint, void* data)

Body/constraint iterator callback function type.

cpBodyPositionFunc
alias cpBodyPositionFunc = void function(cpBody* bdy, cpFloat dt)

Rigid body_ position update function type.

cpBodyShapeIteratorFunc
alias cpBodyShapeIteratorFunc = void function(cpBody* bdy, cpShape* shape, void* data)

Body/shape iterator callback function type.

cpBodyVelocityFunc
alias cpBodyVelocityFunc = void function(cpBody* bdy, cpVect gravity, cpFloat damping, cpFloat dt)

Chipmunk's rigid body_ type. Rigid bodies hold the physical properties of an object like it's mass, and position and velocity of it's center of gravity. They don't have an shape on their own. They are given a shape by creating collision shapes (cpShape) that point to the body_. Rigid body_ velocity update function type.

Functions

cpBodyActivate
void cpBodyActivate(cpBody* body_)

Wake up a sleeping or idle body_.

cpBodyActivateStatic
void cpBodyActivateStatic(cpBody* body_, cpShape* filter)

Wake up any sleeping or idle bodies touching a static body_.

cpBodyActivateWrap
void cpBodyActivateWrap(cpBody* body_, void* data)

Workaround for https://github.com/slembcke/Chipmunk2D/issues/56.

cpBodyAddShape
void cpBodyAddShape(cpBody* body_, cpShape* shape)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyAlloc
cpBody* cpBodyAlloc()
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyApplyForce
void cpBodyApplyForce(cpBody* body_, cpVect force, cpVect r)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyApplyImpulse
void cpBodyApplyImpulse(cpBody* body_, cpVect j, cpVect r)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyAssertSane
void cpBodyAssertSane(T bdy)

Check that the properties of a body_ is sane.

cpBodyAssertSane
void cpBodyAssertSane(T bdy)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyDestroy
void cpBodyDestroy(cpBody* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyEachArbiter
void cpBodyEachArbiter(cpBody* body_, cpBodyArbiterIteratorFunc func, void* data)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyEachConstraint
void cpBodyEachConstraint(cpBody* body_, cpBodyConstraintIteratorFunc func, void* data)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyEachShape
void cpBodyEachShape(cpBody* body_, cpBodyShapeIteratorFunc func, void* data)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyFree
void cpBodyFree(cpBody* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyFreeVoid
void cpBodyFreeVoid(void* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyGetVelAtLocalPoint
cpVect cpBodyGetVelAtLocalPoint(cpBody* body_, cpVect point)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyGetVelAtPoint
cpVect cpBodyGetVelAtPoint(cpBody* body_, cpVect r)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyGetVelAtWorldPoint
cpVect cpBodyGetVelAtWorldPoint(cpBody* body_, cpVect point)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyInit
cpBody* cpBodyInit(cpBody* body_, cpFloat m, cpFloat i)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyInitStatic
cpBody* cpBodyInitStatic(cpBody* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyIsRogue
cpBool cpBodyIsRogue(cpBody* bdy)

Returns true if the body_ has not been added to a space. Note: Static bodies are a subtype of rogue bodies.

cpBodyIsSleeping
cpBool cpBodyIsSleeping(cpBody* bdy)

Returns true if the body_ is sleeping.

cpBodyIsStatic
cpBool cpBodyIsStatic(cpBody* bdy)

Returns true if the body_ is static.

cpBodyKineticEnergy
cpFloat cpBodyKineticEnergy(cpBody* bdy)

Get the kinetic energy of a body_.

cpBodyLocal2World
cpVect cpBodyLocal2World(cpBody* bdy, cpVect v)

Convert body_ relative/local coordinates to absolute/world coordinates.

cpBodyNew
cpBody* cpBodyNew(cpFloat m, cpFloat i)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyNewStatic
cpBody* cpBodyNewStatic()
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyPushArbiter
void cpBodyPushArbiter(cpBody* body_, cpArbiter* arb)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyRemoveConstraint
void cpBodyRemoveConstraint(cpBody* body_, cpConstraint* constraint)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyRemoveShape
void cpBodyRemoveShape(cpBody* body_, cpShape* shape)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyResetForces
void cpBodyResetForces(cpBody* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySanityCheck
void cpBodySanityCheck(cpBody* body_)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySetAngle
void cpBodySetAngle(cpBody* body_, cpFloat angle)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySetMass
void cpBodySetMass(cpBody* body_, cpFloat mass)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySetMoment
void cpBodySetMoment(cpBody* body_, cpFloat moment)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySetPos
void cpBodySetPos(cpBody* body_, cpVect pos)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodySleep
void cpBodySleep(cpBody* body_)

Force a body_ to fall asleep immediately.

cpBodySleepWithGroup
void cpBodySleepWithGroup(cpBody* body_, cpBody* group)

Force a body_ to fall asleep immediately along with other bodies in a group.

cpBodyUpdatePosition
void cpBodyUpdatePosition(cpBody* body_, cpFloat dt)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyUpdateVelocity
void cpBodyUpdateVelocity(cpBody* body_, cpVect gravity, cpFloat damping, cpFloat dt)
Undocumented in source. Be warned that the author may not have intended to support it.
cpBodyWorld2Local
cpVect cpBodyWorld2Local(cpBody* bdy, cpVect v)

Convert body_ absolute/world coordinates to relative/local coordinates.

cpv_assert_infinite
void cpv_assert_infinite(cpVect v, string message)
Undocumented in source. Be warned that the author may not have intended to support it.
cpv_assert_nan
void cpv_assert_nan(cpVect v, string message)
Undocumented in source. Be warned that the author may not have intended to support it.
cpv_assert_sane
void cpv_assert_sane(cpVect v, string message)
Undocumented in source. Be warned that the author may not have intended to support it.
filterConstraints
cpConstraint* filterConstraints(cpConstraint* node, cpBody* body_, cpConstraint* filter)
Undocumented in source. Be warned that the author may not have intended to support it.
setAngle
void setAngle(cpBody* body_, cpFloat angle)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin CP_DefineBodyStructGetter!(cpSpace*, "space", "Space")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructGetter!(cpFloat, "m", "Mass")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructGetter!(cpFloat, "i", "Moment")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructGetter!(cpVect, "p", "Pos")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpVect, "v", "Vel")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpVect, "f", "Force")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructGetter!(cpFloat, "a", "Angle")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpFloat, "w", "AngVel")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpFloat, "t", "Torque")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructGetter!(cpVect, "rot", "Rot")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpFloat, "v_limit", "VelLimit")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpFloat, "w_limit", "AngVelLimit")
Undocumented in source.
__anonymous
mixin CP_DefineBodyStructProperty!(cpDataPointer, "data", "UserData")
Undocumented in source.

Mixin templates

CP_DefineBodyStructGetter
mixintemplate CP_DefineBodyStructGetter(type, string member, string name)
Undocumented in source.
CP_DefineBodyStructProperty
mixintemplate CP_DefineBodyStructProperty(type, string member, string name)
Undocumented in source.
CP_DefineBodyStructSetter
mixintemplate CP_DefineBodyStructSetter(type, string member, string name)
Undocumented in source.

Static variables

cpStaticBodySingleton
cpBody cpStaticBodySingleton;
Undocumented in source.

Structs

cpBody
struct cpBody

Chipmunk's rigid body_ struct.

cpComponentNode
struct cpComponentNode

Used internally to track information on the collision graph. @private

Meta