소스 검색

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;