Jump to content

Cannon.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by I dream of horses (talk | contribs) at 07:50, 13 May 2017 (clean up, added orphan tag using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Cannon.js
Developer(s)Stefan Hedman
Repository
Written inJavaScript
Operating systemOS independent
Type3D physics engine
LicenseMIT License
Websitewww.cannonjs.org

Cannon.js is an open source JavaScript 3D physics engine created by Stefan "schteppe" Hedman.[1] Unlike physics engine libraries ported from C++ to Javascript, cannon.js is written in Javascript from the start and can take advantage of its features.[2] In a 2013 comparison with Ammo.js, cannon.js was found to be "more compact, more comprehensible, more powerful with regard to its performance and also easier to understand", but did not have as many features.[3]

Features

Cannon.js supports the following shapes: sphere, plane, box, cylinder, convex polyhedron, particle, and heightfield. This collection of shapes matches the collection used by rendering engines such as Three.js and Babylon, but is not complete. For example, it is not sufficient for X3DOM,[3] an application of X3D which allows 3D graphics to be included in web pages without the need for a plug-in.[4]

The physics engine implements rigid-body dynamics, discrete collision detection, and a Gauss-Seidel constraint solver.[5] It can perform cloth simulation[6]

Cannon.js can be used with Three.js and Babylon.js[7][8] WebGL renderers to generate physics-based 3D scenes. It can also be used to provide networked-physics synchronization for multiplayer online games using Lance.gg[9]

References

  1. ^ "Stefan Hedman". GitHub. Retrieved 27 April 2017.
  2. ^ Prall, Chandler (10 April 2012). "JavaScript Physics Engines Comparison". Build New Games. Retrieved 27 April 2017.
  3. ^ a b Huber, Linda (2013). "Initial Steps for the Coupling of JavaScript Physics Engines with X3DOM". Workshop on Virtual Reality Interaction and Physical Simulation (VRIPHYS 2013). The Eurographics Association. pp. 81–90. doi:10.2312/PE.vriphys.vriphys13.081-090. ISBN 978-3-905674-57-6. {{cite book}}: Unknown parameter |editors= ignored (|editor= suggested) (help)
  4. ^ "Background: What is X3DOM, and what can it do for me?". official x3dom documentation. x3dom.org. Retrieved 27 April 2017.
  5. ^ "Branch: master. cannon.js/README.markdown". GitHub. 22 April 2015. Retrieved 27 April 2017.
  6. ^ "Cloth physics simulation".
  7. ^ "Create wonderful interactive games for the web: Using webgl and a physics engine (babylon.js & cannon.js)". Retrieved 21 February 2017.
  8. ^ "MSDN Game Development with Babylon.js". Retrieved 21 February 2017.
  9. ^ "Lance source repository".