浏览代码

TimerNode add DELTA scope

sunag 7 年之前
父节点
当前提交
6ccb95763f
共有 1 个文件被更改,包括 7 次插入0 次删除
  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;