Skip to content

Commit 981a485

Browse files
authored
Merge pull request #1111 from Happypig375/patch-10
Add documentation to Substance, CollisionDetection and Profile
2 parents b92488b + 138ce72 commit 981a485

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Nu/Nu/Physics/PhysicsEngine.fs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,33 @@ type [<NoEquality; NoComparison>] BodyUserObject =
9898
Constants.PrettyPrinter.DefaultThresholdMin,
9999
Constants.PrettyPrinter.SimpleThresholdMax)>]
100100
type Substance =
101+
/// Density is calculated from dividing constant mass by volume.
101102
| Mass of Mass : single
103+
/// Mass is calculated from multiplying constant density with volume.
102104
| Density of Density : single
103105

104106
/// Describe the form of collision detection to use.
105107
type CollisionDetection =
108+
/// Use discrete collision detection.
109+
/// This is the fastest form of collision detection, but fast-moving objects may tunnel through other
110+
/// objects without detecting a collision.
106111
| Discontinuous
112+
/// Use continuous collision detection.
113+
/// This form of collision detection is slower, but fast-moving objects will not tunnel through other
114+
/// objects without detecting a collision.
107115
| Continuous
108116

109117
/// Describes the physical profile of a complex body.
110-
type [<Struct>] Profile =
118+
type Profile =
119+
/// A convex shape.
120+
/// This shape is defined by a body that forms a convex hull.
111121
| Convex
122+
/// A concave shape.
123+
/// This shape is defined by a body may form a concave hull.
124+
// TODO: Should this case be specified to require points to be formatted as groups of 3 to form triangles even for user defined 2D and 3D engines?
112125
| Concave
126+
/// A simplified axis-aligned bounds.
127+
/// This shape is defined by a bounding box around a body.
113128
| Bounds
114129

115130
/// The shape of a physics body box.
@@ -681,4 +696,4 @@ module Physics =
681696
| StaticModelShape _ as staticModelShape -> staticModelShape
682697
| StaticModelSurfaceShape _ as staticModelSurfaceShape -> staticModelSurfaceShape
683698
| TerrainShape _ as terrainShape -> terrainShape
684-
| BodyShapes bodyShapes -> BodyShapes (List.map (localizePrimitiveBodyShape size) bodyShapes)
699+
| BodyShapes bodyShapes -> BodyShapes (List.map (localizePrimitiveBodyShape size) bodyShapes)

0 commit comments

Comments
 (0)