WhitestormJS r10. New story. /*Top 7 new changes*/
Today i will tell you about new features of WhitestormJS r10, what we implemented, and what we are going to add in the nearest feature.
First of all, if you don’t know what is WhitestormJS — it is an open source 3D web framework for developing apps and games much easier, because it’s main feature is a simplest ever API. But simple there means also powerful. Framework save your time by doing all the necessary things automitacally for you, in the same time you can easily switch to THREE.js right in your code because Whitestorm.js just wraps it and return same Three.js meshes, objects, cameras, lights.
So, let’s mention some new cool things we did in WhitestormJS since it’s last release:
1. PLAYGROUND
Playground is where you can create a basic whitestormjs app without downloading a WhitestormJS or setting up a project. You can also share your app with others by clicking “share” button and then you can share it in twitter, facebook or just copy to clipboard.
And of course, link to playground
2. SOFTBODIES
Softbody is a type of physics shape. In Bullet Physics which whitestorm.js uses as it’s physics core we have btRigidBody and btSoftBody classes. In web the last one you can find only in Ammo.js which is a direct port of Bullet Physics to javascript. Other javascript physics libraries don’t support softbodies yet.
3. NEW DOCUMENTATION DESIGN
Updating documentation design was maybe the first idea that came into my head after releasing previous version.
The new website is much simpler, provides full documentation for parameters of classes and we also added coffeescript examples.
This part is more like a changelog.
Some small things we’ve also added:
Getting started | section
- Slider that shows similar app written in three.js and whitestorm.js (code difference)
- Environments where whitestorm.js can run (some of them).
Core | section
- Added new classes (Curve, Camera, Object)
- Added information about G_ API.
Shapes | section
- Better explained api.
- Model class added
- Fixes into api. + new features added.
- Tables fixed.
Lights | section
- Same as for shapes (tables fixed, api explained)
Also we added Extras, Cameras and INFO sections.
+ Mobile and tablet support.
+ Offline website. Really. Check it. (Only https://)
4. G_ & M_ API
G_property
In whitestorm.js is possible dynamic geometry updating. It means that you can update whole geometry just by updating it’s property. To update a specific property value you should update attribute which name is G_(your property name). For example: G_radius, G_width, G_segments.
G_() & M_()
If you are going to update multiple geometry parameters you can use G_() method to reduce geometry generation times. Firstly you will apply all parameters and then — build a geometry. Also there is M_() method for updating material available and M_color attribute (because color is in all material types and is common property to update).
5. NEW LOGO
6. VARIATIONS
Now we have whitestorm.js and whitestorm.light.js. Original and light variations of WhitestormJS. What does it mean? Original version of whitestorm is about 2.68 Megabytes. It is because it contains powerful built-in physics libaraty.
But what if you don’t want to use physics?
Thats why we also have light variation. light means “without physics”. It is about 850 Kb. Much smaller, right?
7. FASTER PHYSICS. PERFORMANCE
This time we completely rewritten physics, made it modular and faster. There are some things that can be improved in PhysiJS, and we improved them:
- TypedArrays. They exist in physi.js, but not everywhere. We added them in heightfieldMesh, concaveMesh and convexMesh.
- Caching values into variables.
- Block-scoped variables. Right now we have ability to use ES6 features in chrome and other popular browsers, such as let or const that are block-scoped (not function-scoped).
- Conclusion -
There also are other improvements such as changed controls api, plugin workflow or loader parameter in WHS.Model, but in this topic i described just top 7 main new changes.
In the nearest feature we are also going to add water physics and GPU terrain. I hope you will see them available in next version (r11)