Node dynamic config callbacks should execute on Node's scope
Reported by lindsay.kay (at xeolabs) | August 7th, 2010 @ 02:50 AM | in V0.7.7
Nodes can be configured with callbacks, like this Rotate node that gets it's angle property off the data scope:
SceneJS.rotate(function(data) {
return { angle: data.get('pitch'), 1.0 };
}
The mechanism within the nodes for converting the callback's result into properties is actually a bit of a runtime bottleneck on each node. Plus, it's no quite clear that whats going on in terms of what properties are actually being set on the node.
We could just call the callback on the Node scope, then just drive the node's setters inside of it, like this:
SceneJS.rotate(function(data) {
this.setAngle(data.get('pitch'));
this.setX(1.0);
},
Here we can see exactly where on the node each element of the data is going. Plus, we can flag node state updates inside node setters.
Comments and changes to this ticket
-
lindsay.kay (at xeolabs) August 7th, 2010 @ 03:39 AM
- State changed from new to resolved
This is part of the plan for on-demand FPS : https://xeolabs.lighthouseapp.com/projects/50643/tickets/137-fps-on...
The idea is to more clearly define those channels through which scene state changes occur so we can determine need for the next frame render.
-
lindsay.kay (at xeolabs) August 31st, 2010 @ 10:41 AM
- State changed from resolved to invalid
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.