chronosgl 3.9.3

ChronosGL #

A simple WebGL2 engine written in Dart #

Features: #

  • MIT licensed
  • straight-forward API
  • lightweight (close to "baremetal")
  • fully based on WebGL2 and GLSL 3.00es
  • keyboard and mouse event capture
  • support for canvas based textures including skybox
  • focus on procedural content generation
  • optional basic scenegraph
  • importer for several file formats
  • bone animations
  • few dependencies

Code #

Examples #

Usage #

Create a new Dart webapp project, add this as a pubspec.yaml dependency:

        chronosgl: any

You also need the vector_math library which is the only library that ChronosGL is dependent on.

As a test copy simple.html and simple.dart from above into your project.

It should look like this:

If you need to import dart:html, do so as follows:

import 'dart:html' as HTML;

This will avoid a naming conflict for Node.

Use this package as a library

1. Depend on it

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

  chronosgl: ^3.9.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:chronosgl/chronosgl.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-0.12 points)

1661 out of 1713 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/scene/render_phase.dart. (-4.41 points)

Analysis of lib/src/scene/render_phase.dart reported 9 hints, including:

line 70 col 3: Avoid return types on setters.

line 72 col 7: DO use curly braces for all flow control structures.

line 74 col 7: DO use curly braces for all flow control structures.

line 77 col 3: Avoid return types on setters.

line 79 col 7: DO use curly braces for all flow control structures.

Fix lib/src/animation/skeleton_animation.dart. (-3.45 points)

Analysis of lib/src/animation/skeleton_animation.dart reported 7 hints, including:

line 120 col 36: DO use curly braces for all flow control structures.

line 139 col 35: Use isEmpty instead of length

line 144 col 35: Use isEmpty instead of length

line 149 col 32: Use isEmpty instead of length

line 154 col 12: Use isNotEmpty instead of length

Fix lib/src/core/geometry_builder.dart. (-2.48 points)

Analysis of lib/src/core/geometry_builder.dart reported 5 hints:

line 121 col 9: Use isEmpty instead of length

line 172 col 14: Use isEmpty instead of length

line 173 col 14: Use isEmpty instead of length

line 382 col 12: Use isNotEmpty instead of length

line 382 col 33: Use isNotEmpty instead of length

Fix additional 29 files with analysis or formatting issues. (-21.91 points)

Additional issues in the following files:

  • lib/src/importer/threejs.dart (5 hints)
  • lib/src/importer/wavefront.dart (5 hints)
  • lib/src/core/illumination.dart (3 hints)
  • lib/src/core/lib.dart (3 hints)
  • lib/src/importer/assimp2json.dart (3 hints)
  • lib/src/misc/lib.dart (3 hints)
  • lib/src/webhelper/lib.dart (3 hints)
  • lib/src/core/mesh_data.dart (2 hints)
  • lib/src/core/render_program.dart (2 hints)
  • lib/src/polygon/lib.dart (2 hints)
  • lib/src/shader/lib.dart (2 hints)
  • lib/src/shape/lib.dart (2 hints)
  • lib/src/webhelper/midi_input.dart (2 hints)
  • lib/src/animation/lib.dart (1 hint)
  • lib/src/core/chronosgl.dart (1 hint)
  • lib/src/importer/lib.dart (1 hint)
  • lib/src/misc/light_visualizer.dart (1 hint)
  • lib/src/polygon/basic.dart (1 hint)
  • lib/src/scene/lib.dart (1 hint)
  • lib/src/scene/node.dart (1 hint)
  • lib/chronosgl.dart (Run dartfmt to format lib/chronosgl.dart.)
  • lib/src/core/textures.dart (Run dartfmt to format lib/src/core/textures.dart.)
  • lib/src/shader/effect_shaders.dart (Run dartfmt to format lib/src/shader/effect_shaders.dart.)
  • lib/src/shader/fragment.dart (Run dartfmt to format lib/src/shader/fragment.dart.)
  • lib/src/shader/simple_shaders.dart (Run dartfmt to format lib/src/shader/simple_shaders.dart.)
  • lib/src/shader/ssao_shader.dart (Run dartfmt to format lib/src/shader/ssao_shader.dart.)
  • lib/src/shape/cylinder.dart (Run dartfmt to format lib/src/shape/cylinder.dart.)
  • lib/src/shape/torusknot.dart (Run dartfmt to format lib/src/shape/torusknot.dart.)
  • lib/src/shape/tube.dart (Run dartfmt to format lib/src/shape/tube.dart.)

Maintenance issues and suggestions

Provide a file named (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Update (-4 points)

2 image links are insecure (e.g., use https URLs instead.

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 chronosgl.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >= 2.2.0 < 3.0.0
js >=0.6.1 <0.7.0 0.6.1+1
vector_math >=2.0.8 <3.0.0 2.0.8
Dev dependencies
args >=0.13.0
build_daemon >=1.0.0 <2.0.0
build_runner any
build_test any
build_web_compilers any
http >=0.11.3+17
io >=0.3.3
test >=1.5.3
vm_service_client >=0.2.6