From c67ff78aa0bbbe7e9e6fd0dad64e2c93754e1735 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 21:20:56 +0200 Subject: [PATCH] implemented rubedoll level item (not after dying yet) --- app/Game/Asset/RubeDoll.json | 788 +++++++++ .../Items/{Rube.js => RubeDoll.js} | 2 +- app/Game/Client/GameObjects/Items/Rube.js | 28 - app/Game/Client/GameObjects/Items/RubeDoll.js | 187 +++ app/Game/Config/ItemSettings.js | 12 +- app/Game/Core/GameObjects/Items/Rube.js | 1412 ----------------- app/Game/Core/GameObjects/Items/RubeDoll.js | 66 + app/Game/Core/Loader/Level.js | 8 +- app/Lib/Vendor/RequireJs/Plugin/Json.js | 72 + app/Lib/Vendor/RequireJs/Plugin/Text.js | 391 +++++ channel.js | 6 +- client.js | 2 + config/build-profile.js | 2 + static/items/rube/ragdoll-full.json | 1346 ++++++++++++++++ static/items/rube/ragdoll.rube | 828 ++++------ static/maps/tiled/debug.json | 12 +- 16 files changed, 3140 insertions(+), 2022 deletions(-) create mode 100644 app/Game/Asset/RubeDoll.json rename app/Game/Channel/GameObjects/Items/{Rube.js => RubeDoll.js} (63%) delete mode 100644 app/Game/Client/GameObjects/Items/Rube.js create mode 100644 app/Game/Client/GameObjects/Items/RubeDoll.js delete mode 100644 app/Game/Core/GameObjects/Items/Rube.js create mode 100644 app/Game/Core/GameObjects/Items/RubeDoll.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Json.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Text.js create mode 100644 static/items/rube/ragdoll-full.json diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json new file mode 100644 index 0000000..114e29f --- /dev/null +++ b/app/Game/Asset/RubeDoll.json @@ -0,0 +1,788 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525936674326658, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", + "position" : + { + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 + ], + "y" : + [ + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.01047351956367493, + "massData-center" : + { + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 + }, + "massData-mass" : 0.2038488984107971, + "name" : "chest", + "position" : + { + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0009180362685583532, + "massData-center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "massData-mass" : 0.03564291819930077, + "name" : "head", + "position" : + { + "x" : 0.009572610259056091, + "y" : 1.462979435920715 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134485355578363, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001869033440016210, + "massData-center" : + { + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 + }, + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134483172791079, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", + "position" : + { + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525946278590709, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0007221315754577518, + "massData-center" : + { + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 + }, + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.000722132739610970, + "massData-center" : + { + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 + }, + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001864957448560745, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 + }, + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.06392270326614380, + "y" : 0.4330990314483643 + }, + "anchorB" : + { + "x" : 0.01330260001122952, + "y" : -0.2468919754028320 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, + "motorSpeed" : 0, + "name" : "joint9", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.221730470657349 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.0007802918553352356, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007800981402397156, + "y" : 0.08614097535610199 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.09517393261194229, + "y" : 0.2718780040740967 + }, + "anchorB" : + { + "x" : -1.741945743560791e-05, + "y" : 0.1479903459548950 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 + }, + "anchorB" : + { + "x" : -0.04493143409490585, + "y" : 0.1559127867221832 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 + }, + "anchorB" : + { + "x" : 0.04127830639481544, + "y" : 0.1504460573196411 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/app/Game/Channel/GameObjects/Items/Rube.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js similarity index 63% rename from app/Game/Channel/GameObjects/Items/Rube.js rename to app/Game/Channel/GameObjects/Items/RubeDoll.js index 455467b..3e27b2b 100644 --- a/app/Game/Channel/GameObjects/Items/Rube.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -1,5 +1,5 @@ define([ - "Game/Core/GameObjects/Items/Rube" + "Game/Core/GameObjects/Items/RubeDoll" ], function (Parent) { diff --git a/app/Game/Client/GameObjects/Items/Rube.js b/app/Game/Client/GameObjects/Items/Rube.js deleted file mode 100644 index 4aa825b..0000000 --- a/app/Game/Client/GameObjects/Items/Rube.js +++ /dev/null @@ -1,28 +0,0 @@ -define([ - "Game/Core/GameObjects/Items/Rube" -], - -function (Parent) { - - "use strict"; - - function Rube(physicsEngine, uid, options) { - Parent.call(this, physicsEngine, uid, options); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.createMesh = function() { - }; - - Rube.prototype.destroy = function() { - }; - - Rube.prototype.render = function() { - } - - Rube.prototype.flip = function(direction) { - }; - - return Rube; -}); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..2c76d91 --- /dev/null +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -0,0 +1,187 @@ +define([ + "Game/Core/GameObjects/Items/RubeDoll", + "Game/Client/View/Abstract/Layer", + "Game/Config/Settings", + "Lib/Utilities/NotificationCenter", +], + +function (Parent, Layer, Settings, Nc) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + + this.primaryColor = 0x008800; + + var limbOptions = {}; + + limbOptions.chest = { + width: 6, + height: 18, + x: 0, + y: 0 + }; + + limbOptions.head = { + width: 10, + height: 12, + x: 0, + y: - limbOptions.chest.height / 2 - 7 + }; + + limbOptions.upperLeftLeg = { + width: 5, + height: 8, + x: -2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.upperRightLeg = { + width: 4, + height: 9, + x: 2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftLeg = { + width: 4, + height: 4, + x: -2, + y: limbOptions.chest.height / 2 + limbOptions.upperLeftLeg.height + }; + + limbOptions.lowerRightLeg = { + width: 4, + height: 4, + x: 2, + y: limbOptions.chest.height / 2 + limbOptions.upperRightLeg.height + }; + + + + limbOptions.upperLeftArm = { + width: 2, + height: 8, + x: -2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.upperRightArm = { + width: 3, + height: 8, + x: 2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftArm = { + width: 2, + height: 5, + x: -2, + y: -limbOptions.chest.height / 2 + limbOptions.upperLeftArm.height + }; + + limbOptions.lowerRightArm = { + width: 2, + height: 5, + x: 2, + y: -limbOptions.chest.height / 2 + limbOptions.upperRightArm.height + }; + + this.limbOptions = limbOptions; + + this.layerId = Layer.ID.SPAWN; + this.limbMeshes = {}; + this.baseMeshName = "chest"; + this.characterName = "Chuck"; + + Parent.call(this, physicsEngine, uid, options); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.createMesh = function() { + + + this.createLimbMesh("lowerRightLeg"); + this.createLimbMesh("upperRightLeg"); + + this.createLimbMesh("lowerRightArm"); + this.createLimbMesh("upperRightArm"); + + this.createLimbMesh("chest"); + this.createLimbMesh("head"); + + this.createLimbMesh("lowerLeftLeg"); + this.createLimbMesh("upperLeftLeg"); + + this.createLimbMesh("lowerLeftArm"); + this.createLimbMesh("upperLeftArm"); + + }; + + RubeDoll.prototype.createLimbMesh = function(name) { + var self = this; + var texturePath = Settings.GRAPHICS_PATH + + Settings.GRAPHICS_SUBPATH_CHARACTERS + "" + + this.characterName + '/'; + + + var callback = function(mesh) { + if(name == self.baseMeshName) { + self.mesh = mesh; + } + + self.limbMeshes[name] = mesh; + + Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + + // setting shirt color + Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", { + minColor: 0x3b4a31, + maxColor: 0x6d855d, + newColor: self.primaryColor, + brightnessOffset: 0.56 + }); + }; + + Nc.trigger(Nc.ns.client.view.mesh.create, + this.layerId, + texturePath + name + ".png", + callback, + { + width: this.limbOptions[name].width, + height: this.limbOptions[name].height, + pivot: { + x: this.limbOptions[name].width / 2, + y: this.limbOptions[name].height / 2 + } + } + ); + }; + + RubeDoll.prototype.destroy = function() { + }; + + RubeDoll.prototype.render = function() { + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + x: this.limbs[name].GetPosition().x * Settings.RATIO, + y: this.limbs[name].GetPosition().y * Settings.RATIO, + rotation: this.limbs[name].GetAngle() + } + ); + } + } + } + }; + + RubeDoll.prototype.flip = function(direction) { + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 0546123..532d6fc 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -411,19 +411,17 @@ function () { }, - - - "Rube": + "RubeDoll": { "category": "kitchen", "image": "banana.gif", - - // "type": "rube", - "weight": "1", + + "weight": "3", "width": "5", "height": "9", - "grabAngle": "0.5", + "type": "rubedoll", + "grabAngle": "0", } }; diff --git a/app/Game/Core/GameObjects/Items/Rube.js b/app/Game/Core/GameObjects/Items/Rube.js deleted file mode 100644 index ccc06a6..0000000 --- a/app/Game/Core/GameObjects/Items/Rube.js +++ /dev/null @@ -1,1412 +0,0 @@ -define([ - "Game/" + GLOBALS.context + "/GameObjects/Item", - "Lib/Vendor/RubeLoader", - "Lib/Vendor/Box2D", - "Game/Config/Settings", - "Lib/Utilities/Assert" -], - -function (Parent, RubeLoader, Box2D, Settings, Assert) { - - "use strict"; - - // Fixme - make this loadable - var __ragdollJson; - - function Rube(physicsEngine, uid, options) { - Assert.number(options.x, options.y); - - this.rubeLoader = null; - this.body = null; - - Parent.call(this, physicsEngine, uid, options); - var world = physicsEngine.getWorld(); - world.DestroyBody(this.body); - - var json = __ragdollJson; - - this.rubeLoader = new RubeLoader(json, world); - var scene = this.rubeLoader.getScene(); - - for (var i in scene.bodies) { - var body = scene.bodies[i]; - var position = body.GetPosition().Copy(); - position.Add(new Box2D.Common.Math.b2Vec2( - options.x / Settings.RATIO, - options.y / Settings.RATIO - )); - body.SetPosition(position); - - if(body.name == "chest"){ - this.body = body; - } - } - - var def = this.body.GetDefinition(); - def.userData = this; - this.body.SetUserData(this); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.flip = function(direction) { - Parent.prototype.flip.call(this, direction); - // Extend - }; - - __ragdollJson = - -{ - "allowSleep" : true, - "autoClearForces" : true, - "body" : - [ - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622, - -0.05748683214187622 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, - "massData-center" : - { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", - "position" : - { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture0", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763, - -0.1718577295541763, - 0.001460619270801544 - ], - "y" : - [ - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165, - -0.4204435348510742, - -0.4519201517105103 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture2", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089, - 0.4449140429496765 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, - "massData-center" : - { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 - }, - "massData-mass" : 0.3355117142200470, - "name" : "chest", - "position" : - { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "circle" : - { - "center" : - { - "x" : -0.007499951869249344, - "y" : 0.003749847412109375 - }, - "radius" : 0.2746430933475494 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - }, - - { - "circle" : - { - "center" : - { - "x" : -0.03327952325344086, - "y" : -0.1384725570678711 - }, - "radius" : 0.2485582530498505 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - } - ], - "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, - "massData-center" : - { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 - }, - "massData-mass" : 0.09504657238721848, - "name" : "head", - "position" : - { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075, - -0.08623020350933075 - ], - "y" : - [ - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266, - -0.1138511821627617 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, - "massData-center" : - { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 - }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786, - -0.05748672783374786 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, - "massData-center" : - { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", - "position" : - { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, - "massData-center" : - { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836, - -0.08623017370700836 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, - "massData-center" : - { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858, - -0.1138515025377274 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, - "massData-center" : - { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 - }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 - }, - "type" : 2 - } - ], - "collisionbitplanes" : - { - "names" : - [ - "bitplane1", - "bitplane2", - "bitplane3", - "bitplane4", - "bitplane5", - "bitplane6", - "bitplane7", - "bitplane8", - "bitplane9", - "bitplane10", - "bitplane11", - "bitplane12", - "bitplane13", - "bitplane14", - "bitplane15", - "bitplane16", - "bitplane17", - "bitplane18", - "bitplane19", - "bitplane20", - "bitplane21", - "bitplane22", - "bitplane23", - "bitplane24", - "bitplane25", - "bitplane26", - "bitplane27", - "bitplane28", - "bitplane29", - "bitplane30", - "bitplane31", - "bitplane32" - ] - }, - "continuousPhysics" : true, - "gravity" : - { - "x" : 0, - "y" : -10 - }, - "image" : - [ - - { - "aspectScale" : 1, - "body" : 9, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08536797016859055, - 0.1435983330011368, - 0.1435983330011368, - -0.08536797016859055 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08536797016859055, - -0.1153986603021622, - 0.1435983330011368, - -0.1153986603021622, - 0.1435983330011368, - 0.1135676354169846, - -0.08536797016859055, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 7, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "corners" : - { - "x" : - [ - -0.1425068378448486, - 0.08785898983478546, - 0.08785898983478546, - -0.1425068378448486 - ], - "y" : - [ - -0.2324482202529907, - -0.2324482202529907, - 0.2858749032020569, - 0.2858749032020569 - ] - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1425068378448486, - -0.2324482202529907, - 0.08785898983478546, - -0.2324482202529907, - 0.08785898983478546, - 0.2858749032020569, - -0.1425068378448486, - 0.2858749032020569 - ], - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 6, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05836960300803185, - 0.05897502228617668, - 0.05897502228617668, - -0.05836960300803185 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05836960300803185, - -0.2340291887521744, - 0.05897502228617668, - -0.2340291887521744, - 0.05897502228617668, - 0.2353493124246597, - -0.05836960300803185, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 3, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05596264451742172, - 0.05736338347196579, - 0.05736338347196579, - -0.05596264451742172 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05596264451742172, - -0.1398780941963196, - 0.05736338347196579, - -0.1398780941963196, - 0.05736338347196579, - 0.1434369683265686, - -0.05596264451742172, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 1, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "corners" : - { - "x" : - [ - -0.1698881536722183, - 0.1681918352842331, - 0.1681918352842331, - -0.1698881536722183 - ], - "y" : - [ - -0.480212002992630, - -0.480212002992630, - 0.4776813089847565, - 0.4776813089847565 - ] - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1698881536722183, - -0.480212002992630, - 0.1681918352842331, - -0.480212002992630, - 0.1681918352842331, - 0.4776813089847565, - -0.1698881536722183, - 0.4776813089847565 - ], - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 8, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "corners" : - { - "x" : - [ - -0.1414211541414261, - 0.1477683037519455, - 0.1477683037519455, - -0.1414211541414261 - ], - "y" : - [ - -0.2325238138437271, - -0.2325238138437271, - 0.2301793247461319, - 0.2301793247461319 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1414211541414261, - -0.2325238138437271, - 0.1477683037519455, - -0.2325238138437271, - 0.1477683037519455, - 0.2301793247461319, - -0.1414211541414261, - 0.2301793247461319 - ], - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 4, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08596524596214294, - 0.1430010497570038, - 0.1430010497570038, - -0.08596524596214294 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08596524596214294, - -0.1153986603021622, - 0.1430010497570038, - -0.1153986603021622, - 0.1430010497570038, - 0.1135676354169846, - -0.08596524596214294, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 2, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "corners" : - { - "x" : - [ - -0.2679373621940613, - 0.3074420690536499, - 0.3074420690536499, - -0.2679373621940613 - ], - "y" : - [ - -0.4171699881553650, - -0.4171699881553650, - 0.2732853293418884, - 0.2732853293418884 - ] - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.2679373621940613, - -0.4171699881553650, - 0.3074420690536499, - -0.4171699881553650, - 0.3074420690536499, - 0.2732853293418884, - -0.2679373621940613, - 0.2732853293418884 - ], - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 0, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05653338506817818, - 0.06081124022603035, - 0.06081124022603035, - -0.05653338506817818 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05653338506817818, - -0.2340291887521744, - 0.06081124022603035, - -0.2340291887521744, - 0.06081124022603035, - 0.2353493124246597, - -0.05653338506817818, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 5, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05412428826093674, - 0.05920173972845078, - 0.05920173972845078, - -0.05412428826093674 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05412428826093674, - -0.1398780941963196, - 0.05920173972845078, - -0.1398780941963196, - 0.05920173972845078, - 0.1434369683265686, - -0.05412428826093674, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - } - ], - "joint" : - [ - - { - "anchorA" : - { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 - }, - "anchorB" : - { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 - }, - "bodyA" : 0, - "bodyB" : 5, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint4", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.1165831685066223, - "y" : 0.3330366015434265 - }, - "anchorB" : - { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 - }, - "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.07454992830753326, - "y" : 0.5068108439445496 - }, - "anchorB" : - { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 - }, - "bodyA" : 1, - "bodyB" : 2, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.221730470657349, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint0", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.6981316804885864 - }, - - { - "anchorA" : - { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 - }, - "anchorB" : - { - "x" : 0.05056380107998848, - "y" : 0.1842886805534363 - }, - "bodyA" : 1, - "bodyB" : 7, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint5", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.05503869056701660, - "y" : 0.1909851431846619 - }, - "bodyA" : 1, - "bodyB" : 8, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.1710196435451508, - "y" : 0.3308989405632019 - }, - "anchorB" : - { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 - }, - "anchorB" : - { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.002425249665975571, - "y" : -0.1845821887254715 - }, - "anchorB" : - { - "x" : 0.002425376325845718, - "y" : 0.1026860624551773 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 - }, - "anchorB" : - { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - } - ], - "positionIterations" : 3, - "stepsPerSecond" : 60.0, - "subStepping" : false, - "velocityIterations" : 8, - "warmStarting" : true -}; - - - - - - - return Rube; - -}); \ No newline at end of file diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..ad3323e --- /dev/null +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -0,0 +1,66 @@ +define([ + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Vendor/RubeLoader", + "Lib/Vendor/Box2D", + "Game/Config/Settings", + "Lib/Utilities/Assert", + "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin +], + +function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + Assert.number(options.x, options.y); + + this.rubeLoader = null; + this.body = null; + this.limbs = {}; + + var chest = null; + var world = physicsEngine.getWorld(); + this.rubeLoader = new RubeLoader(RubeDollJson, world); + var scene = this.rubeLoader.getScene(); + + for (var i in scene.bodies) { + var body = scene.bodies[i]; + var position = body.GetPosition().Copy(); + position.Add(new Box2D.Common.Math.b2Vec2( + options.x / Settings.RATIO, + options.y / Settings.RATIO + )); + body.SetPosition(position); + this.limbs[body.name] = body; + } + + Parent.call(this, physicsEngine, uid, options); + world.DestroyBody(this.body); + this.body = this.limbs.chest; + + var def = this.body.GetDefinition(); + def.userData = this; + this.body.SetUserData(this); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + // Extend + }; + + RubeDoll.prototype.reposition = function(handPosition, direction) { + + Parent.prototype.reposition.call(this, handPosition, direction); + + var position = new Box2D.Common.Math.b2Vec2( + handPosition.x + ((6 / Settings.RATIO) * direction), + handPosition.y + ); + + this.body.SetPosition(position); + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 53b43d8..bd49a20 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -8,9 +8,9 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Item", "Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard", "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll", - "Game/" + GLOBALS.context + "/GameObjects/Items/Rube" + "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" -], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, Rube) { +], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) { "use strict"; @@ -50,8 +50,8 @@ define([ return new Skateboard(this.engine, uid, options); case "ragdoll": return new RagDoll(this.engine, uid, options); - case "rube": - return new Rube(this.engine, uid, options); + case "rubedoll": + return new RubeDoll(this.engine, uid, options); default: return new Item(this.engine, uid, options); } diff --git a/app/Lib/Vendor/RequireJs/Plugin/Json.js b/app/Lib/Vendor/RequireJs/Plugin/Json.js new file mode 100644 index 0000000..f62f568 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Json.js @@ -0,0 +1,72 @@ +/** @license + * RequireJS plugin for loading JSON files + * - depends on Text plugin and it was HEAVILY "inspired" by it as well. + * Author: Miller Medeiros + * Version: 0.4.0 (2014/04/10) + * Released under the MIT license + */ +define(['text'], function(text){ + + var CACHE_BUST_QUERY_PARAM = 'bust', + CACHE_BUST_FLAG = '!bust', + jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){ + return eval('('+ val +')'); //quick and dirty + }, + buildMap = {}; + + function cacheBust(url){ + url = url.replace(CACHE_BUST_FLAG, ''); + url += (url.indexOf('?') < 0)? '?' : '&'; + return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random()); + } + + //API + return { + + load : function(name, req, onLoad, config) { + if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) { + //avoid inlining cache busted JSON or if inlineJSON:false + //and don't inline files marked as empty! + onLoad(null); + } else { + text.get(req.toUrl(name), function(data){ + var parsed; + if (config.isBuild) { + buildMap[name] = data; + onLoad(data); + } else { + try { + parsed = jsonParse(data); + } catch (e) { + onLoad.error(e); + } + onLoad(parsed); + } + }, + onLoad.error, { + accept: 'application/json' + } + ); + } + }, + + normalize : function (name, normalize) { + // used normalize to avoid caching references to a "cache busted" request + if (name.indexOf(CACHE_BUST_FLAG) !== -1) { + name = cacheBust(name); + } + // resolve any relative paths + return normalize(name); + }, + + //write method based on RequireJS official text plugin by James Burke + //https://github.com/jrburke/requirejs/blob/master/text.js + write : function(pluginName, moduleName, write){ + if(moduleName in buildMap){ + var content = buildMap[moduleName]; + write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n'); + } + } + + }; +}); \ No newline at end of file diff --git a/app/Lib/Vendor/RequireJs/Plugin/Text.js b/app/Lib/Vendor/RequireJs/Plugin/Text.js new file mode 100644 index 0000000..148c553 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Text.js @@ -0,0 +1,391 @@ +/** + * @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/requirejs/text for details + */ +/*jslint regexp: true */ +/*global require, XMLHttpRequest, ActiveXObject, + define, window, process, Packages, + java, location, Components, FileUtils */ + +define(['module'], function (module) { + 'use strict'; + + var text, fs, Cc, Ci, xpcIsWindows, + progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], + xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, + bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, + hasLocation = typeof location !== 'undefined' && location.href, + defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), + defaultHostName = hasLocation && location.hostname, + defaultPort = hasLocation && (location.port || undefined), + buildMap = {}, + masterConfig = (module.config && module.config()) || {}; + + text = { + version: '2.0.14', + + strip: function (content) { + //Strips declarations so that external SVG and XML + //documents can be added to a document without worry. Also, if the string + //is an HTML document, only the part inside the body tag is returned. + if (content) { + content = content.replace(xmlRegExp, ""); + var matches = content.match(bodyRegExp); + if (matches) { + content = matches[1]; + } + } else { + content = ""; + } + return content; + }, + + jsEscape: function (content) { + return content.replace(/(['\\])/g, '\\$1') + .replace(/[\f]/g, "\\f") + .replace(/[\b]/g, "\\b") + .replace(/[\n]/g, "\\n") + .replace(/[\t]/g, "\\t") + .replace(/[\r]/g, "\\r") + .replace(/[\u2028]/g, "\\u2028") + .replace(/[\u2029]/g, "\\u2029"); + }, + + createXhr: masterConfig.createXhr || function () { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else if (typeof ActiveXObject !== "undefined") { + for (i = 0; i < 3; i += 1) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + return xhr; + }, + + /** + * Parses a resource name into its component parts. Resource names + * look like: module/name.ext!strip, where the !strip part is + * optional. + * @param {String} name the resource name + * @returns {Object} with properties "moduleName", "ext" and "strip" + * where strip is a boolean. + */ + parseName: function (name) { + var modName, ext, temp, + strip = false, + index = name.lastIndexOf("."), + isRelative = name.indexOf('./') === 0 || + name.indexOf('../') === 0; + + if (index !== -1 && (!isRelative || index > 1)) { + modName = name.substring(0, index); + ext = name.substring(index + 1); + } else { + modName = name; + } + + temp = ext || modName; + index = temp.indexOf("!"); + if (index !== -1) { + //Pull off the strip arg. + strip = temp.substring(index + 1) === "strip"; + temp = temp.substring(0, index); + if (ext) { + ext = temp; + } else { + modName = temp; + } + } + + return { + moduleName: modName, + ext: ext, + strip: strip + }; + }, + + xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, + + /** + * Is an URL on another domain. Only works for browser use, returns + * false in non-browser environments. Only used to know if an + * optimized .js version of a text resource should be loaded + * instead. + * @param {String} url + * @returns Boolean + */ + useXhr: function (url, protocol, hostname, port) { + var uProtocol, uHostName, uPort, + match = text.xdRegExp.exec(url); + if (!match) { + return true; + } + uProtocol = match[2]; + uHostName = match[3]; + + uHostName = uHostName.split(':'); + uPort = uHostName[1]; + uHostName = uHostName[0]; + + return (!uProtocol || uProtocol === protocol) && + (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && + ((!uPort && !uHostName) || uPort === port); + }, + + finishLoad: function (name, strip, content, onLoad) { + content = strip ? text.strip(content) : content; + if (masterConfig.isBuild) { + buildMap[name] = content; + } + onLoad(content); + }, + + load: function (name, req, onLoad, config) { + //Name has format: some.module.filext!strip + //The strip part is optional. + //if strip is present, then that means only get the string contents + //inside a body tag in an HTML string. For XML/SVG content it means + //removing the declarations so the content can be inserted + //into the current doc without problems. + + // Do not bother with the work if a build and text will + // not be inlined. + if (config && config.isBuild && !config.inlineText) { + onLoad(); + return; + } + + masterConfig.isBuild = config && config.isBuild; + + var parsed = text.parseName(name), + nonStripName = parsed.moduleName + + (parsed.ext ? '.' + parsed.ext : ''), + url = req.toUrl(nonStripName), + useXhr = (masterConfig.useXhr) || + text.useXhr; + + // Do not load if it is an empty: url + if (url.indexOf('empty:') === 0) { + onLoad(); + return; + } + + //Load the text. Use XHR if possible and in a browser. + if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { + text.get(url, function (content) { + text.finishLoad(name, parsed.strip, content, onLoad); + }, function (err) { + if (onLoad.error) { + onLoad.error(err); + } + }); + } else { + //Need to fetch the resource across domains. Assume + //the resource has been optimized into a JS module. Fetch + //by the module name + extension, but do not include the + //!strip part to avoid file system issues. + req([nonStripName], function (content) { + text.finishLoad(parsed.moduleName + '.' + parsed.ext, + parsed.strip, content, onLoad); + }); + } + }, + + write: function (pluginName, moduleName, write, config) { + if (buildMap.hasOwnProperty(moduleName)) { + var content = text.jsEscape(buildMap[moduleName]); + write.asModule(pluginName + "!" + moduleName, + "define(function () { return '" + + content + + "';});\n"); + } + }, + + writeFile: function (pluginName, moduleName, req, write, config) { + var parsed = text.parseName(moduleName), + extPart = parsed.ext ? '.' + parsed.ext : '', + nonStripName = parsed.moduleName + extPart, + //Use a '.js' file name so that it indicates it is a + //script that can be loaded across domains. + fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; + + //Leverage own load() method to load plugin value, but only + //write out values that do not have the strip argument, + //to avoid any potential issues with ! in file names. + text.load(nonStripName, req, function (value) { + //Use own write() method to construct full module value. + //But need to create shell that translates writeFile's + //write() to the right interface. + var textWrite = function (contents) { + return write(fileName, contents); + }; + textWrite.asModule = function (moduleName, contents) { + return write.asModule(moduleName, fileName, contents); + }; + + text.write(pluginName, nonStripName, textWrite, config); + }, config); + } + }; + + if (masterConfig.env === 'node' || (!masterConfig.env && + typeof process !== "undefined" && + process.versions && + !!process.versions.node && + !process.versions['node-webkit'] && + !process.versions['atom-shell'])) { + //Using special require.nodeRequire, something added by r.js. + fs = require.nodeRequire('fs'); + + text.get = function (url, callback, errback) { + try { + var file = fs.readFileSync(url, 'utf8'); + //Remove BOM (Byte Mark Order) from utf8 files if it is there. + if (file[0] === '\uFEFF') { + file = file.substring(1); + } + callback(file); + } catch (e) { + if (errback) { + errback(e); + } + } + }; + } else if (masterConfig.env === 'xhr' || (!masterConfig.env && + text.createXhr())) { + text.get = function (url, callback, errback, headers) { + var xhr = text.createXhr(), header; + xhr.open('GET', url, true); + + //Allow plugins direct access to xhr headers + if (headers) { + for (header in headers) { + if (headers.hasOwnProperty(header)) { + xhr.setRequestHeader(header.toLowerCase(), headers[header]); + } + } + } + + //Allow overrides specified in config + if (masterConfig.onXhr) { + masterConfig.onXhr(xhr, url); + } + + xhr.onreadystatechange = function (evt) { + var status, err; + //Do not explicitly handle errors, those should be + //visible via console output in the browser. + if (xhr.readyState === 4) { + status = xhr.status || 0; + if (status > 399 && status < 600) { + //An http 4xx or 5xx error. Signal an error. + err = new Error(url + ' HTTP status: ' + status); + err.xhr = xhr; + if (errback) { + errback(err); + } + } else { + callback(xhr.responseText); + } + + if (masterConfig.onXhrComplete) { + masterConfig.onXhrComplete(xhr, url); + } + } + }; + xhr.send(null); + }; + } else if (masterConfig.env === 'rhino' || (!masterConfig.env && + typeof Packages !== 'undefined' && typeof java !== 'undefined')) { + //Why Java, why is this so awkward? + text.get = function (url, callback) { + var stringBuffer, line, + encoding = "utf-8", + file = new java.io.File(url), + lineSeparator = java.lang.System.getProperty("line.separator"), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), + content = ''; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + + if (line !== null) { + stringBuffer.append(line); + } + + while ((line = input.readLine()) !== null) { + stringBuffer.append(lineSeparator); + stringBuffer.append(line); + } + //Make sure we return a JavaScript string and not a Java string. + content = String(stringBuffer.toString()); //String + } finally { + input.close(); + } + callback(content); + }; + } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env && + typeof Components !== 'undefined' && Components.classes && + Components.interfaces)) { + //Avert your gaze! + Cc = Components.classes; + Ci = Components.interfaces; + Components.utils['import']('resource://gre/modules/FileUtils.jsm'); + xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc); + + text.get = function (url, callback) { + var inStream, convertStream, fileObj, + readData = {}; + + if (xpcIsWindows) { + url = url.replace(/\//g, '\\'); + } + + fileObj = new FileUtils.File(url); + + //XPCOM, you so crazy + try { + inStream = Cc['@mozilla.org/network/file-input-stream;1'] + .createInstance(Ci.nsIFileInputStream); + inStream.init(fileObj, 1, 0, false); + + convertStream = Cc['@mozilla.org/intl/converter-input-stream;1'] + .createInstance(Ci.nsIConverterInputStream); + convertStream.init(inStream, "utf-8", inStream.available(), + Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); + + convertStream.readString(inStream.available(), readData); + convertStream.close(); + inStream.close(); + callback(readData.value); + } catch (e) { + throw new Error((fileObj && fileObj.path || '') + ': ' + e); + } + }; + } + return text; +}); \ No newline at end of file diff --git a/channel.js b/channel.js index 27305e9..a94689f 100755 --- a/channel.js +++ b/channel.js @@ -4,7 +4,11 @@ var requirejs = require('requirejs'); requirejs.config({ nodeRequire: require, baseUrl: 'app', - deps: ['Lib/Utilities/Channel/Extensions'] + deps: ['Lib/Utilities/Channel/Extensions'], + paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', + }, }); var inspector = {}; diff --git a/client.js b/client.js index c94262d..b082d49 100755 --- a/client.js +++ b/client.js @@ -7,6 +7,8 @@ requirejs.config({ deps: ['Lib/Utilities/Client/Extensions'], waitSeconds: 0, paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', screenfull: "/screenfull", chart: "/chart", socketio: "/socket.io/socket.io" diff --git a/config/build-profile.js b/config/build-profile.js index ed028e7..e650ccc 100644 --- a/config/build-profile.js +++ b/config/build-profile.js @@ -1,6 +1,8 @@ ({ baseUrl: "../app", paths: { + "text": 'Lib/Vendor/RequireJs/Plugin/Text', + "json": 'Lib/Vendor/RequireJs/Plugin/Json', "screenfull": "../node_modules/screenfull/dist/screenfull", "socketio": "../node_modules/socket.io/node_modules/socket.io-client/dist/socket.io", "chart": "../node_modules/chart.js/Chart" diff --git a/static/items/rube/ragdoll-full.json b/static/items/rube/ragdoll-full.json new file mode 100644 index 0000000..fc81cad --- /dev/null +++ b/static/items/rube/ragdoll-full.json @@ -0,0 +1,1346 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748672783374786, + 0.05748672783374786, + -0.05748683214187622, + -0.05748683214187622 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019014045596123, + "massData-center" : + { + "x" : -5.215406062575312e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340443924069405, + "name" : "upperArmLeft", + "position" : + { + "x" : -0.1699507087469101, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1718577891588211, + 0.1684816330671310, + 0.001688212156295776, + -0.1718577295541763, + -0.1718577295541763, + 0.001460619270801544 + ], + "y" : + [ + -0.3928470611572266, + 0.4921868443489075, + 0.4921868443489075, + 0.3841522336006165, + -0.4204435348510742, + -0.4519201517105103 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture2", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1679489463567734, + 0.1679489463567734, + -0.004204027354717255, + -0.004204027354717255 + ], + "y" : + [ + 0.4449140429496765, + 0.6170670390129089, + 0.6170670390129089, + 0.4449140429496765 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.03228222951292992, + "massData-center" : + { + "x" : 0.008858840912580490, + "y" : 0.06282533705234528 + }, + "massData-mass" : 0.3355117142200470, + "name" : "chest", + "position" : + { + "x" : -0.05338868126273155, + "y" : 0.9620395302772522 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.007499951869249344, + "y" : 0.003749847412109375 + }, + "radius" : 0.2746430933475494 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + }, + + { + "circle" : + { + "center" : + { + "x" : -0.03327952325344086, + "y" : -0.1384725570678711 + }, + "radius" : 0.2485582530498505 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.004164268728345633, + "massData-center" : + { + "x" : -0.01910765282809734, + "y" : -0.06028826907277107 + }, + "massData-mass" : 0.09504657238721848, + "name" : "head", + "position" : + { + "x" : 0.04257059469819069, + "y" : 1.812389135360718 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554289239924401, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265211358666420, + "name" : "lowerArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415265351533890, + 0.1415265351533890, + -0.08457186818122864, + -0.08457186818122864 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623030036687851, + 0.08623030036687851, + -0.08623020350933075, + -0.08623020350933075 + ], + "y" : + [ + -0.1138511821627617, + 0.1565139442682266, + 0.1565139442682266, + -0.1138511821627617 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005858240183442831, + "massData-center" : + { + "x" : 0.006215983536094427, + "y" : -0.002008607611060143 + }, + "massData-mass" : 0.05964682996273041, + "name" : "lowerLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.1298431605100632 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748684704303741, + 0.05748684704303741, + -0.05748672783374786, + -0.05748672783374786 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554284874349833, + "massData-center" : + { + "x" : 5.960464477539062e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265206888318062, + "name" : "lowerArmLeft", + "position" : + { + "x" : -0.1699528992176056, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019015791825950, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340452119708061, + "name" : "upperArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625877106562257, + "massData-center" : + { + "x" : 6.705522537231445e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987650483846664, + "name" : "upperLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623032271862030, + 0.08623032271862030, + -0.08623017370700836, + -0.08623017370700836 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625879434868693, + "massData-center" : + { + "x" : 7.450580596923828e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987659424543381, + "name" : "upperLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.1138515025377274, + 0.1563164740800858, + 0.1563164740800858, + -0.1138515025377274 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415264606475830, + 0.1415264606475830, + -0.08457189798355103, + -0.08457189798355103 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005849063745699823, + "massData-center" : + { + "x" : 0.006219535600394011, + "y" : -0.002099231118336320 + }, + "massData-mass" : 0.05961277708411217, + "name" : "lowerLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.1298431605100632 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "image" : + [ + + { + "aspectScale" : 1, + "body" : 9, + "center" : + { + "x" : 0.02911517955362797, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08536797016859055, + 0.1435983330011368, + 0.1435983330011368, + -0.08536797016859055 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08536797016859055, + -0.1153986603021622, + 0.1435983330011368, + -0.1153986603021622, + 0.1435983330011368, + 0.1135676354169846, + -0.08536797016859055, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 7, + "center" : + { + "x" : -0.02732392773032188, + "y" : 0.02671334147453308 + }, + "corners" : + { + "x" : + [ + -0.1425068378448486, + 0.08785898983478546, + 0.08785898983478546, + -0.1425068378448486 + ], + "y" : + [ + -0.2324482202529907, + -0.2324482202529907, + 0.2858749032020569, + 0.2858749032020569 + ] + }, + "file" : "../../img/Characters/Chuck/upperRightLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1425068378448486, + -0.2324482202529907, + 0.08785898983478546, + -0.2324482202529907, + 0.08785898983478546, + 0.2858749032020569, + -0.1425068378448486, + 0.2858749032020569 + ], + "name" : "image6", + "opacity" : 1, + "scale" : 0.5183231234550476 + }, + + { + "aspectScale" : 1, + "body" : 6, + "center" : + { + "x" : 0.0003027096390724182, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05836960300803185, + 0.05897502228617668, + 0.05897502228617668, + -0.05836960300803185 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05836960300803185, + -0.2340291887521744, + 0.05897502228617668, + -0.2340291887521744, + 0.05897502228617668, + 0.2353493124246597, + -0.05836960300803185, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 3, + "center" : + { + "x" : 0.0007003694772720337, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05596264451742172, + 0.05736338347196579, + 0.05736338347196579, + -0.05596264451742172 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05596264451742172, + -0.1398780941963196, + 0.05736338347196579, + -0.1398780941963196, + 0.05736338347196579, + 0.1434369683265686, + -0.05596264451742172, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.2833150625228882 + }, + + { + "aspectScale" : 1, + "body" : 1, + "center" : + { + "x" : -0.0008481591939926147, + "y" : -0.001265347003936768 + }, + "corners" : + { + "x" : + [ + -0.1698881536722183, + 0.1681918352842331, + 0.1681918352842331, + -0.1698881536722183 + ], + "y" : + [ + -0.480212002992630, + -0.480212002992630, + 0.4776813089847565, + 0.4776813089847565 + ] + }, + "file" : "../../img/Characters/Chuck/chest.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1698881536722183, + -0.480212002992630, + 0.1681918352842331, + -0.480212002992630, + 0.1681918352842331, + 0.4776813089847565, + -0.1698881536722183, + 0.4776813089847565 + ], + "name" : "image2", + "opacity" : 1, + "renderOrder" : 5, + "scale" : 0.9578933119773865 + }, + + { + "aspectScale" : 1, + "body" : 8, + "center" : + { + "x" : 0.003173574805259705, + "y" : -0.001172244548797607 + }, + "corners" : + { + "x" : + [ + -0.1414211541414261, + 0.1477683037519455, + 0.1477683037519455, + -0.1414211541414261 + ], + "y" : + [ + -0.2325238138437271, + -0.2325238138437271, + 0.2301793247461319, + 0.2301793247461319 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1414211541414261, + -0.2325238138437271, + 0.1477683037519455, + -0.2325238138437271, + 0.1477683037519455, + 0.2301793247461319, + -0.1414211541414261, + 0.2301793247461319 + ], + "name" : "image6", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.4627031385898590 + }, + + { + "aspectScale" : 1, + "body" : 4, + "center" : + { + "x" : 0.02851789817214012, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08596524596214294, + 0.1430010497570038, + 0.1430010497570038, + -0.08596524596214294 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08596524596214294, + -0.1153986603021622, + 0.1430010497570038, + -0.1153986603021622, + 0.1430010497570038, + 0.1135676354169846, + -0.08596524596214294, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 2, + "center" : + { + "x" : 0.01975236460566521, + "y" : -0.07194232940673828 + }, + "corners" : + { + "x" : + [ + -0.2679373621940613, + 0.3074420690536499, + 0.3074420690536499, + -0.2679373621940613 + ], + "y" : + [ + -0.4171699881553650, + -0.4171699881553650, + 0.2732853293418884, + 0.2732853293418884 + ] + }, + "file" : "../../img/Characters/Chuck/head.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.2679373621940613, + -0.4171699881553650, + 0.3074420690536499, + -0.4171699881553650, + 0.3074420690536499, + 0.2732853293418884, + -0.2679373621940613, + 0.2732853293418884 + ], + "name" : "image1", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.6904553174972534 + }, + + { + "aspectScale" : 1, + "body" : 0, + "center" : + { + "x" : 0.002138927578926086, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05653338506817818, + 0.06081124022603035, + 0.06081124022603035, + -0.05653338506817818 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05653338506817818, + -0.2340291887521744, + 0.06081124022603035, + -0.2340291887521744, + 0.06081124022603035, + 0.2353493124246597, + -0.05653338506817818, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 5, + "center" : + { + "x" : 0.002538725733757019, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05412428826093674, + 0.05920173972845078, + 0.05920173972845078, + -0.05412428826093674 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05412428826093674, + -0.1398780941963196, + 0.05920173972845078, + -0.1398780941963196, + 0.05920173972845078, + 0.1434369683265686, + -0.05412428826093674, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.2833150625228882 + } + ], + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.001047849655151367, + "y" : -0.1790249347686768 + }, + "anchorB" : + { + "x" : 0.001048207283020020, + "y" : 0.08683943748474121 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.1165831685066223, + "y" : 0.3330366015434265 + }, + "anchorB" : + { + "x" : -2.135336399078369e-05, + "y" : 0.1812803745269775 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.07454992830753326, + "y" : 0.5068108439445496 + }, + "anchorB" : + { + "x" : -0.02141102217137814, + "y" : -0.3435407876968384 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.221730470657349, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint0", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.6981316804885864 + }, + + { + "anchorA" : + { + "x" : 0.1367489844560623, + "y" : -0.3606387376785278 + }, + "anchorB" : + { + "x" : 0.05056380107998848, + "y" : 0.1842886805534363 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.08329562842845917, + "y" : -0.3541148304939270 + }, + "anchorB" : + { + "x" : -0.05503869056701660, + "y" : 0.1909851431846619 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1710196435451508, + "y" : 0.3308989405632019 + }, + "anchorB" : + { + "x" : -9.131431579589844e-05, + "y" : 0.1791421175003052 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0004334598779678345, + "y" : 0.08706557750701904 + }, + "anchorB" : + { + "x" : 0.0004332214593887329, + "y" : -0.1787990331649780 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.002425249665975571, + "y" : -0.1845821887254715 + }, + "anchorB" : + { + "x" : 0.002425376325845718, + "y" : 0.1026860624551773 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : -0.0009558200836181641, + "y" : -0.1818936169147491 + }, + "anchorB" : + { + "x" : -0.0009555891156196594, + "y" : 0.1055182516574860 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 53f1406..b7f646a 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -71,7 +71,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 17, + "id" : 2, "name" : "fixture3", "shapes" : [ @@ -84,67 +84,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.1138515025377274, - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 18, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457189798355103, - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 ] } } ], - "id" : 13, + "id" : 1, "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, + "massData-I" : 0.0001864957448560745, "massData-center" : { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -160,7 +128,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 19, + "id" : 3, "name" : "fixture3", "shapes" : [ @@ -173,35 +141,35 @@ { "x" : [ - -0.08623017370700836, - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836 + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 14, + "id" : 2, "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, + "massData-I" : 0.000722132739610970, "massData-center" : { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -217,7 +185,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 20, + "id" : 4, "name" : "fixture3", "shapes" : [ @@ -230,35 +198,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 15, + "id" : 3, "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, + "massData-I" : 0.0007221315754577518, "massData-center" : { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -274,7 +242,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 21, + "id" : 5, "name" : "fixture3", "shapes" : [ @@ -287,35 +255,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 16, + "id" : 4, "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, + "massData-I" : 0.0004525946278590709, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 }, "type" : "dynamic" }, @@ -331,7 +299,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 22, + "id" : 6, "name" : "fixture3", "shapes" : [ @@ -344,35 +312,35 @@ { "x" : [ - -0.05748672783374786, - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786 + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 17, + "id" : 5, "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, + "massData-I" : 0.0001134483172791079, "massData-center" : { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", "position" : { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -388,7 +356,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 23, + "id" : 7, "name" : "fixture3", "shapes" : [ @@ -401,67 +369,35 @@ { "x" : [ - -0.08623020350933075, - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075 + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.1138511821627617, - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 24, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457186818122864, - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 ] } } ], - "id" : 18, + "id" : 6, "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, + "massData-I" : 0.0001869033440016210, "massData-center" : { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -477,7 +413,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 25, + "id" : 9, "name" : "fixture3", "shapes" : [ @@ -490,35 +426,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 19, + "id" : 7, "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, + "massData-I" : 0.0001134485355578363, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -534,58 +470,37 @@ "density" : 0.2204959988594055, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 26, + "id" : 10, "name" : "fixture1", "shapes" : [ { - "radius" : 0.2746430933475494, + "radius" : 0.2268356680870056, "type" : "circle" } ], "vertices" : { - "x" : [ -0.007499951869249344 ], - "y" : [ 0.003749847412109375 ] - } - }, - - { - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 27, - "name" : "fixture1", - "shapes" : - [ - - { - "radius" : 0.2485582530498505, - "type" : "circle" - } - ], - "vertices" : - { - "x" : [ -0.03327952325344086 ], - "y" : [ -0.1384725570678711 ] + "x" : [ -0.002679032273590565 ], + "y" : [ 0.004700660705566406 ] } } ], - "id" : 20, + "id" : 8, "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, + "massData-I" : 0.0009180362685583532, "massData-center" : { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 }, - "massData-mass" : 0.09504657238721848, + "massData-mass" : 0.03564291819930077, "name" : "head", "position" : { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 + "x" : 0.009572610259056091, + "y" : 1.462979435920715 }, "type" : "dynamic" }, @@ -601,7 +516,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 28, + "id" : 13, "name" : "fixture0", "shapes" : [ @@ -614,71 +529,39 @@ { "x" : [ - -0.1718577295541763, - 0.001460619270801544, - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763 + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 ], "y" : [ - -0.4204435348510742, - -0.4519201517105103, - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 29, - "name" : "fixture2", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.004204027354717255, - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089 + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 ] } } ], - "id" : 21, + "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, + "massData-I" : 0.01047351956367493, "massData-center" : { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 }, - "massData-mass" : 0.3355117142200470, + "massData-mass" : 0.2038488984107971, "name" : "chest", "position" : { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 }, "type" : "dynamic" }, @@ -694,7 +577,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 30, + "id" : 14, "name" : "fixture3", "shapes" : [ @@ -707,318 +590,137 @@ { "x" : [ - -0.05748683214187622, - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622 + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 22, + "id" : 10, "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, + "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", "position" : { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 }, "type" : "dynamic" } ], - "metaimage" : - [ - - { - "aspectScale" : 1, - "body" : 21, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "flip" : false, - "id" : 15, - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 18, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 16, - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 20, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "flip" : false, - "id" : 17, - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 22, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 18, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 16, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 19, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 17, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 20, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 19, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 21, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 14, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 22, - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 15, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "flip" : false, - "id" : 23, - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 13, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 24, - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - } - ], "metajoint" : [ { "anchorA" : { - "x" : 0.07454992830753326, - "y" : 0.5068107843399048 + "x" : -0.0007802955806255341, + "y" : -0.1484908312559128 }, "anchorB" : { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 + "x" : -0.0007801018655300140, + "y" : 0.08614096790552139 }, - "bodyA" : 21, - "bodyB" : 20, + "bodyA" : 2, + "bodyB" : 6, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 10, - "lowerLimit" : -1.221730470657349, + "id" : 1, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint0", + "name" : "joint7", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0.6981316804885864 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : 0.002425247803330421, - "y" : -0.1845821887254715 + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 }, "anchorB" : { - "x" : 0.002425374463200569, - "y" : 0.1026860624551773 + "x" : 0.001979988068342209, + "y" : 0.08382887393236160 }, - "bodyA" : 15, - "bodyB" : 13, + "bodyA" : 3, + "bodyB" : 1, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 11, - "lowerLimit" : -2.268928050994873, + "id" : 2, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint8", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : -0.1165831685066223, - "y" : 0.3330365419387817 + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 }, "anchorB" : { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 }, - "bodyA" : 21, - "bodyB" : 22, + "bodyA" : 7, + "bodyB" : 4, "collideConnected" : false, - "enableLimit" : false, + "enableLimit" : true, "enableMotor" : false, - "id" : 12, - "lowerLimit" : -2.268928050994873, + "id" : 3, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint3", + "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 3.141592741012573 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : 0.1710196435451508, - "y" : 0.3308988809585571 + "x" : 0.1396137326955795, + "y" : 0.2701327204704285 }, "anchorB" : { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 + "x" : -7.455050945281982e-05, + "y" : 0.1462445855140686 }, - "bodyA" : 21, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 4, "collideConnected" : false, "enableLimit" : false, "enableMotor" : false, - "id" : 13, + "id" : 4, "lowerLimit" : -2.268928050994873, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1031,24 +733,24 @@ { "anchorA" : { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 }, "anchorB" : { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 + "x" : -0.04493143782019615, + "y" : 0.1559127867221832 }, - "bodyA" : 19, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 2, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 14, - "lowerLimit" : 0, + "id" : 5, + "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint1", + "name" : "joint6", "referenceAngle" : 0, "type" : "revolute", "upperLimit" : 1.919862151145935 @@ -1057,20 +759,20 @@ { "anchorA" : { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 }, "anchorB" : { - "x" : 0.05056379735469818, - "y" : 0.1842886805534363 + "x" : 0.04127831012010574, + "y" : 0.1504460573196411 }, - "bodyA" : 21, - "bodyB" : 15, + "bodyA" : 9, + "bodyB" : 3, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 15, + "id" : 6, "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1083,79 +785,79 @@ { "anchorA" : { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 + "x" : -0.09517394006252289, + "y" : 0.2718779444694519 }, "anchorB" : { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 + "x" : -1.741945743560791e-05, + "y" : 0.1479902863502502 }, - "bodyA" : 22, - "bodyB" : 17, + "bodyA" : 9, + "bodyB" : 10, + "collideConnected" : false, + "enableLimit" : false, + "enableMotor" : false, + "id" : 8, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "referenceAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 10, + "bodyB" : 5, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 16, - "lowerLimit" : 0, + "id" : 9, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint4", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 + "x" : 0.06392270326614380, + "y" : 0.4330990016460419 }, "anchorB" : { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 + "x" : 0.01330260001122952, + "y" : -0.2468920052051544 }, - "bodyA" : 14, - "bodyB" : 18, + "bodyA" : 9, + "bodyB" : 8, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 17, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "referenceAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.0550386831164360, - "y" : 0.1909851431846619 - }, - "bodyA" : 21, - "bodyB" : 14, - "collideConnected" : false, - "enableLimit" : true, - "enableMotor" : false, - "id" : 18, + "id" : 29, "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, + "maxMotorTorque" : 0, "motorSpeed" : 0, - "name" : "joint6", + "name" : "joint9", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.221730470657349 } ], "positionIterations" : 3, diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index d8e0842..920a287 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -108,8 +108,8 @@ "type":"", "visible":true, "width":0, - "x":516.282764098491, - "y":128.219675479405 + "x":548.282764098491, + "y":130.219675479405 }, { "ellipse":true, @@ -215,17 +215,17 @@ { "height":0, "id":10, - "name":"Rube", + "name":"RubeDoll", "properties": { }, "rotation":0, - "type":"rube", + "type":"", "visible":true, "width":0, - "x":236.607333333333, - "y":462.255333333333 + "x":504.607333333333, + "y":111.255333333333 }, { "height":0,