Skip to content

Commit 775d78c

Browse files
committed
Add black box JS extension docstring
1 parent 3c238a8 commit 775d78c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

js/src/objects/Blackbox.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
var _ = require('underscore');
22
var BlackboxAutogen = require('./Blackbox.autogen').BlackboxModel;
33

4+
/**
5+
* This object is intended as an extension point. It differs from
6+
* a normal Object3D in that it does not sync back child objects to
7+
* the models. This allows extensions to build sub-scene graphs that
8+
* might not be possible/feasible/desirable to sync.
9+
*
10+
* To implement an extended object based on this:
11+
* - Extend this model
12+
* - Override defaults/serializers as normal for a widget. Remember
13+
* to call the super methods!
14+
* - Override initialize method. Call super, and then put any
15+
* extension code that relies on the THREE object inside
16+
* a "then" to `initPromise:
17+
*
18+
* this.initPromise.then(() => {
19+
* // Do your stuff here
20+
* });
21+
* - If you do not want a basic Object3D as the "root" of your black
22+
* box, you need to override constructThreeObject[Async].
23+
*/
424
var BlackboxModel = BlackboxAutogen.extend({
525

626
defaults: function() {

0 commit comments

Comments
 (0)