diff --git a/build/tquery-bundle-require.js b/build/tquery-bundle-require.js index 3ce7a279..133ecd4f 100644 --- a/build/tquery-bundle-require.js +++ b/build/tquery-bundle-require.js @@ -37788,6 +37788,7 @@ tQuery.mixinAttributes(tQuery.MeshPhongMaterial, { tQuery.Geometry.registerInstance('computeAll', function(){ this.each(function(tGeometry){ + tGeometry.computeBoundingSphere(); tGeometry.computeBoundingBox(); //tGeometry.computeCentroids(); tGeometry.computeFaceNormals(); diff --git a/build/tquery-bundle.js b/build/tquery-bundle.js index 3fe0a8d8..d9c91e04 100644 --- a/build/tquery-bundle.js +++ b/build/tquery-bundle.js @@ -37788,6 +37788,7 @@ tQuery.mixinAttributes(tQuery.MeshPhongMaterial, { tQuery.Geometry.registerInstance('computeAll', function(){ this.each(function(tGeometry){ + tGeometry.computeBoundingSphere(); tGeometry.computeBoundingBox(); //tGeometry.computeCentroids(); tGeometry.computeFaceNormals(); diff --git a/build/tquery.js b/build/tquery.js index 847a2bef..c4135ce1 100644 --- a/build/tquery.js +++ b/build/tquery.js @@ -2163,6 +2163,7 @@ tQuery.mixinAttributes(tQuery.MeshPhongMaterial, { tQuery.Geometry.registerInstance('computeAll', function(){ this.each(function(tGeometry){ + tGeometry.computeBoundingSphere(); tGeometry.computeBoundingBox(); //tGeometry.computeCentroids(); tGeometry.computeFaceNormals(); diff --git a/plugins/iim3dcharacter/examples/index.html b/plugins/iim3dcharacter/examples/index.html index d9db23fc..26cdb81c 100644 --- a/plugins/iim3dcharacter/examples/index.html +++ b/plugins/iim3dcharacter/examples/index.html @@ -150,7 +150,7 @@ context.fillText(text, 8+(16*x), 28+(28*y)); } print(1,1, "Hello") - print(1,3, "GameDevConf!"); + print(1,3, "Afig 2012!"); diff --git a/plugins/nonplayablechar/dialogtree.js/NOTES.md b/plugins/nonplayablechar/dialogtree.js/NOTES.md deleted file mode 100644 index 0737dae7..00000000 --- a/plugins/nonplayablechar/dialogtree.js/NOTES.md +++ /dev/null @@ -1,52 +0,0 @@ -# note about dialog tree -* how to code it -* how to test it - -### how to test it -* no need for 3d -* so display somehitng on tty with node - * or in js console with function to answer - *2 runnerConsole runnerTty - -### Misc -* this is a graph -* each node is a exchange in the conversation - -What is a node ? -* bot can say something -* player got multiple choises to pick -* depending on player choise, we go to the next node -* if there are no more children, the conversation is over - - -#### node data structure: -* string are template "Hello <%= playername %>" - -{ - identifier : "blabla", - botText : "Hello superplayer" - children: [ - { - playerText : "Hi", - nextNode : - "anIdentifier" - | { - botText : 'call me bill' - } - | function(){ return aNode; } - }, - { - playerText : "Hi", - }, - ] -} - - -#### issue in data representation: -* to edit that in a text file is doable but very inconfortable -* it is ok on very short/simple conversation -* for longer one, a graphical editor is likely needed - * how to do it easily - * is there a easy way to do that - - diff --git a/plugins/nonplayablechar/dialogtree.js/README.md b/plugins/nonplayablechar/dialogtree.js/README.md deleted file mode 100644 index 16876605..00000000 --- a/plugins/nonplayablechar/dialogtree.js/README.md +++ /dev/null @@ -1,2 +0,0 @@ -dialogtree.js - clean and simple implementation of dialog tree in javascript - diff --git a/plugins/nonplayablechar/dialogtree.js/TODO.md b/plugins/nonplayablechar/dialogtree.js/TODO.md deleted file mode 100644 index 34fe7780..00000000 --- a/plugins/nonplayablechar/dialogtree.js/TODO.md +++ /dev/null @@ -1,2 +0,0 @@ -* make text as template - * string are template "Hello <%= playername %>" diff --git a/plugins/nonplayablechar/dialogtree.js/datadialog.json b/plugins/nonplayablechar/dialogtree.js/datadialog.json deleted file mode 100644 index 3905584e..00000000 --- a/plugins/nonplayablechar/dialogtree.js/datadialog.json +++ /dev/null @@ -1,64 +0,0 @@ -[ - { - "nodeId" : "initialQuestion", - "botText" : "hello, how are you ?", - "answers" : [ - { - "text" : "fine! and you ?", - "nextNodeId" : "nodeHappyDay" - }, - { - "text" : "I have a terrible day...", - "nextNodeId" : "nodeBadDay" - } - ] - }, - { - "nodeId" : "nodeHappyDay", - "botText" : "me too! how can i help you ?", - "answers" : [ - { - "text" : "Just be happy, it is enougth for me!", - "nextNodeId" : null - }, - { - "text" : "You can help me kill one guy, i need cash!", - "nextNodeId" : "nodeAboutToDie" - }, - ], - }, - { - "nodeId" : "nodeBadDay", - "botText" : "oh really ? sad to hear that. How come ?", - "answers" : [ - { - "text" : "i mistune my clock so i missed my train... ", - "nextNodeId" : "nodeNoClock" - }, - { - "text" : "im gonna die today. i know it", - "nextNodeId" : "nodeAboutToDie" - }, - ], - }, - { - "nodeId" : "nodeNoClock", - "botText" : "You looser you dont even know how to tune a clock. how ridicous, steer away", - "answers" : [ - { - "text" : "you are so unfair!", - "nextNodeId" : null - }, - ], - }, - { - "nodeId" : "nodeAboutToDie", - "botText" : "You seems like dangerous to be around. So Long.", - "answers" : [ - { - "text" : "ah ? well see ya", - "nextNodeId" : null - } - ] - }, -] \ No newline at end of file diff --git a/plugins/nonplayablechar/dialogtree.js/dialogtree.js b/plugins/nonplayablechar/dialogtree.js/dialogtree.js deleted file mode 100644 index abd3c20f..00000000 --- a/plugins/nonplayablechar/dialogtree.js/dialogtree.js +++ /dev/null @@ -1,119 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////// -// DialogTree // -////////////////////////////////////////////////////////////////////////////////// - -/** - * implement dialog tree - * @class dialog tree - */ -var DialogTree = function(){ - this._nodes = []; - this._nodeId = null; -} - -// export the class in node.js - if running in node.js -if( typeof(window) === 'undefined' ) module.exports = DialogTree; - -/** - * initialize the tree with jsonData - * - * @param {Object} jsonData the dialog tree to ini - */ -DialogTree.prototype.initFromJSON = function(jsonData, initialNodeId){ - // handle polymorphism - initialNodeId = initialNodeId || jsonData[0].nodeId; - // copy parameter - this._nodes = jsonData; - this._nodeId = initialNodeId; - // check the result - console.assert( this._isValid() ); -}; - -/** - * Check if current dialog tree is valid - * - * @todo TO WRITE - * @return {Boolean} true if the tree is valid, false otherwise - */ -DialogTree.prototype._isValid = function(){ - // check that current nodeId exist - console.assert( this._nodeFromId(this._nodeId) ); - // check each node - this._nodes.forEach(function(node){ - // ensure there is a .nodeId - console.assert(node.nodeId); - node.answers.forEach(function(answer){ - // if there are no nextNodeId, return now - if( !answer.nextNodeId ) return; - // check this nodeId actually exists - var nextNodeId = answer.nextNodeId; - console.assert( this._nodeFromId(nextNodeId), 'undefined nodeId: '+nextNodeId ); - }.bind(this)); - }.bind(this)); - // TODO not yet implemented - return true; -}; - - -/** - * get node from nodeId - * @param {String} nodeId the id of the node to get - * @return {Object|null} the node just found, or null if not found - */ -DialogTree.prototype._nodeFromId = function(nodeId) { - for(var i = 0; i < this._nodes.length; i++){ - var node = this._nodes[i] - if( node.nodeId === nodeId ) return node; - } - return null; -}; - -/** - * node getter - * @param {String} [nodeId] the node id to get. Default to this._nodeId - * @return {Object|null} the node just found, or null if not found - */ -DialogTree.prototype.node = function(nodeId){ - // handle polymorphism - nodeId = nodeId || this._nodeId; - // get the node - var node = this._nodeFromId(nodeId); - // return node - return node; -}; - -/** - * Getter/Setter for nodeId - * @param {String} [value] the value to use for the setter if provided, - * @return {String|DialogTree} the value of the node it if getter, chained API for setter - */ -DialogTree.prototype.nodeId = function(value) { - if( value === undefined ) return this._nodeId; - this._nodeId = value; - // check the result - console.assert( this._isValid() ); - return this; -}; - -DialogTree.prototype.answer = function(answerIdx){ - console.assert(answerIdx < this.node().answers.length, "answerIdx too high"); - var node = this.node(); - var answer = node.answers[answerIdx]; - this._nodeId = answer.nextNodeId; - return this._node; -}; - -////////////////////////////////////////////////////////////////////////////////// -// Helpers // -////////////////////////////////////////////////////////////////////////////////// - -/** - * Creator for DialogTree - * @param {Object} jsonData the json object - * @return {DialogTree} the just-created DialogTree - */ -DialogTree.fromJSON = function(jsonData){ - var dialogTree = new DialogTree(); - dialogTree.initFromJSON(jsonData); - return dialogTree -}; diff --git a/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.html b/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.html deleted file mode 100644 index 2d24c8ac..00000000 --- a/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -

- There is a dialog happening in your js console. -

- use 'answer(number)' to answer. - For example, use 'answer(1);' to pick the answer one - - - diff --git a/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.js b/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.js deleted file mode 100644 index e8993187..00000000 --- a/plugins/nonplayablechar/dialogtree.js/dialogtreerunnerconsole.js +++ /dev/null @@ -1,51 +0,0 @@ -var DialogTreeRunnerConsole = function(dialogTree){ - this._dialogTree = dialogTree; - this._nodesHistory = []; -} - -/** - * load synchronoulsy the dialogtree from the url - * @param {String} url the url for the dialogtree in json - * @return {DialogTreeRunnerConsole} for chained API - */ -DialogTreeRunnerConsole.prototype.loadSync = function(url) { - // load the json - var request = new XMLHttpRequest(); - request.open('GET', url, false); - request.send(); - console.assert( request.status === 200 ); - var jsonData = eval(request.responseText); - // init the dialogtree - this._dialogTree= DialogTree.fromJSON(jsonData); - // return this - return this; -}; - -DialogTreeRunnerConsole.prototype.dialogTree = function() { - return this._dialogTree; -}; - -DialogTreeRunnerConsole.prototype.displayNode = function() { - var node = this._dialogTree.node(); - console.log('BOT:', node.botText); - node.answers.forEach(function(answer, answerIdx){ - console.log('Answer '+ answerIdx + ': ' + answer.text + (answer.nextNodeId ? '' : ' [end]')) - }); -}; - -DialogTreeRunnerConsole.prototype.back = function(){ - var dialogTree = this._dialogTree; - if(this._nodesHistory.length === 0) return; - var nodeId = this._nodesHistory.pop(); - dialogTree.nodeId(nodeId); -}; - -DialogTreeRunnerConsole.prototype.answer = function(answerIdx) { - var dialogTree = this._dialogTree; - // update nodesHistory - this._nodesHistory.push( dialogTree.nodeId() ); - // notify the answer to DialogTree - dialogTree.answer(answerIdx); - // display new dialogNode if - if( !dialogTree.node() ) console.log('This conversation is now over') -}; \ No newline at end of file diff --git a/plugins/nonplayablechar/examples/index.html b/plugins/nonplayablechar/examples/index.html index b2484316..921895b5 100644 --- a/plugins/nonplayablechar/examples/index.html +++ b/plugins/nonplayablechar/examples/index.html @@ -24,6 +24,5 @@ world.loop().hook(function(delta, now){ npc.update(); }) - }); \ No newline at end of file