Skip to content

Commit 0260089

Browse files
committed
update docs
1 parent ffc8cb3 commit 0260089

File tree

8 files changed

+89
-28
lines changed

8 files changed

+89
-28
lines changed

docs/pages/api/classes/Body.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ the body.
166166

167167
Contacts are not created until the next time step.
168168

169-
Warning: This function is locked during callbacks.
169+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
170170

171171
##### Parameters
172172

@@ -216,7 +216,7 @@ mass of the body if the body is dynamic and the fixture has positive density.
216216
All fixtures attached to a body are implicitly destroyed when the body is
217217
destroyed.
218218

219-
Warning: This function is locked during callbacks.
219+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
220220

221221
#### Parameters
222222

@@ -687,6 +687,8 @@ in collisions, ray-casts, or queries. Joints connected to an inactive body
687687
are implicitly inactive. An inactive body is still owned by a World object
688688
and remains
689689

690+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
691+
690692
#### Parameters
691693

692694
**flag**: `boolean`
@@ -870,6 +872,8 @@ that this changes the center of mass position. Note that creating or
870872
destroying fixtures can also alter the mass. This function has no effect if
871873
the body isn't dynamic.
872874

875+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
876+
873877
#### Parameters
874878

875879
**massData**: [`MassData`](/api/interfaces/MassData)
@@ -932,6 +936,8 @@ Set the position of the body's origin and rotation. Manipulating a body's
932936
transform may cause non-physical behavior. Note: contacts are updated on the
933937
next call to World.step.
934938

939+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
940+
935941
##### Parameters
936942

937943
**position**: [`Vec2Value`](/api/interfaces/Vec2Value)
@@ -954,6 +960,8 @@ Set the position of the body's origin and rotation. Manipulating a body's
954960
transform may cause non-physical behavior. Note: contacts are updated on the
955961
next call to World.step.
956962

963+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
964+
957965
##### Parameters
958966

959967
**xf**: [`Transform`](/api/classes/Transform)
@@ -976,6 +984,8 @@ Set the type of the body to "static", "kinematic" or "dynamic".
976984

977985
The type of the body.
978986

987+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
988+
979989
#### Returns
980990

981991
`void`

docs/pages/api/classes/World.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See [World.setAutoClearForces](/api/classes/World#setautoclearforces)
5252
Create a rigid body given a definition. No reference to the definition is
5353
retained.
5454

55-
Warning: This function is locked during callbacks.
55+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
5656

5757
##### Parameters
5858

@@ -115,7 +115,7 @@ Warning: This function is locked during callbacks.
115115
Create a joint to constrain bodies together. No reference to the definition
116116
is retained. This may cause the connected bodies to cease colliding.
117117

118-
Warning: This function is locked during callbacks.
118+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
119119

120120
#### Type Parameters
121121

@@ -165,12 +165,11 @@ Warning: This function is locked during callbacks.
165165

166166
> **destroyBody**(`b`): `boolean`
167167
168-
Destroy a rigid body given a definition. No reference to the definition is
169-
retained.
168+
Destroy a body from the world.
170169

171170
Warning: This automatically deletes all associated shapes and joints.
172171

173-
Warning: This function is locked during callbacks.
172+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
174173

175174
#### Parameters
176175

@@ -186,8 +185,11 @@ Warning: This function is locked during callbacks.
186185

187186
> **destroyJoint**(`joint`): `void`
188187
189-
Destroy a joint. This may cause the connected bodies to begin colliding.
190-
Warning: This function is locked during callbacks.
188+
Destroy a joint.
189+
190+
Warning: This may cause the connected bodies to begin colliding.
191+
192+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
191193

192194
#### Parameters
193195

@@ -718,6 +720,22 @@ Called for each fixture found in the query AABB. It may return `false` to termin
718720

719721
***
720722

723+
### queueUpdate()
724+
725+
> **queueUpdate**(`callback`): `void`
726+
727+
Queue a function to be called after ongoing simulation step. If no simulation is in progress call it immediately.
728+
729+
#### Parameters
730+
731+
**callback**
732+
733+
#### Returns
734+
735+
`void`
736+
737+
***
738+
721739
### rayCast()
722740

723741
> **rayCast**(`point1`, `point2`, `callback`): `void`
@@ -855,6 +873,8 @@ position -= newOrigin
855873

856874
The new origin with respect to the old origin
857875

876+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
877+
858878
#### Returns
859879

860880
`void`

docs/pages/api/classes/body.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ the body.
166166

167167
Contacts are not created until the next time step.
168168

169-
Warning: This function is locked during callbacks.
169+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
170170

171171
##### Parameters
172172

@@ -216,7 +216,7 @@ mass of the body if the body is dynamic and the fixture has positive density.
216216
All fixtures attached to a body are implicitly destroyed when the body is
217217
destroyed.
218218

219-
Warning: This function is locked during callbacks.
219+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
220220

221221
#### Parameters
222222

@@ -687,6 +687,8 @@ in collisions, ray-casts, or queries. Joints connected to an inactive body
687687
are implicitly inactive. An inactive body is still owned by a World object
688688
and remains
689689

690+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
691+
690692
#### Parameters
691693

692694
**flag**: `boolean`
@@ -870,6 +872,8 @@ that this changes the center of mass position. Note that creating or
870872
destroying fixtures can also alter the mass. This function has no effect if
871873
the body isn't dynamic.
872874

875+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
876+
873877
#### Parameters
874878

875879
**massData**: [`MassData`](/api/interfaces/MassData)
@@ -932,6 +936,8 @@ Set the position of the body's origin and rotation. Manipulating a body's
932936
transform may cause non-physical behavior. Note: contacts are updated on the
933937
next call to World.step.
934938

939+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
940+
935941
##### Parameters
936942

937943
**position**: [`Vec2Value`](/api/interfaces/Vec2Value)
@@ -954,6 +960,8 @@ Set the position of the body's origin and rotation. Manipulating a body's
954960
transform may cause non-physical behavior. Note: contacts are updated on the
955961
next call to World.step.
956962

963+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
964+
957965
##### Parameters
958966

959967
**xf**: [`Transform`](/api/classes/Transform)
@@ -976,6 +984,8 @@ Set the type of the body to "static", "kinematic" or "dynamic".
976984

977985
The type of the body.
978986

987+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
988+
979989
#### Returns
980990

981991
`void`

docs/pages/api/classes/world.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See [World.setAutoClearForces](/api/classes/World#setautoclearforces)
5252
Create a rigid body given a definition. No reference to the definition is
5353
retained.
5454

55-
Warning: This function is locked during callbacks.
55+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
5656

5757
##### Parameters
5858

@@ -115,7 +115,7 @@ Warning: This function is locked during callbacks.
115115
Create a joint to constrain bodies together. No reference to the definition
116116
is retained. This may cause the connected bodies to cease colliding.
117117

118-
Warning: This function is locked during callbacks.
118+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
119119

120120
#### Type Parameters
121121

@@ -165,12 +165,11 @@ Warning: This function is locked during callbacks.
165165

166166
> **destroyBody**(`b`): `boolean`
167167
168-
Destroy a rigid body given a definition. No reference to the definition is
169-
retained.
168+
Destroy a body from the world.
170169

171170
Warning: This automatically deletes all associated shapes and joints.
172171

173-
Warning: This function is locked during callbacks.
172+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
174173

175174
#### Parameters
176175

@@ -186,8 +185,11 @@ Warning: This function is locked during callbacks.
186185

187186
> **destroyJoint**(`joint`): `void`
188187
189-
Destroy a joint. This may cause the connected bodies to begin colliding.
190-
Warning: This function is locked during callbacks.
188+
Destroy a joint.
189+
190+
Warning: This may cause the connected bodies to begin colliding.
191+
192+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
191193

192194
#### Parameters
193195

@@ -718,6 +720,22 @@ Called for each fixture found in the query AABB. It may return `false` to termin
718720

719721
***
720722

723+
### queueUpdate()
724+
725+
> **queueUpdate**(`callback`): `void`
726+
727+
Queue a function to be called after ongoing simulation step. If no simulation is in progress call it immediately.
728+
729+
#### Parameters
730+
731+
**callback**
732+
733+
#### Returns
734+
735+
`void`
736+
737+
***
738+
721739
### rayCast()
722740

723741
> **rayCast**(`point1`, `point2`, `callback`): `void`
@@ -855,6 +873,8 @@ position -= newOrigin
855873

856874
The new origin with respect to the old origin
857875

876+
Warning: This function is locked when a world simulation step is in progress. Use queueUpdate to schedule a function to be called after the step.
877+
858878
#### Returns
859879

860880
`void`

docs/pages/api/functions/CollidePolygons.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
> **CollidePolygons**(`manifold`, `polyA`, `xfA`, `polyB`, `xfB`): `void`
44
5-
Find edge normal of max separation on A - return if separating axis is found<br>
6-
Find edge normal of max separation on B - return if separation axis is found<br>
7-
Choose reference edge as min(minA, minB)<br>
8-
Find incident edge<br>
5+
Find edge normal of max separation on A - return if separating axis is found
6+
Find edge normal of max separation on B - return if separation axis is found
7+
Choose reference edge as min(minA, minB)
8+
Find incident edge
99
Clip
1010

1111
The normal points from 1 to 2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@
9999
"change": "changeset",
100100
"version": "changeset version",
101101
"publish": "changeset publish",
102-
"typedoc": "typedoc --options typedoc.json && mv ./docs/pages/api/README.md ./docs/pages/api/index.md && ./node_modules/.bin/replace-in-files ./docs/pages/api/* --string '.md' --replacement ''"
102+
"typedoc": "typedoc --options typedoc.json && mv ./docs/pages/api/README.md ./docs/pages/api/index.md && replace-in-files ./docs/pages/api/* --string '.md' --replacement ''"
103103
}
104104
}

src/collision/shape/CollidePolygon.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ Contact.addType(PolygonShape.TYPE, PolygonShape.TYPE, PolygonContact);
151151

152152
/**
153153
*
154-
* Find edge normal of max separation on A - return if separating axis is found<br>
155-
* Find edge normal of max separation on B - return if separation axis is found<br>
156-
* Choose reference edge as min(minA, minB)<br>
157-
* Find incident edge<br>
154+
* Find edge normal of max separation on A - return if separating axis is found
155+
* Find edge normal of max separation on B - return if separation axis is found
156+
* Choose reference edge as min(minA, minB)
157+
* Find incident edge
158158
* Clip
159159
*
160160
* The normal points from 1 to 2

src/util/DataDriver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
* LICENSE file in the root directory of this source tree.
88
*/
99

10+
/** @hidden */
1011
export interface DataDriverListener<D, R> {
1112
enter: (d: D) => R | null;
1213
exit: (d: D, ref: R) => void;
1314
update: (d: D, ref: R) => void;
1415
}
1516

1617
/**
17-
* @experimental
18+
* @experimental @hidden
1819
*
1920
* DataDriver is used it to create, update and destroy physics entities based on game objects.
2021
*/

0 commit comments

Comments
 (0)