Improve physics docstrings

This commit is contained in:
oakes
2014-04-16 13:28:13 -04:00
parent 3298382982
commit 8d4abdf76a

View File

@@ -6,11 +6,14 @@
(fn [screen & [entities]] (-> screen (u/get-obj :world) class)))
(defmulti add-body!
"Adds the `body` to the `screen` for physics simulations and returns it."
"Adds the `body` to the `screen` for physics simulations and returns it. For
2D physics, `body` should be a `body-def`, whereas for 3D physics it should be a
`basic-body` or a `rigid-body`."
(fn [screen body] (-> screen (u/get-obj :world) class)))
(defmulti body-position!
"Changes the position of the body in `entity`."
"Changes the position of the body in `entity`. For 2D physics, the arguments
should be x, y, and angle, whereas for 3D physics they should be x, y, and z."
(fn [entity a1 a2 a3] (-> entity (u/get-obj :body) class)))
(defmulti body-x!
@@ -22,9 +25,9 @@
(fn [entity y] (-> entity (u/get-obj :body) class)))
(defmulti body-z!
"Changes the `z` of the body in `entity`."
"Changes the `z` of the body in `entity`. Only works with 3D physics."
(fn [entity z] (-> entity (u/get-obj :body) class)))
(defmulti body-angle!
"Changes the `angle` of the body in `entity`."
"Changes the `angle` of the body in `entity`. Only works with 2D physics."
(fn [entity angle] (-> entity (u/get-obj :body) class)))