Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/nodes/accessors/InstanceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,23 @@ class InstanceNode extends Node {
*/
this.instanceColorNode = null;

/**
* The update type is set to `frame` for updating
* velocity-related data.
*
* @type {string}
* @default 'frame'
*/
this.updateType = NodeUpdateType.FRAME;

/**
* The update type is set to `frame` since an update
* of instanced buffer data must be checked per frame.
*
* @type {string}
* @default 'frame'
*/
this.updateType = NodeUpdateType.FRAME;
this.updateBeforeType = NodeUpdateType.FRAME;

/**
* A reference to a buffer that is used by `instanceMatrixNode`.
Expand Down Expand Up @@ -220,7 +229,7 @@ class InstanceNode extends Node {
*
* @param {NodeFrame} frame - The current node frame.
*/
update( frame ) {
updateBefore( /*frame*/ ) {

if ( this.buffer !== null && this.isStorageMatrix !== true ) {

Expand Down Expand Up @@ -250,6 +259,15 @@ class InstanceNode extends Node {

}

}

/**
* Updates velocity-related data if necessary.
*
* @param {NodeFrame} frame - The current node frame.
*/
update( frame ) {

if ( this.previousInstanceMatrixNode !== null ) {

frame.object.previousInstanceMatrix.array.set( this.instanceMatrix.array );
Expand Down
Loading