sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

Assignment to Jax.Camera#rotation does not fire `matrixUpdated` event #87

Closed sinisterchipmunk closed 11 years ago

sinisterchipmunk commented 11 years ago

Assume we want to assign a quaternion directly to a camera, instead of rotating our way into the desired state:

@model.camera.rotation = [0.215122, 0.907300, 0.328824, 0.149720]

This does not fire the internal matrixUpdated event which is used to recalculate the relevant matrices, and anything else based on changing camera state (its frustum, for example).

A workaround is to fire the event manually:

@model.camera.rotation = [0.215122, 0.907300, 0.328824, 0.149720]
@model.camera.fireEvent 'matrixUpdated'
sinisterchipmunk commented 11 years ago

Should be fixed in the new Jax.Camera, and if not, it's invalid due to a different API and internal logic. A new issue can be opened if similar issues arise.