Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-bateman committed Oct 23, 2014
1 parent 9be360f commit 325415f
Show file tree
Hide file tree
Showing 282 changed files with 71,874 additions and 0 deletions.
10,413 changes: 10,413 additions & 0 deletions build/awayjs-display.d.ts

Large diffs are not rendered by default.

18,375 changes: 18,375 additions & 0 deletions build/awayjs-display.js

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions build/awayjs-display.js.map

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
var concat = require('gulp-concat');
var gulp = require('gulp');
var changed = require('gulp-changed');
var glob = require('glob');
var path = require('path');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var map = require('vinyl-map');
var exorcist = require('exorcist');
var sourcemaps = require('gulp-sourcemaps');

var typescript = require('gulp-typescript');

gulp.task('compile', function() {
var tsProject = typescript.createProject({
declarationFiles: true,
noExternalResolve: true,
target: 'ES5',
module: 'commonjs',
sourceRoot: './awayjs-display/lib'
});

var ambientWrap = map(function(code, filename) {
code = code.toString();
code = 'declare module "' + path.relative('../', filename.slice(0,-5)) + '" {\n\t'
+ code.split('declare ').join('').split('\n').join('\n\t') + "\n"
+ '}';
return code;
});

var tsResult = gulp.src(['./lib/**/*.ts', './node_modules/awayjs-**/build/*.d.ts'])
.pipe(sourcemaps.init())
.pipe(typescript(tsProject));

tsResult.dts
.pipe(ambientWrap)
.pipe(concat('awayjs-display.d.ts'))
.pipe(gulp.dest('./build'));

return tsResult.js
.pipe(sourcemaps.write({sourceRoot: '../'}))
.pipe(gulp.dest('./lib'));
});

gulp.task('watch', ['package'], function() {
gulp.watch('./lib/**/*.ts', ['package']);
});

gulp.task('package', ['compile'], function(callback){
var b = browserify({
debug: true,
paths: ['../']
});

glob('./node_modules/awayjs-**/lib/**/*.js', {}, function (error, files) {
files.forEach(function (file) {
b.external(file);
});
});

glob('./lib/**/*.js', {}, function (error, files) {

files.forEach(function (file) {
b.require(file, {expose:path.relative('../', file.slice(0,-3))});
});

b.bundle()
.pipe(exorcist('./build/awayjs-display.js.map'))
.pipe(source('awayjs-display.js'))
.pipe(gulp.dest('./build'))
.on('end', callback);
});
});

gulp.task('tests', function () {

var tsProject = typescript.createProject({
declarationFiles: true,
noExternalResolve: true,
target: 'ES5',
module: 'commonjs',
sourceRoot: './'
});

var tsResult = gulp.src(['./tests/**/*.ts', './node_modules/awayjs-**/build/*.d.ts', './build/awayjs-display.d.ts'])
//.pipe(changed('./tests', {extension:'.js', hasChanged: changed.compareLastModifiedTime}))
.pipe(sourcemaps.init())
.pipe(typescript(tsProject));

return tsResult.js
.pipe(sourcemaps.write({sourceRoot: './tests'}))
.pipe(gulp.dest('./tests'));
});
3 changes: 3 additions & 0 deletions lib/animators/IAnimationSet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions lib/animators/IAnimationSet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import IAsset = require("awayjs-core/lib/library/IAsset");

import AnimationNodeBase = require("awayjs-display/lib/animators/nodes/AnimationNodeBase");

/**
* Provides an interface for data set classes that hold animation data for use in animator classes.
*
* @see away.animators.AnimatorBase
*/
interface IAnimationSet extends IAsset
{
/**
* Check to determine whether a state is registered in the animation set under the given name.
*
* @param stateName The name of the animation state object to be checked.
*/
hasAnimation(name:string):boolean;

/**
* Retrieves the animation state object registered in the animation data set under the given name.
*
* @param stateName The name of the animation state object to be retrieved.
*/
getAnimation(name:string):AnimationNodeBase;

/**
* Indicates whether the properties of the animation data contained within the set combined with
* the vertex registers aslready in use on shading materials allows the animation data to utilise
* GPU calls.
*/
usesCPU:boolean; // GET

/**
* Called by the material to reset the GPU indicator before testing whether register space in the shader
* is available for running GPU-based animation code.
*
* @private
*/
resetGPUCompatibility();

/**
* Called by the animator to void the GPU indicator when register space in the shader
* is no longer available for running GPU-based animation code.
*
* @private
*/
cancelGPUCompatibility();
}

export = IAnimationSet;
3 changes: 3 additions & 0 deletions lib/animators/IAnimator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions lib/animators/IAnimator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import IAsset = require("awayjs-core/lib/library/IAsset");

import IAnimationSet = require("awayjs-display/lib/animators/IAnimationSet");
import SubGeometryBase = require("awayjs-display/lib/base/SubGeometryBase");
import IRenderable = require("awayjs-display/lib/pool/IRenderable");
import IEntity = require("awayjs-display/lib/entities/IEntity");
import IMaterialPass = require("awayjs-display/lib/materials/passes/IMaterialPass");

/**
* Provides an interface for animator classes that control animation output from a data set subtype of <code>AnimationSetBase</code>.
*
* @see away.animators.IAnimationSet
*/
interface IAnimator extends IAsset
{
/**
*
*/
animationSet:IAnimationSet;

/**
*
*/
clone():IAnimator;

/**
*
*/
dispose();

/**
* Used by the entity object to which the animator is applied, registers the owner for internal use.
*
* @private
*/
addOwner(mesh:IEntity);

/**
* Used by the mesh object from which the animator is removed, unregisters the owner for internal use.
*
* @private
*/
removeOwner(mesh:IEntity);

/**
* //TODO
*
* @param sourceSubGeometry
*/
getRenderableSubGeometry(renderable:IRenderable, sourceSubGeometry:SubGeometryBase):SubGeometryBase;
}

export = IAnimator;
46 changes: 46 additions & 0 deletions lib/animators/nodes/AnimationNodeBase.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions lib/animators/nodes/AnimationNodeBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import AssetType = require("awayjs-core/lib/library/AssetType");
import IAsset = require("awayjs-core/lib/library/IAsset");
import NamedAssetBase = require("awayjs-core/lib/library/NamedAssetBase");

/**
* Provides an abstract base class for nodes in an animation blend tree.
*/
class AnimationNodeBase extends NamedAssetBase implements IAsset
{
public _pStateClass:any;

public get stateClass():any
{
return this._pStateClass;
}

/**
* Creates a new <code>AnimationNodeBase</code> object.
*/
constructor()
{
super();
}

/**
* @inheritDoc
*/
public dispose()
{
}

/**
* @inheritDoc
*/
public get assetType():string
{
return AssetType.ANIMATION_NODE;
}
}

export = AnimationNodeBase;
19 changes: 19 additions & 0 deletions lib/base/AlignmentMode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions lib/base/AlignmentMode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
*
*/
class AlignmentMode
{
/**
*
*/
public static REGISTRATION_POINT:string = "registrationPoint";

/**
*
*/
public static PIVOT_POINT:string = "pivot";
}

export = AlignmentMode;
Loading

0 comments on commit 325415f

Please sign in to comment.