You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/body/Body.js
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -380,6 +380,8 @@ var Axes = require('../geometry/Axes');
380
380
*
381
381
* See `body.parts` for details and requirements on how parts are used.
382
382
*
383
+
* See Bodies.fromVertices for a related utility.
384
+
*
383
385
* This function updates `body` mass, inertia and centroid based on the parts geometry.
384
386
* Sets each `part.parent` to be this `body`.
385
387
*
@@ -927,17 +929,24 @@ var Axes = require('../geometry/Axes');
927
929
/**
928
930
* _Read only_. Use `Body.setParts` to set.
929
931
*
932
+
* See `Bodies.fromVertices` for a related utility.
933
+
*
930
934
* An array of bodies (the 'parts') that make up this body (the 'parent'). The first body in this array must always be a self-reference to this `body`.
931
935
*
932
-
* The parts are fixed together and will move and rotate as a single rigid body.
936
+
* The parts are fixed together and therefore perform as a single unified rigid body.
933
937
*
934
-
* Parts when combined are allowed to overlap, form gaps, have holes so can be used to create complex concave bodies unlike bodies with a single part.
938
+
* Parts in relation to each other are allowed to overlap, as well as form gaps or holes, so can be used to create complex concave bodies unlike when using a single part.
935
939
*
936
-
* Only the geometry of the parts is considered, e.g. the individual material properties of parts (e.g. `part.friction`) are not used in favour of the parent body's properties.
940
+
* Use properties and functions on the parent `body` rather than on parts.
941
+
*
942
+
* Outside of their geometry, most properties on parts are not considered or updated.
943
+
* As such 'per-part' material properties among others are not currently considered.
937
944
*
938
-
* Parts individual vertices must still be convex.
945
+
* Parts should be created specifically for their parent body.
946
+
* Parts should not be shared or reused between bodies, only one parent is supported.
939
947
* Parts should not have their own parts, they are not handled recursively.
940
-
* Parts should not be added to the world directly or any other body or composite.
948
+
* Parts should not be added to the world directly or any other composite.
949
+
* Parts own vertices must be convex and in clockwise order.
941
950
*
942
951
* A body with more than one part is sometimes referred to as a 'compound' body.
0 commit comments