box2d_flame 0.4.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 56

A Dart 2D physics engine #

Build Status Coverage Status

This is a Dart port of Java's Box2D libraries.

The Java Box2D library was originally written by Daniel Murphy (status February 2015).

benchmark/bench2d.dart   Benchmark used by Joel Webber
example/index.html       Browser demos as written by Dominic Hamon
lib/                     Port of Daniel Murphy's jbox2d

First Dart port of an earlier version of Box2D library was done by Dominic Hamon. We are grateful for his work.

Not an official Google project

0.4.0 #

  • Breaking: Made package strong-mode compliant (with implicit-casts and implicit-dynamic off). This means many API points are now more strongly typed (num is now double). Fix errors by providing doubles where they are expected (1 will become 1.0 and num fraction = .5 will become double fraction = .5), and explicitly casting joints (world.createJoint(jointDef) as RevoluteJoint).
  • Pulled in optimizations and bug fixes from the original jbox2d project.
  • Made velocityThreshold mutable (as per jbox2d and other box2d implementations).

0.3.0 #

  • Updated to vector_math 2.0.0

0.2.0 #

  • Complete re-write. Many APIs have changed.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  box2d_flame: ^0.4.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:box2d_flame/box2d.dart';
import 'package:box2d_flame/box2d_browser.dart';
  
Version Uploaded Documentation Archive
0.4.3 Jan 30, 2019 Go to the documentation of box2d_flame 0.4.3 Download box2d_flame 0.4.3 archive
0.4.2 Aug 25, 2018 Go to the documentation of box2d_flame 0.4.2 Download box2d_flame 0.4.2 archive
0.4.1 Jul 15, 2018 Go to the documentation of box2d_flame 0.4.1 Download box2d_flame 0.4.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
70
Health:
Code health derived from static analysis. [more]
3
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Mar 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: web

Platform components identified in package: html.

Health suggestions

Fix lib/src/dynamics/world.dart. (-26.34 points)

Analysis of lib/src/dynamics/world.dart reported 61 hints, including:

line 27 col 1: Prefer using /// for doc comments.

line 59 col 3: Prefer using /// for doc comments.

line 86 col 3: Prefer using /// for doc comments.

line 97 col 3: Prefer using /// for doc comments.

line 254 col 3: Prefer using /// for doc comments.

Fix lib/src/dynamics/body.dart. (-22.56 points)

Analysis of lib/src/dynamics/body.dart reported 51 hints, including:

line 27 col 1: Prefer using /// for doc comments.

line 47 col 3: Prefer using /// for doc comments.

line 51 col 3: Prefer using /// for doc comments.

line 56 col 3: Prefer using /// for doc comments.

line 162 col 3: Prefer using /// for doc comments.

Fix lib/src/dynamics/body_def.dart. (-19.39 points)

Analysis of lib/src/dynamics/body_def.dart reported 43 hints, including:

line 27 col 1: Prefer using /// for doc comments.

line 33 col 3: Prefer using /// for doc comments.

line 39 col 3: Prefer using /// for doc comments.

line 44 col 3: Prefer using /// for doc comments.

line 50 col 3: Prefer using /// for doc comments.

Fix additional 101 files with analysis or formatting issues. (-283 points)

Additional issues in the following files:

  • lib/src/callbacks/debug_draw.dart (28 hints)
  • lib/src/settings.dart (26 hints)
  • lib/src/dynamics/fixture.dart (22 hints)
  • lib/src/dynamics/fixture_def.dart (21 hints)
  • lib/src/collision/collision.dart (18 hints)
  • lib/src/collision/aabb.dart (16 hints)
  • lib/src/collision/shapes/polygon_shape.dart (16 hints)
  • lib/src/dynamics/joints/joint.dart (15 hints)
  • lib/src/collision/distance.dart (13 hints)
  • lib/src/dynamics/joints/prismatic_joint.dart (13 hints)
  • lib/src/dynamics/contacts/contact.dart (12 hints)
  • lib/src/dynamics/joints/prismatic_joint_def.dart (12 hints)
  • lib/src/particle/particle_group_def.dart (12 hints)
  • lib/src/callbacks/canvas_draw.dart (11 hints)
  • lib/src/dynamics/joints/revolute_joint_def.dart (11 hints)
  • lib/src/buffer_utils.dart (10 hints)
  • lib/src/particle/particle_type.dart (10 hints)
  • lib/src/collision/broadphase/broadphase_strategy.dart (9 hints)
  • lib/src/common/transform.dart (9 hints)
  • lib/src/common/viewport_transform.dart (9 hints)
  • lib/src/dynamics/joints/joint_edge.dart (9 hints)
  • lib/src/dynamics/joints/motor_joint.dart (9 hints)
  • lib/src/dynamics/joints/pulley_joint_def.dart (9 hints)
  • lib/src/dynamics/joints/wheel_joint_def.dart (9 hints)
  • lib/src/collision/broadphase/broadphase.dart (8 hints)
  • lib/src/collision/manifold.dart (8 hints)
  • lib/src/collision/manifold_point.dart (8 hints)
  • lib/src/collision/shapes/chain_shape.dart (7 hints)
  • lib/src/collision/shapes/mass_data.dart (7 hints)
  • lib/src/collision/shapes/shape.dart (7 hints)
  • lib/src/common/sweep.dart (7 hints)
  • lib/src/dynamics/joints/distance_joint_def.dart (7 hints)
  • lib/src/particle/particle_system.dart (7 hints)
  • lib/src/dynamics/joints/friction_joint_def.dart (6 hints)
  • lib/src/dynamics/joints/joint_def.dart (6 hints)
  • lib/src/dynamics/joints/motor_joint_def.dart (6 hints)
  • lib/src/dynamics/joints/weld_joint_def.dart (6 hints)
  • lib/src/callbacks/contact_listener.dart (5 hints)
  • lib/src/collision/contactid.dart (5 hints)
  • lib/src/collision/shapes/circle_shape.dart (5 hints)
  • lib/src/collision/shapes/edge_shape.dart (5 hints)
  • lib/src/collision/time_of_impact.dart (5 hints)
  • lib/src/dynamics/contacts/contact_edge.dart (5 hints)
  • lib/src/dynamics/joints/mouse_joint_def.dart (5 hints)
  • lib/src/particle/particle_body_contact.dart (5 hints)
  • lib/src/particle/particle_color.dart (5 hints)
  • lib/src/particle/particle_def.dart (5 hints)
  • lib/src/collision/broadphase/dynamic_tree.dart (4 hints)
  • lib/src/collision/distance_output.dart (4 hints)
  • lib/src/collision/world_manifold.dart (4 hints)
  • lib/src/common/canvas_viewport_transform.dart (4 hints)
  • lib/src/dynamics/filter.dart (4 hints)
  • lib/src/dynamics/joints/constant_volume_joints.dart (4 hints)
  • lib/src/dynamics/joints/gear_joint_def.dart (4 hints)
  • lib/src/dynamics/joints/rope_joint_def.dart (4 hints)
  • lib/src/dynamics/time_step.dart (4 hints)
  • lib/src/math_utils.dart (4 hints)
  • lib/src/particle/particle_contact.dart (4 hints)
  • lib/src/callbacks/destruction_listener.dart (3 hints)
  • lib/src/dynamics/contact_manager.dart (3 hints)
  • lib/src/dynamics/contacts/contact_solver.dart (3 hints)
  • lib/src/dynamics/joints/constant_volume_joints_def.dart (3 hints)
  • lib/src/dynamics/joints/distance_joint.dart (3 hints)
  • lib/src/pooling/iordered_stack.dart (3 hints)
  • lib/src/callbacks/contact_filter.dart (2 hints)
  • lib/src/callbacks/particle_destruction_listener.dart (2 hints)
  • lib/src/callbacks/particle_query_callback.dart (2 hints)
  • lib/src/callbacks/query_callback.dart (2 hints)
  • lib/src/callbacks/raycast_callback.dart (2 hints)
  • lib/src/callbacks/tree_callback.dart (2 hints)
  • lib/src/callbacks/tree_raycast_callback.dart (2 hints)
  • lib/src/collision/broadphase/default_broadphase_buffer.dart (2 hints)
  • lib/src/collision/broadphase/dynamic_tree_flatnodes.dart (2 hints)
  • lib/src/dynamics/joints/wheel_joint.dart (2 hints)
  • lib/src/particle/particle_group_type.dart (2 hints)
  • lib/src/pooling/idynamic_stack.dart (2 hints)
  • lib/box2d.dart (1 hint)
  • lib/box2d_browser.dart (1 hint)
  • lib/src/callbacks/contact_impulse.dart (1 hint)
  • lib/src/callbacks/particle_raycast_callback.dart (1 hint)
  • lib/src/collision/broadphase/dynamic_tree_node.dart (1 hint)
  • lib/src/collision/broadphase/pair.dart (1 hint)
  • lib/src/collision/distance_input.dart (1 hint)
  • lib/src/collision/raycast_input.dart (1 hint)
  • lib/src/collision/raycast_output.dart (1 hint)
  • lib/src/collision/shapes/shape_type.dart (1 hint)
  • lib/src/dynamics/body_type.dart (1 hint)
  • lib/src/dynamics/fixture_proxy.dart (1 hint)
  • lib/src/dynamics/island.dart (1 hint)
  • lib/src/dynamics/joints/friction_joint.dart (1 hint)
  • lib/src/dynamics/joints/gear_joint.dart (1 hint)
  • lib/src/dynamics/joints/mouse_joint.dart (1 hint)
  • lib/src/dynamics/joints/pulley_joint.dart (1 hint)
  • lib/src/dynamics/joints/revolute_joint.dart (1 hint)
  • lib/src/dynamics/joints/rope_joint.dart (1 hint)
  • lib/src/dynamics/joints/weld_joint.dart (1 hint)
  • lib/src/particle/stack_queue.dart (1 hint)
  • lib/src/particle/voronoi_diagram.dart (1 hint)
  • lib/src/pooling/normal/default_world_pool.dart (1 hint)
  • lib/src/pooling/normal/mutable_stack.dart (1 hint)
  • lib/src/pooling/normal/ordered_stack.dart (1 hint)

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and box2d_flame.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.50.0 <3.0.0
vector_math >=2.0.0 <3.0.0 2.0.8