define files

beta.r3js.org
polygonboutique 2016-11-23 11:06:08 +01:00
parent 6baed2483f
commit 1387eb262e
5 changed files with 10 additions and 7 deletions

1
defines/editor.js Normal file
View File

@ -0,0 +1 @@
//#define EDITOR__

1
defines/runtime.js Normal file
View File

@ -0,0 +1 @@
//#define RUNTIME__

View File

@ -62,7 +62,7 @@ gulp.task(
gulp.task('compileRuntime', ['build'],
function() {
gulp.src(['./build/defines/runtime.js', './build/game-lib.js'])
gulp.src(['./defines/runtime.js', './build/game-lib.js'])
.pipe(concat('game-lib-runtime.js'))
.pipe(preprocessor(
{
@ -101,7 +101,7 @@ gulp.task('compileRuntime', ['build'],
gulp.task('compileEditor', ['build'],
function() {
gulp.src(['./build/defines/editor.js', './build/game-lib.js'])
gulp.src(['./defines/editor.js', './build/game-lib.js'])
.pipe(concat('game-lib-editor.js'))
.pipe(preprocessor(
{

View File

@ -47,12 +47,10 @@ GameLib.D3.ComponentPathControls.prototype.onUpdate = function(
this.pathFollowingComponent.offset.x = 0;
this.pathFollowingComponent.offset.y = 0;
this.pathFollowingComponent.offset.z = 1;
// also: set offset scale
} else if (this.keyRightPressed) { // Right [l]
this.pathFollowingComponent.offset.x = 0;
this.pathFollowingComponent.offset.y = 0;
this.pathFollowingComponent.offset.z = -1;
// also: set offset scale
}
};

View File

@ -6,6 +6,7 @@
* @param accel
* @param maxSpeed
* @param baseOffset
* @param maxOffset
* @constructor
*/
GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing(
@ -14,7 +15,8 @@ GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing(
splineCurve3,
accel,
maxSpeed,
baseOffset
baseOffset,
maxOffset
) {
this.id = id || GameLib.D3.Tools.RandomId();
@ -28,15 +30,16 @@ GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing(
this.maxSpeed = maxSpeed || 10.0;
this.accel = accel || 2.0;
this.baseOffset = baseOffset || new GameLib.D3.Vector3();
this.maxOffset = maxOffset || new GameLib.D3.Vector3();
// runtime code
this.offset = new GameLib.D3.Vector3(); // this one is our destination offset
this.currentPathValue = 0.0;
this.offset = new GameLib.D3.Vector3();
this.currentSpeed = 0.0;
this.direction = 0;
GameLib.D3.Utils.Extend(GameLib.D3.ComponentPathFollowing, GameLib.D3.ComponentInterface);
};