Skip to content

Commit

Permalink
docs: improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alestiago committed Oct 30, 2023
1 parent f2c2e0b commit 713aa7f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/forge2d/lib/src/dynamics/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,21 @@ class Body {
}
}

/// Is this body treated like a bullet for continuous collision detection?
bool get isBullet => (flags & bulletFlag) == bulletFlag;

/// {@template isBullet}
/// Whether this body should be treated like a bullet for continuous collision
/// detection.
///
/// Fast moving dynamic bodies should be labeled as bullets so that they
/// do not tunnel through other moving objects.
///
/// **Warning:** You should use this flag sparingly since it increases
/// processing time.
///
/// See also:
///
/// * [Box2D bullets documentation](https://box2d.org/documentation/md__d_1__git_hub_box2d_docs_dynamics.html)
/// * [Box2D bullet method definition](https://box2d.org/documentation/structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586)
/// {@endtemplate}
set isBullet(bool flag) {
if (flag) {
flags |= bulletFlag;
Expand All @@ -611,6 +621,9 @@ class Body {
}
}

/// {@macro isBullet}
bool get isBullet => (flags & bulletFlag) == bulletFlag;

/// You can disable sleeping on this body. If you disable sleeping, the body
/// will be woken.
void setSleepingAllowed(bool flag) {
Expand Down

0 comments on commit 713aa7f

Please sign in to comment.