WhitestormJS
Original author(s) | Alexander Buzin (sasha240100) [1] |
---|---|
Developer(s) | WhitestormJS community [2] |
Stable release |
v0.11.1
|
Development status | Active |
Written in | JavaScript |
Type | JavaScript library |
License | MIT License[3] |
Website |
whsjs |
Whitestorm.js is a 3D JavaScript library/API based on Three.js that simplify code, adds physics and post-effects. The source code is hosted in a repository on GitHub.
Overview
WhitestormJS is a framework for 3D web apps built with Three.js technology. It implements a core with component system and plugin support for fast development of 3D scene with physics. Automizing your web app with whitestorm is fast and comfortable. This engine has physics support implemented by custom Physi.js library, which is much faster than others. Framework provides extended component control and high frame rate, because it uses WebWorkers technology for multithreading.
Features
Whitestorm.js includes the following features:[4]
- Simple shape crafting — We use a JSON-like structure for creating objects from inputted data and adding them to your 3D world.
- Physics with WebWorkers — We use the Physi.js library for calculating physics of 3D shapes with WebWorkers technology that allows for rendering and calculating physics in multiple threads.
- Plugin system — Our framework supports plugins & components made by other users. You need to include them after whitestorm.js and follow provided instructions.
- Automatization of rendering — Our framework does rendering automatically and doesn't need a to be called. Functionality like the resize function can be called automatically by setting additional parameters such as autoresize: true.
- ES6 Features - Our framework is written using the latest features of ECMAScript 6 and ECMAScript 7 (beta) features and compiled with Babel.
- Softbodies - WhitestormJS is the only engine (except native ammo.js) that supports softbodies.
Whitestorm.js is made available under the MIT license.[3]
Usage
NODE
npm install whitestormjs
BROWSER
Include a script tag linking the WhitestormJS library in your head or after your body:
- It is advised to download your own copies of the following libraries, as large changes can break backwards compatibility.
The Whitestorm.js library is a single JavaScript file. Include Three.js, Wagner, and Cannon.js libraries before Whitestorm.js. Include a script tag linking the WhitestormJS library in your head or after your body:
<script src="{path_to_lib}/whitestorm.js"></script>
After adding these libraries, you can configure your game:
const world = new WHS.World({
stats: "fps", // fps, ms, mb or false if not need.
autoresize: true,
gravity: { // Physic gravity.
x: 0,
y: -100,
z: 0
},
camera: {
z: 50 // Move camera.
}
});
const sphere = new WHS.Sphere({ // Create sphere object.
geometry: {
radius: 3
},
mass: 10, // Mass of physics object.
material: {
color: 0xffffff,
kind: 'basic'
},
pos: {
x: 0,
y: 100,
z: 0
}
});
sphere.addTo(GAME);
sphere.getNative(); // Returns THREE.Mesh of this object.
world.start(); // Start animations and physics simulation.
References
- ↑ https://github.com/WhitestormJS
- 1 2 MIT License
- ↑ sasha240100. "Features".
External links
- WhitestormJS - Three.js Based Game Engine - Interview with Alexander Buzin
- Documentation
- Github repository.
- Github Organization.
- Issues.
- Examples
- Blog
Category:2010 software Category:3D scenegraph APIs Category:Cross-platform software Category:Free 3D graphics software Category:Graphics libraries Category:JavaScript libraries Category:Software using the MIT license Category:WebGL