JulienGobin/Babylon.js — pull request #1 by JulienGobin (2014-01-13 09:29:48+00:00)
Title: Camera don't compute their view matrix at each frame anymore

The same has here but without the wireframe stuff :

https://github.com/BabylonJS/Babylon.js/pull/122

(Commit log)

A cache system has been added to BABYLON.Node to be used in BABYLON.Camera like it was already done in BABYLON.Mesh.
The comparisons between the current values and the values of the cache enable to compute the view matrix only when needed like it's done for BABYLON.Mesh.prototype.computeWorldMatrix.

In derived classes, you can override the following functions

- _isSynchronized() method (which returns false if a change is needed)
- _initCache() method (which allows you to init the new variables that you append to cache)
- _updateCache() method (which is called to update the cache after changes detection)

If you override them, do NOT forget to call the parent class function (except for _initCache). See what it is done in BABYLON.Camera.

Warning: pay attention to the "_", do NOT override the public counterpart of these methods: isSynchronized and updateCache

Remark: I didn't override _updateCache in BABYLON.Mesh to avoid modifications in this code. I was not sure to do the right things. Of course, BABYLON.Mesh can override it.

Fixed BABYLON.ArcRotateCamera.prototype._getViewMatrix