box2d 0.4.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 22

###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: ^0.4.0

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/box2d.dart';
  
Version Uploaded Documentation Archive
0.4.0 Dec 14, 2017 Go to the documentation of box2d 0.4.0 Download box2d 0.4.0 archive
0.3.0 May 9, 2016 Go to the documentation of box2d 0.3.0 Download box2d 0.3.0 archive
0.2.0 May 11, 2015 Go to the documentation of box2d 0.2.0 Download box2d 0.2.0 archive
0.1.7 Jul 9, 2013 Go to the documentation of box2d 0.1.7 Download box2d 0.1.7 archive
0.1.6 Jun 5, 2013 Go to the documentation of box2d 0.1.6 Download box2d 0.1.6 archive
0.1.5 Jun 4, 2013 Go to the documentation of box2d 0.1.5 Download box2d 0.1.5 archive
0.1.4 Apr 9, 2013 Go to the documentation of box2d 0.1.4 Download box2d 0.1.4 archive
0.1.3 Apr 3, 2013 Go to the documentation of box2d 0.1.3 Download box2d 0.1.3 archive
0.1.1 Mar 6, 2013 Go to the documentation of box2d 0.1.1 Download box2d 0.1.1 archive
0.1.0 Mar 6, 2013 Go to the documentation of box2d 0.1.0 Download box2d 0.1.0 archive

All 18 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
22
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Health issues and suggestions

Fix lib/src/particle/particle_system.dart. (-98.66 points)

Analysis of lib/src/particle/particle_system.dart failed with 15 errors, including:

line 950 col 47: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 984 col 22: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 1012 col 58: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 1081 col 32: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 1082 col 32: The getter 'MAX_FINITE' isn't defined for the class 'double'.

Fix lib/src/settings.dart. (-89.99 points)

Analysis of lib/src/settings.dart failed with 8 errors, including:

line 68 col 43: Const variables must be initialized with a constant value.

line 68 col 48: The getter 'PI' isn't defined for the class 'Math'.

line 103 col 52: Const variables must be initialized with a constant value.

line 103 col 57: The getter 'PI' isn't defined for the class 'Math'.

line 116 col 35: Const variables must be initialized with a constant value.

Fix lib/src/collision/collision.dart. (-82.20 points)

Analysis of lib/src/collision/collision.dart failed with 6 errors, including:

line 358 col 33: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 540 col 36: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 547 col 26: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 603 col 28: The getter 'MAX_FINITE' isn't defined for the class 'double'.

line 1415 col 30: The getter 'MAX_FINITE' isn't defined for the class 'double'.

Fix additional 12 files with analysis or formatting issues. (-399.61 points)

Additional issues in the following files:

  • lib/src/particle/voronoi_diagram.dart (4 errors)
  • lib/src/collision/aabb.dart (2 errors)
  • lib/src/dynamics/profile.dart (2 errors)
  • lib/src/math_utils.dart (2 errors)
  • lib/src/collision/broadphase/dynamic_tree.dart (1 error)
  • lib/src/collision/shapes/circle_shape.dart (1 error)
  • lib/src/collision/shapes/polygon_shape.dart (1 error)
  • lib/src/dynamics/island.dart (1 error)
  • lib/src/dynamics/joints/distance_joint.dart (1 error)
  • lib/src/dynamics/joints/mouse_joint.dart (1 error)
  • lib/src/dynamics/joints/weld_joint.dart (1 error)
  • lib/src/dynamics/joints/wheel_joint.dart (1 error)

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use box2d.dart. Packages with multiple examples should use example/readme.md.

Dependencies

Package Constraint Resolved Available
Direct dependencies
vector_math >=2.0.0 <3.0.0 2.0.8
Dev dependencies
browser >=0.10.0 <0.11.0