Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous Updates from Mars Game #529

Open
wants to merge 20 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cf0e6bb
Now, if there's an error parsing the YAML file, we print some details on
Jan 27, 2015
cd25ccb
Modify raycast results to remove circular references
Jan 20, 2015
fa23885
Return sound instance id rather than instance object
Jan 21, 2015
fde679c
Remove centroid from raycast
Jan 26, 2015
8001a86
Update light target matrix when target property is set.
Jan 29, 2015
911c546
Treat properties with names ending in `$` as private record values only.
davideaster Mar 2, 2015
b98bfff
Optimized kernel.application calls in view/threejs
AmbientOSX Mar 18, 2015
0895c66
Re-apply transparency fix to collada loader
Mar 23, 2015
88f46fa
Enable specular map from specularLevel node
Mar 23, 2015
a742ee0
Use `kernel.prototypes` instead of `getPrototypes` in each driver.
davideaster May 9, 2015
295658b
Remove attempts to follow the driver chain using `kernel.kernel`.
davideaster May 9, 2015
93b784b
No stage/log.
davideaster May 11, 2015
766d963
Optimize `kernel.application`.
davideaster May 11, 2015
f7a38c9
Setting up to be merged into mars-game-dev
AmbientOSX May 12, 2015
076c573
Fix for extending heightmap
Jun 10, 2015
1ed638f
Modify analytic particle solver and convert tabs to spaces
Jul 3, 2015
ba06edd
More fixes to analytic solver
Jul 5, 2015
392e14a
Add a `scene.vwf` `enableRenderer` property.
davideaster Aug 18, 2015
a069a66
Only call notifyDriverOfPrototypeAndBehaviorProps if node and threeOb…
Jan 20, 2016
a79c26b
Merge pull request #531 from virtual-world-framework/branch/notify-dr…
BrettASwift Jan 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/nodejs/serve.js
Expand Up @@ -98,7 +98,8 @@ function ServeYAML( filename, response, URL ) {
try {
var deYAML = JSON.stringify( YAML.load( file ) );
} catch ( e ) {
global.log( "error parsing YAML " + filename );
global.log( "error parsing YAML " + filename);
global.log("" + e);
_404( response );
return;
}
Expand Down
220 changes: 130 additions & 90 deletions support/client/lib/vwf.js

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions support/client/lib/vwf/model/blockly.js
Expand Up @@ -398,18 +398,6 @@ define( [ "module", "vwf/model", "vwf/utility",

} );

function getPrototypes( extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = self.kernel.prototype( id );
}

return prototypes;
}

function isBlockly3Node( nodeID ) {
return self.kernel.test( nodeID,
"self::element(*,'http://vwf.example.com/blockly/controller.vwf')",
Expand Down
14 changes: 1 addition & 13 deletions support/client/lib/vwf/model/buzz.js
Expand Up @@ -112,7 +112,7 @@ define( [
return;
}

var protos = getPrototypes( this.kernel, childExtendsID );
var protos = this.kernel.prototypes( childID );
var node;

if ( this.state.isSoundComponent( protos ) ) {
Expand Down Expand Up @@ -415,18 +415,6 @@ define( [

} );

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function createSound( node, url ) {

var soundProps;
Expand Down
18 changes: 3 additions & 15 deletions support/client/lib/vwf/model/cesium.js
Expand Up @@ -306,7 +306,7 @@ define( [ "module",
}

var node = undefined, parentNode, sceneNode;
var protos = getPrototypes.call( this, childExtendsID );
var protos = this.kernel.prototypes( childID );

var createNode = function() {
return {
Expand Down Expand Up @@ -626,7 +626,7 @@ define( [ "module",
// there, too
function notifyDriverOfPrototypeAndBehaviorProps() {
var ptPropValue;
var protos = getPrototypes.call( self, childExtendsID );
var protos = self.kernel.prototypes( childID );
protos.forEach( function( prototypeID ) {
for ( var propertyName in kernel.getProperties( prototypeID ) ) {
//console.info( " 1 getting "+propertyName+" of: " + childExtendsID );
Expand Down Expand Up @@ -2011,18 +2011,6 @@ define( [ "module",
}


function getPrototypes( extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = this.kernel.prototype( id );
}

return prototypes;
}

function findParent( ID ) {
var retNode = this.state.nodes[ ID ];
if ( retNode === undefined ) {
Expand All @@ -2037,7 +2025,7 @@ define( [ "module",
var protos = undefined;
var parent = findParent.call( this, parentID );
while ( parent && sceneNode === undefined ) {
protos = getPrototypes.call( this, parent.extendsID );
protos = this.kernel.prototypes( parent.ID );
if ( protos && isCesium.call( this, protos ) ) {
sceneNode = parent;
} else {
Expand Down
22 changes: 4 additions & 18 deletions support/client/lib/vwf/model/glge.js
Expand Up @@ -75,7 +75,7 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili

var node, parentNode, glgeChild, glgeParent;
var kernel = this.kernel;
var prototypes = getPrototypes.call( this, kernel, childExtendsID );
var prototypes = this.kernel.prototypes( childID );

// this.logger.enabled = true;
// this.logger.infox( "creatingNode", nodeID, childID, childExtendsID, childImplementsIDs,
Expand Down Expand Up @@ -328,7 +328,7 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
// there, too
function notifyDriverOfPrototypeAndBehaviorProps() {
var ptPropValue;
var protos = getPrototypes.call( this, kernel, childExtendsID );
var protos = self.kernel.prototypes( childID );
protos.forEach( function( prototypeID ) {
for ( var propertyName in kernel.getProperties( prototypeID ) ) {
//console.info( " 1 getting "+propertyName+" of: " + childExtendsID );
Expand Down Expand Up @@ -620,7 +620,7 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
break;

default:
prototypes = getPrototypes.call( this, this.kernel.kernel.kernel, node["type"] );
prototypes = this.kernel.prototypes( node.ID );
if ( isGlgeMaterialDefinition.call( this, prototypes ) ){
value = setMaterialProperty.call( this, nodeID, propertyName, propertyValue );
} else if ( isGlgeCameraDefinition.call( this, prototypes ) ) {
Expand Down Expand Up @@ -773,7 +773,7 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili

default:
// handle all of the other types
prototypes = getPrototypes.call( this, this.kernel.kernel.kernel, node["type"] );
prototypes = this.kernel.prototypes( node.ID );
if ( isGlgeMaterialDefinition.call( this, prototypes ) ){
value = getMaterialProperty.call( this, nodeID, propertyName, propertyValue );
} else if ( isGlgeCameraDefinition.call( this, prototypes ) ) {
Expand Down Expand Up @@ -2222,20 +2222,6 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
return vertexIndices;
}

// get the list of types this ID extends

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function isPrototype( nodeID, childID ) {
var ptID;
if ( ( nodeID == 0 && childID != this.kernel.application() ) || this.state.prototypes[ nodeID ] !== undefined ) {
Expand Down
16 changes: 1 addition & 15 deletions support/client/lib/vwf/model/graphtool.js
Expand Up @@ -20,7 +20,6 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
self = this;
this.state.graphs = {};
this.state.objects = {};
this.state.kernel = this.kernel.kernel.kernel;
},

// == Model API ============================================================================
Expand All @@ -31,8 +30,7 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
childSource, childType, childIndex, childName, callback /* ( ready ) */ ) {

var node = undefined;
var kernel = this.state.kernel;
var protos = getPrototypes.call( this, kernel, childExtendsID );
var protos = this.kernel.prototypes( childID );

if ( protos && isGraph( protos ) ) {

Expand Down Expand Up @@ -318,18 +316,6 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
return threejs;

}

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function isGraph( prototypes ) {

Expand Down
16 changes: 2 additions & 14 deletions support/client/lib/vwf/model/heightmap.js
Expand Up @@ -18,14 +18,14 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili
creatingNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
childSource, childType, childIndex, childName, callback ) {

var protos = getPrototypes( this.kernel, childExtendsID );
var protos = this.kernel.prototypes( childID );

if ( isHeightmap( protos ) ) {

var node = this.nodes[ childID ];

// Create the local copy of the node properties
if ( this.nodes[ childID ] === undefined ){
if ( this.nodes[ childID ] === undefined && childSource !== undefined ){

// Suspend the queue until the load is complete
callback( false );
Expand Down Expand Up @@ -86,18 +86,6 @@ define( [ "module", "vwf/model", "vwf/utility" ], function( module, model, utili

} );

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function isHeightmap( prototypes ) {
var found = false;
if ( prototypes ) {
Expand Down
14 changes: 1 addition & 13 deletions support/client/lib/vwf/model/jPlayer.js
Expand Up @@ -120,7 +120,7 @@ define( [
return;
}

var protos = getPrototypes( this.kernel, childExtendsID );
var protos = this.kernel.prototypes( childID );

var isAudioManager = this.state.isAudioManager( protos );
var isVideoManager = this.state.isVideoManager( protos );
Expand Down Expand Up @@ -342,18 +342,6 @@ define( [

} );

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function setWithPrototypeProperties( proto ) {
if ( proto.url !== null ) {
vwf.setProperty( node.ID, "url", proto.url );
Expand Down
14 changes: 1 addition & 13 deletions support/client/lib/vwf/model/kineticjs.js
Expand Up @@ -118,7 +118,7 @@ define( [ "module",
return;
}

var protos = getPrototypes( this.kernel, childExtendsID );
var protos = this.kernel.prototypes( childID );

var node;

Expand Down Expand Up @@ -2097,18 +2097,6 @@ define( [ "module",
} );
// == PRIVATE ========================================================================================

function getPrototypes( kernel, extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = kernel.prototype( id );
}

return prototypes;
}

function createKineticObject( node, config ) {
var protos = node.prototypes;
var kineticObj = undefined;
Expand Down
14 changes: 1 addition & 13 deletions support/client/lib/vwf/model/mil-sym.js
Expand Up @@ -106,7 +106,7 @@ define( [ "module",
return;
}

var protos = getPrototypes( childExtendsID );
var protos = this.kernel.prototypes( childID );
var node = this.state.nodes[ childID ];

if ( node === undefined ) {
Expand Down Expand Up @@ -424,18 +424,6 @@ define( [ "module",

} );

function getPrototypes( extendsID ) {
var prototypes = [];
var id = extendsID;

while ( id !== undefined ) {
prototypes.push( id );
id = modelDriver.kernel.prototype( id );
}

return prototypes;
}

function isUnitNode( prototypes ) {
var found = false;
if ( prototypes ) {
Expand Down
3 changes: 2 additions & 1 deletion support/client/lib/vwf/model/sound.js
Expand Up @@ -356,8 +356,9 @@ define( [ "module", "vwf/model" ], function( module, model ) {
}

if ( !this.allowMultiplay && this.isPlaying() ) {
var instance = Object.keys( this.playingInstances )[ 0 ];
return { soundName: this.name,
instanceID: this.playingInstances[ 0 ] };
instanceID: this.playingInstances[ instance ].id };
}

var id = this.instanceIDCounter;
Expand Down