Explorar o código

TimerNode add DELTA scope

sunag %!s(int64=7) %!d(string=hai) anos
pai
achega
6ccb95763f
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      examples/js/nodes/utils/TimerNode.js

+ 7 - 0
examples/js/nodes/utils/TimerNode.js

@@ -13,6 +13,7 @@ THREE.TimerNode = function ( scope, scale ) {
 
 THREE.TimerNode.GLOBAL = 'global';
 THREE.TimerNode.LOCAL = 'local';
+THREE.TimerNode.DELTA = 'delta';
 
 THREE.TimerNode.prototype = Object.create( THREE.FloatNode.prototype );
 THREE.TimerNode.prototype.constructor = THREE.TimerNode;
@@ -28,6 +29,12 @@ THREE.TimerNode.prototype.updateFrame = function ( frame ) {
 
 			break;
 
+		case THREE.TimerNode.DELTA:
+
+			this.number = frame.delta * this.scale;
+
+			break;
+
 		default:
 
 			this.number = frame.time * this.scale;