(add-body! screen b-def)
Creates a body from b-def
, adds it to the screen
and returns it.
(add-body! screen (body-def :dynamic))
Creates a body from `b-def`, adds it to the `screen` and returns it. (add-body! screen (body-def :dynamic))
(add-joint! screen j-def)
Adds the joint
to the screen
for physics simulations and returns it.
Adds the `joint` to the `screen` for physics simulations and returns it.
(body! entity k & options)
Calls a single method on a body.
Calls a single method on a body.
(body-angle! entity angle)
Changes the angle
(degrees) of the body in entity
.
Changes the `angle` (degrees) of the body in `entity`.
(body-def k & options)
Returns a BodyDef.
(body-def :dynamic)
Returns a [BodyDef](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/BodyDef.html). (body-def :dynamic)
(body-position! entity x y angle)
Changes the position of the body in entity
. The angle is in degrees.
Changes the position of the body in `entity`. The angle is in degrees.
(body-x! entity x)
Changes the x
of the body in entity
.
Changes the `x` of the body in `entity`.
(body-y! entity y)
Changes the y
of the body in entity
.
Changes the `y` of the body in `entity`.
(box-2d gravity-x gravity-y & options)
Returns a World.
(box-2d 0 0)
Returns a [World](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/World.html). (box-2d 0 0)
(box-2d! screen k & options)
Calls a single method on a box-2d
.
Calls a single method on a `box-2d`.
(chain-shape & options)
Returns a ChainShape.
Returns a [ChainShape](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/ChainShape.html).
(chain-shape! object k & options)
Calls a single method on a chain-shape
.
Calls a single method on a `chain-shape`.
(circle-shape & options)
Returns a CircleShape.
Returns a [CircleShape](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/CircleShape.html).
(circle-shape! object k & options)
Calls a single method on a circle-shape
.
Calls a single method on a `circle-shape`.
(edge-shape & options)
Returns an EdgeShape.
Returns an [EdgeShape](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/EdgeShape.html).
(edge-shape! object k & options)
Calls a single method on an edge-shape
.
Calls a single method on an `edge-shape`.
(first-entity screen entities)
Returns the first entity in a contact. May only be used in contact functions such as :on-begin-contact.
Returns the first entity in a contact. May only be used in contact functions such as :on-begin-contact.
(fixture! object k & options)
Calls a single method on a fixture.
Calls a single method on a fixture.
(fixture-def & options)
Returns a FixtureDef.
Returns a [FixtureDef](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/FixtureDef.html).
(joint! object k & options)
Calls a single method on a joint.
Calls a single method on a joint.
(joint-def k & options)
Returns a subclass of JointDef.
(joint-def :rope)
Returns a subclass of [JointDef](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/JointDef.html). (joint-def :rope)
(polygon-shape & options)
Returns a PolygonShape.
Returns a [PolygonShape](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/physics/box2d/PolygonShape.html).
(polygon-shape! object k & options)
Calls a single method on a polygon-shape
.
Calls a single method on a `polygon-shape`.
(second-entity screen entities)
Returns the second entity in a contact. May only be used in contact functions such as :on-begin-contact.
Returns the second entity in a contact. May only be used in contact functions such as :on-begin-contact.
(step! {:keys [world time-step velocity-iterations position-iterations]
:or {time-step (/ 1 60) velocity-iterations 10 position-iterations 10}
:as screen})
(step! screen entities)
Runs the physics simulations for a single frame and optionally returns the
entities
with their positions updated.
Runs the physics simulations for a single frame and optionally returns the `entities` with their positions updated.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close