Support spatial lookup of assets
-
lindsay.kay (at xeolabs)
Assets should not be provided in its actual responses to Sockets - potentially it might be supplying the whole massive scene if the viewpoint was far enough back and localities were wide enough. Instead, it should provide references to assets, for the client to pull asynchronously.
Bad Idea
{ /* Target node SID path: */ "#root/alpha": { /* Maps to node's addNode method: */ "+node" : SceneJS.node({ sid: "asset789" }, // Note the asset ID SceneJS.rotate({ angle: 45, y: 1.0 }, SceneJS.translate({ x: 100 }, SceneJS.objects.teapot()))) } }Better Idea
SceneJS.kdAsset is an extension node for asset server kd-tree client scenes, which will be defined alongside the client Socket subtree within a SceneJS content module. It will asynchronously pull the asset from the server using JSONP.
{ /* Target node SID path: */ "#root/alpha": { /* Maps to node's addNode method: */ "+node" : SceneJS.kdAsset({ uri: "http://assets.scenejs.org?cmd=getAsset&id=org.scenejs.models.myTeapot" }) } }
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.