Index: samples/o3djs/serialization.js |
=================================================================== |
--- samples/o3djs/serialization.js (revision 19848) |
+++ samples/o3djs/serialization.js (working copy) |
@@ -96,6 +96,20 @@ |
* @type {!Object} |
*/ |
this.createCallbacks = { |
+ 'o3djs.DestinationBuffer': function(deserializer, json) { |
+ var object = deserializer.pack.createObject('o3d.VertexBuffer'); |
+ if ('custom' in json) { |
+ for (var i = 0; i < json.custom.fields.length; ++i) { |
+ var fieldInfo = json.custom.fields[i] |
+ var field = object.createField(fieldInfo.type, |
+ fieldInfo.numComponents); |
+ deserializer.addObject(fieldInfo.id, field); |
+ } |
+ object.allocateElements(json.custom.numElements); |
+ } |
+ return object; |
+ }, |
+ |
'o3d.VertexBuffer': function(deserializer, json) { |
var object = deserializer.pack.createObject('o3d.VertexBuffer'); |
if ('custom' in json) { |