(body-def {:keys [active? allow-sleep? angle angular-damping angular-velocity
awake? bullet? fixed-rotation? gravity-scale linear-damping
linear-velocity position type user-data]
:as props})
(find-all-by container k v)
Find all bodies or fixtures with a given user-data property, e.g. (find-by world :type :npc)
Find all bodies or fixtures with a given user-data property, e.g. (find-by world :type :npc)
(find-by container k v)
Find a body or fixture with a given user-data property, e.g. (find-by world :id :player)
Find a body or fixture with a given user-data property, e.g. (find-by world :id :player)
(fixture-def {:keys [density filter friction sensor? restitution shape
user-data]
:as props})
(apply-force! _ force)
(apply-force! _ force point)
(ctl1! entity k v)
Generically control properties
Generically control properties
(zoom*! _ f)
(move-to! _ v)
(apply-angular-impulse! _ impulse)
(apply-torque! _ torque)
(alter-user-data*! entity f args)
(move-by! _ v)
(apply-impulse! _ impulse wake?)
(apply-impulse! _ impulse point wake?)
(fixture _)
(friction _)
(body _)
(density _)
(angular-velocity _)
(sensor? _)
(bodies _)
(linear-velocity _)
(bullet? _)
(vertices _)
(transform _)
(awake? _)
(radius _)
(angle _)
(gravity _)
(user-data _)
(fixtures _)
(centroid _)
Local position of a shape/fixture inside a body
Local position of a shape/fixture inside a body
(world-center _)
(restitution _)
(fixed-rotation? _)
(joints _)
(shape _)
(position _)
(filter-data _)
(joint-def {:keys [type collide-connected? bodies joints frequency damping
local-anchors length max-force max-torque ratio linear-offset
angular-offset correction-factor local-axis reference-angle
enable-limit? lower-translation upper-translation
enable-motor? max-motor-force motor-speed ground-anchors
lengths lower-angle upper-angle max-motor-torque max-length]
:as props})
(listen! world event key f)
Listen for world events, event
is one
of :begin-contact, :end-contact, :pre-solve, :post-solve. key
is a key you
choose to identify this listener. Calling listen!
again with the same
event+key will replace the old listener. The key can also be used
to unlisten!
Returns the world instance for easy threading.
Listen for world events, `event` is one of :begin-contact, :end-contact, :pre-solve, :post-solve. `key` is a key you choose to identify this listener. Calling [[listen!]] again with the same event+key will replace the old listener. The key can also be used to [[unlisten!]] Returns the world instance for easy threading.
(raycast world rcb point1 point2)
(raycast world rcb pcb point1 point2)
(raycast world rcb point1 point2)
Perform a raycasting query, this finds bodies that are "visible" from the
given point. This takes a callback function, which receives the fixture,
point, normal, and fraction. The return value from the callback determines
whether the search terminates or not. See raycast-seq
for a more
convenient wrapper.
Perform a raycasting query, this finds bodies that are "visible" from the given point. This takes a callback function, which receives the fixture, point, normal, and fraction. The return value from the callback determines whether the search terminates or not. See [[raycast-seq]] for a more convenient wrapper.
(raycast-seq world point1 point2)
(raycast-seq world point1 point2 behavior)
Perform raycasting and return a sequence of fixtures
This draws a line from point1 to point2, and returns fixtures that intersect
the line. Behavior can be :all
, return all fixtures, or :first
, return the
first matching fixture. Defaults to :first
.
For each fixture returns a map of :fixture
: the matching fixture, :point
:
the point of initial intersection, :normal
: the normal vector at point of
intersection, :fraction
: the fraction along the ray at point of
intersection.
Perform raycasting and return a sequence of fixtures This draws a line from point1 to point2, and returns fixtures that intersect the line. Behavior can be `:all`, return all fixtures, or `:first`, return the first matching fixture. Defaults to `:first`. For each fixture returns a map of `:fixture`: the matching fixture, `:point`: the point of initial intersection, `:normal`: the normal vector at point of intersection, `:fraction`: the fraction along the ray at point of intersection.
(step-world world)
(step-world world timestep)
(step-world world timestep velocity-iterations position-iterations)
(unlisten! world event key)
Remove a specific event listener
Remove a specific event listener
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close