xeolabs / scenejs

An extensible WebGL-based 3D engine. This is an archived project.
https://xeolabs.github.io/scenejs/
Other
649 stars 165 forks source link

Fix compilation of transform nodes #484

Closed tsherif closed 8 years ago

tsherif commented 8 years ago

This fixes a bug that caused transform nodes to break on scenes that dynamically update the scene graph in significant ways. The key issue is that when a transform node of any sort was compiled, it would push its core onto the xform stack, which would clear all of the core's children. The problem is that if any of those children were from node branches that hadn't been marked as dirty (and thus aren't set to be compiled), they would not be re-pushed onto the stack. The transforms they represented would be lost.

This solution involves a few changes to how transform nodes are handled:

@xeolabs, let me know if you see any issues with this approach.