Browse Source

Overlay the Roboman3D Typescript example with the more updated Roboman3D javascript example and re-converted it to Typescript.

Shaddock Heath 10 years ago
parent
commit
8536cdc979
80 changed files with 3568 additions and 841 deletions
  1. 295 144
      Roboman3DTypeScript/Resources/Components/AvatarController.js
  2. 250 110
      Roboman3DTypeScript/Resources/Components/AvatarController.ts
  3. 7 0
      Roboman3DTypeScript/Resources/Components/AvatarController.ts.asset
  4. 45 29
      Roboman3DTypeScript/Resources/Components/Roboman.js
  5. 26 12
      Roboman3DTypeScript/Resources/Components/Roboman.ts
  6. 7 0
      Roboman3DTypeScript/Resources/Components/Roboman.ts.asset
  7. 1 1
      Roboman3DTypeScript/Resources/Models/Crate.fbx.asset
  8. 1 1
      Roboman3DTypeScript/Resources/Models/Ground.fbx.asset
  9. 1 1
      Roboman3DTypeScript/Resources/Models/Materials.asset
  10. 2 9
      Roboman3DTypeScript/Resources/Models/Materials/Crate.Basic.material
  11. 1 1
      Roboman3DTypeScript/Resources/Models/Materials/Crate.Basic.material.asset
  12. 3 3
      Roboman3DTypeScript/Resources/Models/Materials/DefaultMaterial.material
  13. 1 1
      Roboman3DTypeScript/Resources/Models/Materials/DefaultMaterial.material.asset
  14. 2 9
      Roboman3DTypeScript/Resources/Models/Materials/Pallet.material
  15. 1 1
      Roboman3DTypeScript/Resources/Models/Materials/Pallet.material.asset
  16. 2 2
      Roboman3DTypeScript/Resources/Models/Materials/Robot_01_mat.material
  17. 1 1
      Roboman3DTypeScript/Resources/Models/Materials/Robot_01_mat.material.asset
  18. 1 1
      Roboman3DTypeScript/Resources/Models/Pallet.fbx.asset
  19. BIN
      Roboman3DTypeScript/Resources/Models/Plane.blend
  20. 9 0
      Roboman3DTypeScript/Resources/Models/Plane.blend.asset
  21. 7 2
      Roboman3DTypeScript/Resources/Models/Robo_01.fbx
  22. 38 0
      Roboman3DTypeScript/Resources/Modules/DPad.d.ts
  23. 7 0
      Roboman3DTypeScript/Resources/Modules/DPad.d.ts.asset
  24. 183 0
      Roboman3DTypeScript/Resources/Modules/DPad.js
  25. 7 0
      Roboman3DTypeScript/Resources/Modules/DPad.js.asset
  26. 7 0
      Roboman3DTypeScript/Resources/Modules/gl-matrix.d.ts.asset
  27. 6 7
      Roboman3DTypeScript/Resources/Prefabs/Crate.prefab
  28. 1 1
      Roboman3DTypeScript/Resources/Prefabs/Crate.prefab.asset
  29. 5 6
      Roboman3DTypeScript/Resources/Prefabs/Pallet.prefab
  30. 1 1
      Roboman3DTypeScript/Resources/Prefabs/Pallet.prefab.asset
  31. 11 11
      Roboman3DTypeScript/Resources/Prefabs/Robo_01.prefab
  32. 1 1
      Roboman3DTypeScript/Resources/Prefabs/Robo_01.prefab.asset
  33. 16 0
      Roboman3DTypeScript/Resources/Prefabs/Water.prefab
  34. 5 0
      Roboman3DTypeScript/Resources/Prefabs/Water.prefab.asset
  35. 0 169
      Roboman3DTypeScript/Resources/Scenes/Scene.scene
  36. 0 5
      Roboman3DTypeScript/Resources/Scenes/Scene.scene.asset
  37. 336 0
      Roboman3DTypeScript/Resources/Scenes/Test.scene
  38. 5 0
      Roboman3DTypeScript/Resources/Scenes/Test.scene.asset
  39. 43 10
      Roboman3DTypeScript/Resources/Scripts/main.js
  40. 47 0
      Roboman3DTypeScript/Resources/Scripts/main.ts
  41. 7 0
      Roboman3DTypeScript/Resources/Scripts/main.ts.asset
  42. 0 0
      Roboman3DTypeScript/Resources/Textures/AtomicRobot.png
  43. 5 0
      Roboman3DTypeScript/Resources/Textures/AtomicRobot.png.asset
  44. 0 5
      Roboman3DTypeScript/Resources/Textures/AtomicRobot_01_Diffuse.png.asset
  45. 1 1
      Roboman3DTypeScript/Resources/Textures/BlueGrid.png.asset
  46. BIN
      Roboman3DTypeScript/Resources/Textures/Crate-Bump.jpg
  47. 5 0
      Roboman3DTypeScript/Resources/Textures/Crate-Bump.jpg.asset
  48. 1 1
      Roboman3DTypeScript/Resources/Textures/Crate-Diffuse.jpg.asset
  49. 1 1
      Roboman3DTypeScript/Resources/Textures/Crate-Normal.jpg.asset
  50. 1 1
      Roboman3DTypeScript/Resources/Textures/Crate-Specular.jpg.asset
  51. BIN
      Roboman3DTypeScript/Resources/Textures/Pallet-Bump.jpg
  52. 5 0
      Roboman3DTypeScript/Resources/Textures/Pallet-Bump.jpg.asset
  53. 1 1
      Roboman3DTypeScript/Resources/Textures/Pallet-Difuse.jpg.asset
  54. 1 1
      Roboman3DTypeScript/Resources/Textures/Pallet-Normal.jpg.asset
  55. 1 1
      Roboman3DTypeScript/Resources/Textures/Pallet-Specular.jpg.asset
  56. BIN
      Roboman3DTypeScript/Resources/Textures/Robot_01_Diffuse.png
  57. 5 0
      Roboman3DTypeScript/Resources/Textures/Robot_01_Diffuse.png.asset
  58. 0 5
      Roboman3DTypeScript/Resources/TypeScript.asset
  59. 0 169
      Roboman3DTypeScript/Resources/TypeScript/AtomicWork.d.ts
  60. 5 0
      Roboman3DTypeScript/Resources/UI.asset
  61. 9 0
      Roboman3DTypeScript/Resources/UI/DPadSkin.ui
  62. BIN
      Roboman3DTypeScript/Resources/UI/buttonDown.png
  63. 5 0
      Roboman3DTypeScript/Resources/UI/buttonDown.png.asset
  64. BIN
      Roboman3DTypeScript/Resources/UI/buttonLeft.png
  65. 5 0
      Roboman3DTypeScript/Resources/UI/buttonLeft.png.asset
  66. BIN
      Roboman3DTypeScript/Resources/UI/buttonRight.png
  67. 5 0
      Roboman3DTypeScript/Resources/UI/buttonRight.png.asset
  68. BIN
      Roboman3DTypeScript/Resources/UI/buttonUp.png
  69. 5 0
      Roboman3DTypeScript/Resources/UI/buttonUp.png.asset
  70. BIN
      Roboman3DTypeScript/Resources/UI/jumpButton.png
  71. 5 0
      Roboman3DTypeScript/Resources/UI/jumpButton.png.asset
  72. 0 21
      Roboman3DTypeScript/Resources/tsconfig.json
  73. 49 0
      Roboman3DTypeScript/Settings/Engine.json
  74. 32 0
      Roboman3DTypeScript/tsconfig.json
  75. 387 95
      Roboman3DTypeScript/typings/Atomic/Atomic.d.ts
  76. 121 0
      Roboman3DTypeScript/typings/Atomic/AtomicNET.d.ts
  77. 3 0
      Roboman3DTypeScript/typings/Atomic/AtomicPlayer.d.ts
  78. 395 0
      Roboman3DTypeScript/typings/Atomic/AtomicWork.d.ts
  79. 252 0
      Roboman3DTypeScript/typings/Atomic/Editor.d.ts
  80. 874 0
      Roboman3DTypeScript/typings/Atomic/ToolCore.d.ts

+ 295 - 144
Roboman3DTypeScript/Resources/Components/AvatarController.js

@@ -1,144 +1,295 @@
-/// <reference path="../TypeScript/Atomic.d.ts"/>
-/// <reference path="../TypeScript/AtomicWork.d.ts" />
-/// <reference path="../Modules/gl-matrix.d.ts" />
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    __.prototype = b.prototype;
-    d.prototype = new __();
-};
-var gl_matrix_1 = require('gl-matrix');
-"atomic component";
-var MOVE_FORCE = 1.8;
-var BRAKE_FORCE = 0.2;
-var YAW_SENSITIVITY = 0.1;
-var PITCH_SENSITIVITY = 0.1;
-var AvatarController = (function (_super) {
-    __extends(AvatarController, _super);
-    function AvatarController() {
-        _super.apply(this, arguments);
-        this.inspectorFields = {
-            speed: 1.0,
-            cameraDist: 12
-        };
-        this.yaw = 0;
-        this.pitch = 0;
-        this.mouseMoveX = 0;
-        this.mouseMoveY = 0;
-        this.moveForward = false;
-        this.moveBackwards = false;
-        this.moveLeft = false;
-        this.moveRight = false;
-        this.idle = true;
-        this.speed = 1;
-        this.cameraDist = 12;
-    }
-    AvatarController.prototype.start = function () {
-        this.camera = this.node.scene.getMainCamera();
-        this.cameraNode = this.camera.node;
-        this.body = this.node.createComponent("RigidBody");
-        this.body.mass = 1.0;
-        this.body.angularFactor = [0, 0, 0];
-        this.body.collisionEventMode = Atomic.COLLISION_ALWAYS;
-        var shape = this.node.createComponent("CollisionShape");
-        shape.setCapsule(2, 4, [0, 2, 0]);
-    };
-    AvatarController.prototype.update = function (timeStep) {
-        this.updateControls();
-    };
-    AvatarController.prototype.fixedUpdate = function (timestep) {
-        var rot = this.node.getRotation();
-        var moveDir = [0, 0, 0];
-        var velocity = this.body.getLinearVelocity();
-        var planeVelocity = [velocity[0], 0.0, velocity[2]];
-        if (this.moveForward) {
-            gl_matrix_1.vec3.add(moveDir, moveDir, [0, 0, 1]);
-        }
-        if (this.moveBackwards) {
-            gl_matrix_1.vec3.add(moveDir, moveDir, [0, 0, -1]);
-        }
-        if (this.moveLeft) {
-            gl_matrix_1.vec3.add(moveDir, moveDir, [-1, 0, 0]);
-        }
-        if (this.moveRight) {
-            gl_matrix_1.vec3.add(moveDir, moveDir, [1, 0, 0]);
-        }
-        if (gl_matrix_1.vec3.length(moveDir) > 0.0)
-            gl_matrix_1.vec3.normalize(moveDir, moveDir);
-        gl_matrix_1.vec3.transformQuat(moveDir, moveDir, [rot[1], rot[2], rot[3], rot[0]]);
-        gl_matrix_1.vec3.scale(moveDir, moveDir, (MOVE_FORCE));
-        gl_matrix_1.vec3.scale(moveDir, moveDir, this.speed);
-        this.body.applyImpulse(moveDir);
-        gl_matrix_1.vec3.negate(planeVelocity, planeVelocity);
-        gl_matrix_1.vec3.scale(planeVelocity, planeVelocity, BRAKE_FORCE);
-        this.body.applyImpulse(planeVelocity);
-        if (gl_matrix_1.vec3.length(moveDir) > 0.0)
-            this.idle = false;
-        else
-            this.idle = true;
-    };
-    AvatarController.prototype.updateControls = function () {
-        var input = Atomic.input;
-        this.moveForward = false;
-        this.moveBackwards = false;
-        this.moveLeft = false;
-        this.moveRight = false;
-        this.mouseMoveX = 0.0;
-        this.mouseMoveY = 0.0;
-        var MOVE_SPEED = 20.0;
-        var MOUSE_SENSITIVITY = 0.1;
-        if (input.getKeyDown(Atomic.KEY_W))
-            this.moveForward = true;
-        if (input.getKeyDown(Atomic.KEY_S))
-            this.moveBackwards = true;
-        if (input.getKeyDown(Atomic.KEY_A))
-            this.moveLeft = true;
-        if (input.getKeyDown(Atomic.KEY_D))
-            this.moveRight = true;
-        this.yaw += input.mouseMoveX * YAW_SENSITIVITY;
-        this.pitch += input.mouseMoveY * PITCH_SENSITIVITY;
-        if (this.pitch < -80)
-            this.pitch = -80;
-        if (this.pitch > 80)
-            this.pitch = 80;
-    };
-    AvatarController.prototype.postUpdate = function (timestep) {
-        var rot = this.node.getRotation();
-        var dir = gl_matrix_1.quat.create();
-        gl_matrix_1.quat.setAxisAngle(dir, [1, 0, 0], (this.pitch * Math.PI / 180.0));
-        gl_matrix_1.quat.multiply(dir, [rot[1], rot[2], rot[3], rot[0]], dir);
-        var headNode = this.node.getChild("Head_Tip", true);
-        var aimPoint = this.node.getWorldPosition();
-        var aimOffset = [0, 1.7, 0];
-        gl_matrix_1.vec3.transformQuat(aimOffset, aimOffset, dir);
-        gl_matrix_1.vec3.add(aimPoint, aimPoint, aimOffset);
-        var rayDir = gl_matrix_1.vec3.create();
-        gl_matrix_1.vec3.transformQuat(rayDir, [0, 0, -1], dir);
-        gl_matrix_1.vec3.scale(rayDir, rayDir, this.cameraDist);
-        gl_matrix_1.vec3.add(aimPoint, aimPoint, rayDir);
-        this.cameraNode.setPosition(aimPoint);
-        this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
-        gl_matrix_1.quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
-        this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
-    };
-    return AvatarController;
-})(Atomic.JSComponent);
-function QuatFromEuler(x, y, z) {
-    var M_PI = 3.14159265358979323846264338327950288;
-    var q = [0, 0, 0, 0];
-    x *= (M_PI / 360);
-    y *= (M_PI / 360);
-    z *= (M_PI / 360);
-    var sinX = Math.sin(x);
-    var cosX = Math.cos(x);
-    var sinY = Math.sin(y);
-    var cosY = Math.cos(y);
-    var sinZ = Math.sin(z);
-    var cosZ = Math.cos(z);
-    q[0] = cosY * cosX * cosZ + sinY * sinX * sinZ;
-    q[1] = cosY * sinX * cosZ + sinY * cosX * sinZ;
-    q[2] = sinY * cosX * cosZ - cosY * sinX * sinZ;
-    q[3] = cosY * cosX * sinZ - sinY * sinX * cosZ;
-    return q;
-}
-module.exports = AvatarController;
+// designate component
+"atomic component";
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+//import gl-matrix library
+//https://github.com/toji/gl-matrix for more information
+var gl_matrix_1 = require("gl-matrix");
+//define constans
+var MOVE_FORCE = 1.8;
+var INAIR_MOVE_FORCE = 0.02;
+var BRAKE_FORCE = 0.2;
+var JUMP_FORCE = 7.0;
+var YAW_SENSITIVITY = 0.1;
+var INAIR_THRESHOLD_TIME = 0.1;
+//define a component AvatarController
+var AvatarController = (function (_super) {
+    __extends(AvatarController, _super);
+    function AvatarController() {
+        _super.apply(this, arguments);
+        //define an inspectorFields to make variables visible in editor
+        this.inspectorFields = {
+            //needs default value to make editor understand type of that value
+            speed: 1.0
+        };
+        this.speed = 1.0;
+        this.onGround = true;
+        this.okToJump = true;
+        this.inAirTime = 0.0;
+        this.softGrounded = true;
+        this.cameraMode = 0;
+        this.yaw = 0;
+        this.pitch = 0;
+        this.moveForward = false;
+        this.moveBackwards = false;
+        this.moveLeft = false;
+        this.moveRight = false;
+        this.mouseMoveX = 0.0;
+        this.mouseMoveY = 0.0;
+        this.button0 = false;
+        this.button1 = false;
+        this.lastButton0 = false;
+        this.lastButton1 = false;
+        this.idle = true;
+    }
+    AvatarController.prototype.start = function () {
+        //get main camera and set its node to cameraNode
+        var camera = this.node.scene.getMainCamera();
+        this.cameraNode = camera.node;
+        // Create rigidbody, and set non-zero mass so that the body becomes dynamic
+        var body = this.node.createComponent("RigidBody");
+        body.mass = 1.0;
+        // Set zero angular factor so that physics doesn't turn the character on its own.
+        // Instead we will control the character yaw manually
+        body.angularFactor = [0, 0, 0];
+        // Set the rigidbody to signal collision also when in rest, so that we get ground collisions properly
+        body.collisionEventMode = Atomic.COLLISION_ALWAYS;
+        // Set a capsule shape for collision
+        var shape = this.node.createComponent("CollisionShape");
+        shape.setCapsule(2, 4, [0, 2, 0]);
+    };
+    AvatarController.prototype.fixedUpdate = function (timeStep) {
+        //get a RigidBody component from the current node
+        var body = this.node.getComponent("RigidBody");
+        // Update the in air timer. Reset if grounded
+        if (!this.onGround) {
+            this.inAirTime += timeStep;
+        }
+        else {
+            this.inAirTime = 0.0;
+        }
+        // When character has been in air less than 1/10 second, it's still interpreted as being on ground
+        var softGrounded = this.inAirTime < INAIR_THRESHOLD_TIME;
+        // Get rotation of the current node
+        var rot = this.node.getRotation();
+        var moveDir = [0, 0, 0];
+        // Update movement & animation
+        var velocity = body.getLinearVelocity();
+        // Velocity on the XZ plane
+        var planeVelocity = [velocity[0], 0.0, velocity[2]];
+        if (this.cameraMode != 2) {
+            if (this.moveForward) {
+                gl_matrix_1.vec3.add(moveDir, moveDir, [0, 0, 1]);
+            }
+            if (this.moveBackwards) {
+                gl_matrix_1.vec3.add(moveDir, moveDir, [0, 0, -1]);
+            }
+            if (this.moveLeft) {
+                gl_matrix_1.vec3.add(moveDir, moveDir, [-1, 0, 0]);
+            }
+            if (this.moveRight) {
+                gl_matrix_1.vec3.add(moveDir, moveDir, [1, 0, 0]);
+            }
+        }
+        if (gl_matrix_1.vec3.length(moveDir) > 0.0) {
+            gl_matrix_1.vec3.normalize(moveDir, moveDir);
+        }
+        gl_matrix_1.vec3.transformQuat(moveDir, moveDir, [rot[1], rot[2], rot[3], rot[0]]);
+        gl_matrix_1.vec3.scale(moveDir, moveDir, (softGrounded ? MOVE_FORCE : INAIR_MOVE_FORCE));
+        if (this.softGrounded) {
+            gl_matrix_1.vec3.scale(moveDir, moveDir, this.speed);
+        }
+        body.applyImpulse(moveDir);
+        if (this.softGrounded) {
+            // When on ground, apply a braking force to limit maximum ground velocity
+            gl_matrix_1.vec3.negate(planeVelocity, planeVelocity);
+            gl_matrix_1.vec3.scale(planeVelocity, planeVelocity, BRAKE_FORCE);
+            body.applyImpulse(planeVelocity);
+            // Jump. Must release jump control inbetween jumps
+            if (this.button1) {
+                if (this.okToJump) {
+                    var jumpforce = [0, 1, 0];
+                    gl_matrix_1.vec3.scale(jumpforce, jumpforce, JUMP_FORCE);
+                    //Apply impulse to the body
+                    body.applyImpulse(jumpforce);
+                    this.okToJump = false;
+                }
+            }
+            else {
+                this.okToJump = true;
+            }
+        }
+        if (this.softGrounded && gl_matrix_1.vec3.length(moveDir) > 0.0) {
+            this.idle = false;
+        }
+        else {
+            this.idle = true;
+        }
+        // Reset grounded flag for next frame
+        this.onGround = true;
+    };
+    AvatarController.prototype.MoveCamera = function (timeStep) {
+        // Movement speed as world units per second
+        var MOVE_SPEED = 10.0;
+        // Mouse sensitivity as degrees per pixel
+        var MOUSE_SENSITIVITY = 0.1;
+        this.yaw = this.yaw + MOUSE_SENSITIVITY * this.mouseMoveX;
+        this.pitch = this.pitch + MOUSE_SENSITIVITY * this.mouseMoveY;
+        if (this.pitch < -90) {
+            this.pitch = -90;
+        }
+        if (this.pitch > 90) {
+            this.pitch = 90;
+        }
+        // Construct new orientation for the camera scene node from yaw and pitch. Roll is fixed to zero
+        this.cameraNode.rotation = QuatFromEuler(this.pitch, this.yaw, 0.0);
+        var speed = MOVE_SPEED * timeStep;
+        //translate camera on the amount of speed value
+        if (this.moveForward) {
+            this.cameraNode.translate([0.0, 0.0, this.speed]);
+        }
+        if (this.moveBackwards) {
+            this.cameraNode.translate([0.0, 0.0, -this.speed]);
+        }
+        if (this.moveLeft) {
+            this.cameraNode.translate([-speed, 0.0, 0.0]);
+        }
+        if (this.moveRight) {
+            this.cameraNode.translate([speed, 0.0, 0.0]);
+        }
+    };
+    AvatarController.prototype.UpdateControls = function () {
+        var input = Atomic.input;
+        this.moveForward = false;
+        this.moveBackwards = false;
+        this.moveLeft = false;
+        this.moveRight = false;
+        this.mouseMoveX = 0.0;
+        this.mouseMoveY = 0.0;
+        this.button0 = false;
+        this.button1 = false;
+        // Movement speed as world units per second
+        // let MOVE_SPEED = 20.0; -- unused
+        // Mouse sensitivity as degrees per pixel
+        // let MOUSE_SENSITIVITY = 0.1; -- unused
+        //check input
+        if (input.getKeyDown(Atomic.KEY_W) || input.getKeyDown(Atomic.KEY_UP)) {
+            this.moveForward = true;
+        }
+        if (input.getKeyDown(Atomic.KEY_S) || input.getKeyDown(Atomic.KEY_DOWN)) {
+            this.moveBackwards = true;
+        }
+        if (input.getKeyDown(Atomic.KEY_A) || input.getKeyDown(Atomic.KEY_LEFT)) {
+            this.moveLeft = true;
+        }
+        if (input.getKeyDown(Atomic.KEY_D) || input.getKeyDown(Atomic.KEY_RIGHT)) {
+            this.moveRight = true;
+        }
+        if (input.getKeyPress(Atomic.KEY_F)) {
+            this.button0 = true;
+        }
+        if (input.getKeyPress(Atomic.KEY_SPACE)) {
+            this.button1 = true;
+        }
+        //if we are on mobile
+        if (Atomic.platform == "Android" || Atomic.platform == "iOS") {
+            //iterate through each TouchState, if it doesn't touch any widgets, use it as a `mouse`
+            for (var i = 0; i < Atomic.input.getNumTouches(); i++) {
+                var touchState = Atomic.input.getTouch(i);
+                if (touchState.touchedWidget == null) {
+                    var delta = touchState.delta;
+                    this.mouseMoveX = delta[0];
+                    this.mouseMoveY = delta[1];
+                }
+            }
+        }
+        else {
+            // update mouse coordinates
+            this.mouseMoveX = input.getMouseMoveX();
+            this.mouseMoveY = input.getMouseMoveY();
+        }
+    };
+    AvatarController.prototype.update = function (timeStep) {
+        this.UpdateControls();
+        //if it's a free view
+        if (this.cameraMode != 2) {
+            this.yaw += this.mouseMoveX * YAW_SENSITIVITY;
+            this.pitch += this.mouseMoveY * YAW_SENSITIVITY;
+        }
+        if (this.pitch < -80) {
+            this.pitch = -80;
+        }
+        if (this.pitch > 80) {
+            this.pitch = 80;
+        }
+        if (this.button0) {
+            this.cameraMode++;
+            if (this.cameraMode == 3) {
+                this.cameraMode = 0;
+            }
+        }
+    };
+    //that function called right after update function
+    AvatarController.prototype.postUpdate = function (timestep) {
+        // Get camera lookat dir from character yaw + pitch
+        var rot = this.node.getRotation();
+        //create quaternion
+        var dir = gl_matrix_1.quat.create();
+        //set X value
+        gl_matrix_1.quat.setAxisAngle(dir, [1, 0, 0], (this.pitch * Math.PI / 180.0));
+        gl_matrix_1.quat.multiply(dir, [rot[1], rot[2], rot[3], rot[0]], dir);
+        var headNode = this.node.getChild("Head_Tip", true);
+        //if it's a FPS view
+        if (this.cameraMode == 1) {
+            var headPos = headNode.getWorldPosition();
+            var offset = [0.0, 0.15, 0.2];
+            gl_matrix_1.vec3.add(headPos, headPos, gl_matrix_1.vec3.transformQuat(offset, offset, [rot[1], rot[2], rot[3], rot[0]]));
+            this.cameraNode.setPosition(headPos);
+            this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+            gl_matrix_1.quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
+            this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+        }
+        //if it's a third person view
+        if (this.cameraMode == 0) {
+            var aimPoint = this.node.getWorldPosition();
+            var aimOffset = [0, 1.7, 0];
+            gl_matrix_1.vec3.transformQuat(aimOffset, aimOffset, dir);
+            gl_matrix_1.vec3.add(aimPoint, aimPoint, aimOffset);
+            var rayDir = gl_matrix_1.vec3.create();
+            gl_matrix_1.vec3.transformQuat(rayDir, [0, 0, -1], dir);
+            gl_matrix_1.vec3.scale(rayDir, rayDir, 8);
+            gl_matrix_1.vec3.add(aimPoint, aimPoint, rayDir);
+            this.cameraNode.setPosition(aimPoint);
+            this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+            gl_matrix_1.quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
+            this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+        }
+        else {
+            this.MoveCamera(timestep);
+        }
+    };
+    return AvatarController;
+}(Atomic.JSComponent));
+function QuatFromEuler(x, y, z) {
+    var M_PI = 3.14159265358979323846264338327950288;
+    var q = [0, 0, 0, 0];
+    x *= (M_PI / 360);
+    y *= (M_PI / 360);
+    z *= (M_PI / 360);
+    var sinX = Math.sin(x);
+    var cosX = Math.cos(x);
+    var sinY = Math.sin(y);
+    var cosY = Math.cos(y);
+    var sinZ = Math.sin(z);
+    var cosZ = Math.cos(z);
+    q[0] = cosY * cosX * cosZ + sinY * sinX * sinZ;
+    q[1] = cosY * sinX * cosZ + sinY * cosX * sinZ;
+    q[2] = sinY * cosX * cosZ - cosY * sinX * sinZ;
+    q[3] = cosY * cosX * sinZ - sinY * sinX * cosZ;
+    return q;
+}
+module.exports = AvatarController;

+ 250 - 110
Roboman3DTypeScript/Resources/Components/AvatarController.ts

@@ -1,124 +1,202 @@
-/// <reference path="../TypeScript/Atomic.d.ts"/>
-/// <reference path="../TypeScript/AtomicWork.d.ts" />
-/// <reference path="../Modules/gl-matrix.d.ts" />
-
-import {vec3, quat} from 'gl-matrix';
-
+// designate component
 "atomic component";
+//import gl-matrix library
+//https://github.com/toji/gl-matrix for more information
+import {vec3, quat} from "gl-matrix";
 
+//define constans
 const MOVE_FORCE = 1.8;
+const INAIR_MOVE_FORCE = 0.02;
 const BRAKE_FORCE = 0.2;
+const JUMP_FORCE = 7.0;
 const YAW_SENSITIVITY = 0.1;
-const PITCH_SENSITIVITY = 0.1;
+const INAIR_THRESHOLD_TIME = 0.1;
 
+//define a component AvatarController
 class AvatarController extends Atomic.JSComponent {
-
-    // define inspector fields
+    //define an inspectorFields to make variables visible in editor
     inspectorFields = {
-        speed: 1.0,
-        cameraDist: 12
-    }
+        //needs default value to make editor understand type of that value
+        speed: 1.0
+    };
 
-    camera: Atomic.Camera;
+    speed = 1.0;
     cameraNode: Atomic.Node;
-    body: Atomic.RigidBody;
-
-    yaw: number = 0;
-    pitch: number = 0;
+    onGround = true;
+    okToJump = true;
+    inAirTime = 0.0;
+    softGrounded = true;
 
-    mouseMoveX: number = 0;
-    mouseMoveY: number = 0;
 
-    moveForward: boolean = false;
-    moveBackwards: boolean = false;
-    moveLeft: boolean = false;
-    moveRight: boolean = false;
+    cameraMode = 0;
 
-    idle: boolean = true;
+    yaw = 0;
+    pitch = 0;
 
-    speed: number = 1;
-    cameraDist = 12;
+    moveForward = false;
+    moveBackwards = false;
+    moveLeft = false;
+    moveRight = false;
+    mouseMoveX = 0.0;
+    mouseMoveY = 0.0;
+    button0 = false;
+    button1 = false;
 
-    start() {
+    lastButton0 = false;
+    lastButton1 = false;
 
-        this.camera = this.node.scene.getMainCamera();
+    idle = true;
 
-        this.cameraNode = this.camera.node;
+    start() {
+        //get main camera and set its node to cameraNode
+        const camera = this.node.scene.getMainCamera();
+        this.cameraNode = camera.node;
 
         // Create rigidbody, and set non-zero mass so that the body becomes dynamic
-        this.body = <Atomic.RigidBody> this.node.createComponent("RigidBody");
-        this.body.mass = 1.0;
+        const body = <Atomic.RigidBody>this.node.createComponent("RigidBody");
+        body.mass = 1.0;
 
         // Set zero angular factor so that physics doesn't turn the character on its own.
         // Instead we will control the character yaw manually
-        this.body.angularFactor = [0, 0, 0];
+        body.angularFactor = [0, 0, 0];
 
         // Set the rigidbody to signal collision also when in rest, so that we get ground collisions properly
-        this.body.collisionEventMode = Atomic.COLLISION_ALWAYS;
+        body.collisionEventMode = Atomic.COLLISION_ALWAYS;
 
         // Set a capsule shape for collision
-        var shape = <Atomic.CollisionShape> this.node.createComponent("CollisionShape");
+        const shape = <Atomic.CollisionShape>this.node.createComponent("CollisionShape");
         shape.setCapsule(2, 4, [0, 2, 0]);
-
-
     }
 
-    update(timeStep: number) {
+    fixedUpdate(timeStep: number) {
 
-        this.updateControls();
+        //get a RigidBody component from the current node
+        const body = <Atomic.RigidBody>this.node.getComponent("RigidBody");
 
-    }
+        // Update the in air timer. Reset if grounded
+        if (!this.onGround) {
+            this.inAirTime += timeStep;
+        }
+        else {
+            this.inAirTime = 0.0;
+        }
 
-    fixedUpdate(timestep) {
+        // When character has been in air less than 1/10 second, it's still interpreted as being on ground
+        const softGrounded = this.inAirTime < INAIR_THRESHOLD_TIME;
 
-        var rot = this.node.getRotation();
+        // Get rotation of the current node
+        const rot = this.node.getRotation();
 
-        var moveDir = [0, 0, 0];
+        let moveDir = [0, 0, 0];
 
         // Update movement & animation
-        var velocity = this.body.getLinearVelocity();
+        const velocity = body.getLinearVelocity();
 
         // Velocity on the XZ plane
-        var planeVelocity = [velocity[0], 0.0, velocity[2]];
-
-        if (this.moveForward) {
-            vec3.add(moveDir, moveDir, [0, 0, 1])
-        }
-        if (this.moveBackwards) {
-            vec3.add(moveDir, moveDir, [0, 0, -1])
-        }
-        if (this.moveLeft) {
-            vec3.add(moveDir, moveDir, [-1, 0, 0])
-        }
-        if (this.moveRight) {
-            vec3.add(moveDir, moveDir, [1, 0, 0])
+        const planeVelocity = [velocity[0], 0.0, velocity[2]];
+
+        if (this.cameraMode != 2) {
+            if (this.moveForward) {
+                vec3.add(moveDir, moveDir, [0, 0, 1]);
+            }
+            if (this.moveBackwards) {
+                vec3.add(moveDir, moveDir, [0, 0, -1]);
+            }
+            if (this.moveLeft) {
+                vec3.add(moveDir, moveDir, [-1, 0, 0]);
+            }
+            if (this.moveRight) {
+                vec3.add(moveDir, moveDir, [1, 0, 0]);
+            }
         }
 
-        if (vec3.length(moveDir) > 0.0)
+        if (vec3.length(moveDir) > 0.0) {
             vec3.normalize(moveDir, moveDir);
+        }
 
         vec3.transformQuat(moveDir, moveDir, [rot[1], rot[2], rot[3], rot[0]]);
-        vec3.scale(moveDir, moveDir, (MOVE_FORCE));
+        vec3.scale(moveDir, moveDir, (softGrounded ? MOVE_FORCE : INAIR_MOVE_FORCE));
 
-        vec3.scale(moveDir, moveDir, this.speed);
+        if (this.softGrounded) {
+            vec3.scale(moveDir, moveDir, this.speed);
+        }
 
-        this.body.applyImpulse(moveDir);
+        body.applyImpulse(moveDir);
+
+        if (this.softGrounded) {
+
+            // When on ground, apply a braking force to limit maximum ground velocity
+            vec3.negate(planeVelocity, planeVelocity);
+            vec3.scale(planeVelocity, planeVelocity, BRAKE_FORCE);
+            body.applyImpulse(planeVelocity);
+
+            // Jump. Must release jump control inbetween jumps
+            if (this.button1) {
+                if (this.okToJump) {
+                    let jumpforce = [0, 1, 0];
+                    vec3.scale(jumpforce, jumpforce, JUMP_FORCE);
+                    //Apply impulse to the body
+                    body.applyImpulse(jumpforce);
+                    this.okToJump = false;
+                }
+            } else {
+                this.okToJump = true;
+            }
+        }
 
-        vec3.negate(planeVelocity, planeVelocity);
-        vec3.scale(planeVelocity, planeVelocity, BRAKE_FORCE);
-        this.body.applyImpulse(planeVelocity);
 
-        if (vec3.length(moveDir) > 0.0)
+        if (this.softGrounded && vec3.length(moveDir) > 0.0) {
             this.idle = false;
-        else
+        } else {
             this.idle = true;
+        }
 
+        // Reset grounded flag for next frame
+        this.onGround = true;
     }
 
+    MoveCamera(timeStep) {
+
+        // Movement speed as world units per second
+        const MOVE_SPEED = 10.0;
+        // Mouse sensitivity as degrees per pixel
+        const MOUSE_SENSITIVITY = 0.1;
+
+        this.yaw = this.yaw + MOUSE_SENSITIVITY * this.mouseMoveX;
+        this.pitch = this.pitch + MOUSE_SENSITIVITY * this.mouseMoveY;
+
+        if (this.pitch < -90) {
+            this.pitch = -90;
+        }
+
+        if (this.pitch > 90) {
+            this.pitch = 90;
+        }
+
+        // Construct new orientation for the camera scene node from yaw and pitch. Roll is fixed to zero
+        this.cameraNode.rotation = QuatFromEuler(this.pitch, this.yaw, 0.0);
+
+        let speed = MOVE_SPEED * timeStep;
+
+        //translate camera on the amount of speed value
+        if (this.moveForward) {
+            this.cameraNode.translate([0.0, 0.0, this.speed]);
+        }
+        if (this.moveBackwards) {
+            this.cameraNode.translate([0.0, 0.0, -this.speed]);
+        }
+        if (this.moveLeft) {
+            this.cameraNode.translate([-speed, 0.0, 0.0]);
+        }
+        if (this.moveRight) {
+            this.cameraNode.translate([speed, 0.0, 0.0]);
+        }
+
+    }
 
-    updateControls() {
+    UpdateControls() {
 
-        var input = Atomic.input;
+        let input = Atomic.input;
 
         this.moveForward = false;
         this.moveBackwards = false;
@@ -126,89 +204,151 @@ class AvatarController extends Atomic.JSComponent {
         this.moveRight = false;
         this.mouseMoveX = 0.0;
         this.mouseMoveY = 0.0;
+        this.button0 = false;
+        this.button1 = false;
 
         // Movement speed as world units per second
-        var MOVE_SPEED = 20.0;
+        // let MOVE_SPEED = 20.0; -- unused
+
         // Mouse sensitivity as degrees per pixel
-        var MOUSE_SENSITIVITY = 0.1;
+        // let MOUSE_SENSITIVITY = 0.1; -- unused
 
-        if (input.getKeyDown(Atomic.KEY_W))
+        //check input
+        if (input.getKeyDown(Atomic.KEY_W) || input.getKeyDown(Atomic.KEY_UP)) {
             this.moveForward = true;
-        if (input.getKeyDown(Atomic.KEY_S))
+        }
+        if (input.getKeyDown(Atomic.KEY_S) || input.getKeyDown(Atomic.KEY_DOWN)) {
             this.moveBackwards = true;
-        if (input.getKeyDown(Atomic.KEY_A))
+        }
+        if (input.getKeyDown(Atomic.KEY_A) || input.getKeyDown(Atomic.KEY_LEFT)) {
             this.moveLeft = true;
-        if (input.getKeyDown(Atomic.KEY_D))
+        }
+        if (input.getKeyDown(Atomic.KEY_D) || input.getKeyDown(Atomic.KEY_RIGHT)) {
             this.moveRight = true;
+        }
+
+        if (input.getKeyPress(Atomic.KEY_F)) {
+            this.button0 = true;
+        }
+        if (input.getKeyPress(Atomic.KEY_SPACE)) {
+            this.button1 = true;
+        }
+
+        //if we are on mobile
+        if (Atomic.platform == "Android" || Atomic.platform == "iOS") {
+            //iterate through each TouchState, if it doesn't touch any widgets, use it as a `mouse`
+            for (let i = 0; i < Atomic.input.getNumTouches(); i++) {
+                let touchState = Atomic.input.getTouch(i);
+                if (touchState.touchedWidget == null) {
+                    let delta = touchState.delta;
+                    this.mouseMoveX = delta[0];
+                    this.mouseMoveY = delta[1];
+                }
+            }
+            //if its a desktop
+        } else {
+            // update mouse coordinates
+            this.mouseMoveX = input.getMouseMoveX();
+            this.mouseMoveY = input.getMouseMoveY();
+        }
+
+    }
 
-        this.yaw += input.mouseMoveX * YAW_SENSITIVITY;
-        this.pitch += input.mouseMoveY * PITCH_SENSITIVITY;
+    update(timeStep) {
 
-        if (this.pitch < -80)
+        this.UpdateControls();
+
+        //if it's a free view
+        if (this.cameraMode != 2) {
+            this.yaw += this.mouseMoveX * YAW_SENSITIVITY;
+            this.pitch += this.mouseMoveY * YAW_SENSITIVITY;
+        }
+
+        if (this.pitch < -80) {
             this.pitch = -80;
-        if (this.pitch > 80)
+        }
+        if (this.pitch > 80) {
             this.pitch = 80;
+        }
 
+        if (this.button0) {
+            this.cameraMode++;
+            if (this.cameraMode == 3) {
+                this.cameraMode = 0;
+            }
+        }
     }
 
-    postUpdate(timestep) {
+    //that function called right after update function
+    postUpdate(timestep: number) {
 
         // Get camera lookat dir from character yaw + pitch
-        var rot = this.node.getRotation();
-
-        var dir = quat.create();
+        let rot = this.node.getRotation();
 
+        //create quaternion
+        let dir = quat.create();
+        //set X value
         quat.setAxisAngle(dir, [1, 0, 0], (this.pitch * Math.PI / 180.0));
 
         quat.multiply(dir, [rot[1], rot[2], rot[3], rot[0]], dir);
 
-        var headNode = this.node.getChild("Head_Tip", true);
+        let headNode = this.node.getChild("Head_Tip", true);
 
-        var aimPoint = <number[]> this.node.getWorldPosition();
-        var aimOffset = [0, 1.7, 0];
-        vec3.transformQuat(aimOffset, aimOffset, dir);
-        vec3.add(aimPoint, aimPoint, aimOffset);
+        //if it's a FPS view
+        if (this.cameraMode == 1) {
 
-        var rayDir = vec3.create();
-        vec3.transformQuat(rayDir, [0, 0, -1], dir);
-        vec3.scale(rayDir, rayDir, this.cameraDist);
+            let headPos = <number[]>headNode.getWorldPosition();
+            let offset = [0.0, 0.15, 0.2];
+            vec3.add(headPos, headPos, vec3.transformQuat(offset, offset, [rot[1], rot[2], rot[3], rot[0]]));
+            this.cameraNode.setPosition(headPos);
+            this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+            quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
+            this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
 
-        vec3.add(aimPoint, aimPoint, rayDir);
+        }
+        //if it's a third person view
+        if (this.cameraMode == 0) {
 
-        this.cameraNode.setPosition(aimPoint);
-        this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
-        quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
-        this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+            let aimPoint = <number[]>this.node.getWorldPosition();
+            let aimOffset = [0, 1.7, 0];
+            vec3.transformQuat(aimOffset, aimOffset, dir);
+            vec3.add(aimPoint, aimPoint, aimOffset);
 
-    }
+            let rayDir = vec3.create();
+            vec3.transformQuat(rayDir, [0, 0, -1], dir);
+            vec3.scale(rayDir, rayDir, 8);
+
+            vec3.add(aimPoint, aimPoint, rayDir);
 
+            this.cameraNode.setPosition(aimPoint);
+            this.cameraNode.setRotation([dir[3], dir[0], dir[1], dir[2]]);
+            quat.setAxisAngle(dir, [0, 1, 0], (this.yaw * Math.PI / 180.0));
+            this.node.setRotation([dir[3], dir[0], dir[1], dir[2]]);
 
+        }
+        else {
+            this.MoveCamera(timestep);
+        }
+    }
 }
 
 function QuatFromEuler(x, y, z) {
-
-    var M_PI = 3.14159265358979323846264338327950288;
-
-    var q = [0, 0, 0, 0];
-
-    // Order of rotations: Z first, then X, then Y (mimics typical FPS camera with gimbal lock at top/bottom)
+    const M_PI = 3.14159265358979323846264338327950288;
+    let q = [0, 0, 0, 0];
     x *= (M_PI / 360);
     y *= (M_PI / 360);
     z *= (M_PI / 360);
-    var sinX = Math.sin(x);
-    var cosX = Math.cos(x);
-    var sinY = Math.sin(y);
-    var cosY = Math.cos(y);
-    var sinZ = Math.sin(z);
-    var cosZ = Math.cos(z);
-
+    const sinX = Math.sin(x);
+    const cosX = Math.cos(x);
+    const sinY = Math.sin(y);
+    const cosY = Math.cos(y);
+    const sinZ = Math.sin(z);
+    const cosZ = Math.cos(z);
     q[0] = cosY * cosX * cosZ + sinY * sinX * sinZ;
     q[1] = cosY * sinX * cosZ + sinY * cosX * sinZ;
     q[2] = sinY * cosX * cosZ - cosY * sinX * sinZ;
     q[3] = cosY * cosX * sinZ - sinY * sinX * cosZ;
-
     return q;
 }
 
-
 export = AvatarController;

+ 7 - 0
Roboman3DTypeScript/Resources/Components/AvatarController.ts.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "a13c8cd8c02dc67eb2275ccff2f1aaaf",
+	"TypeScriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 45 - 29
Roboman3DTypeScript/Resources/Components/Roboman.js

@@ -1,29 +1,45 @@
-/// <reference path="../TypeScript/Atomic.d.ts"/>
-/// <reference path="../TypeScript/AtomicWork.d.ts" />
-"atomic component";
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    __.prototype = b.prototype;
-    d.prototype = new __();
-};
-var Roboman = (function (_super) {
-    __extends(Roboman, _super);
-    function Roboman() {
-        _super.apply(this, arguments);
-    }
-    Roboman.prototype.start = function () {
-        var node = this.node;
-        this.animCtrl = node.getComponent("AnimationController");
-        this.controller = node.getJSComponent("AvatarController");
-        this.animCtrl.playExclusive("Idle", 0, true, 0.0);
-    };
-    Roboman.prototype.update = function (timeStep) {
-        if (this.controller.idle)
-            this.animCtrl.playExclusive("Idle", 0, true, 0.1);
-        else
-            this.animCtrl.playExclusive("Run", 0, true, 0.1);
-    };
-    return Roboman;
-})(Atomic.JSComponent);
-module.exports = Roboman;
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+// designate component
+"atomic component";
+//A RoboMan component
+var Roboman = (function (_super) {
+    __extends(Roboman, _super);
+    function Roboman() {
+        _super.apply(this, arguments);
+        this.idle = true;
+    }
+    Roboman.prototype.start = function () {
+        this.animCtrl = this.node.getComponent("AnimationController");
+        this.controller = this.node.getJSComponent("AvatarController");
+        //get main camera of the current scene
+        var camera = this.node.scene.getMainCamera();
+        //if it exist
+        if (camera) {
+            camera.node.position = [0, 0, -10];
+            camera.node.pitch(20);
+        }
+        this.animCtrl.playExclusive("Idle", 0, true, 0.0);
+        //rotate current node around Y axis
+        this.node.yaw(180);
+    };
+    Roboman.prototype.update = function (timeStep) {
+        //rotate current node around Y axis
+        this.node.yaw(180);
+        if (this.idle != this.controller.idle) {
+            this.idle = this.controller.idle;
+            if (this.idle) {
+                this.animCtrl.playExclusive("Idle", 0, true, 0.1);
+            }
+            else {
+                this.animCtrl.playExclusive("Run", 0, true, 0.1);
+            }
+        }
+    };
+    return Roboman;
+}(Atomic.JSComponent));
+module.exports = Roboman;

+ 26 - 12
Roboman3DTypeScript/Resources/Components/Roboman.ts

@@ -1,34 +1,48 @@
-/// <reference path="../TypeScript/Atomic.d.ts"/>
-/// <reference path="../TypeScript/AtomicWork.d.ts" />
+import AvatarController = require("./AvatarController");
 
+// designate component
 "atomic component";
 
-import AvatarController = require("./AvatarController");
-
+//A RoboMan component
 class Roboman extends Atomic.JSComponent {
 
     start() {
 
-        var node = this.node;
+        this.animCtrl = <Atomic.AnimationController>this.node.getComponent("AnimationController");
+        this.controller = <AvatarController>this.node.getJSComponent("AvatarController");
 
-        this.animCtrl = <Atomic.AnimationController> node.getComponent("AnimationController");
-        this.controller = <AvatarController> node.getJSComponent("AvatarController");
+        //get main camera of the current scene
+        const camera = this.node.scene.getMainCamera();
+        //if it exist
+        if (camera) {
+            camera.node.position = [0, 0, -10];
+            camera.node.pitch(20);
+        }
 
         this.animCtrl.playExclusive("Idle", 0, true, 0.0);
-
+        //rotate current node around Y axis
+        this.node.yaw(180);
     }
 
     update(timeStep: number) {
 
-        if (this.controller.idle)
-            this.animCtrl.playExclusive("Idle", 0, true, 0.1);
-        else
-            this.animCtrl.playExclusive("Run", 0, true, 0.1);
+        //rotate current node around Y axis
+        this.node.yaw(180);
+
+        if (this.idle != this.controller.idle) {
+            this.idle = this.controller.idle;
 
+            if (this.idle) {
+                this.animCtrl.playExclusive("Idle", 0, true, 0.1);
+            } else {
+                this.animCtrl.playExclusive("Run", 0, true, 0.1);
+            }
+        }
     }
 
     controller: AvatarController;
     animCtrl: Atomic.AnimationController;
+    idle = true;
 
 }
 

+ 7 - 0
Roboman3DTypeScript/Resources/Components/Roboman.ts.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "1cc6ef157ce1cb9134d8c6a01bb6b5ca",
+	"TypeScriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Crate.fbx.asset

@@ -1,6 +1,6 @@
 {
 	"version": 1,
-	"guid": "79ec41080b4462c1557456e1a838d85e",
+	"guid": "36ba46e851eaa3896f434f50d34cbda6",
 	"ModelImporter": {
 		"scale": 1,
 		"importAnimations": false,

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Ground.fbx.asset

@@ -1,6 +1,6 @@
 {
 	"version": 1,
-	"guid": "d13f4de7c37ef066793b23eb12fa7289",
+	"guid": "15934bd919b214d7f7810775e5d852d3",
 	"ModelImporter": {
 		"scale": 1,
 		"importAnimations": false,

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Materials.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "2569a1ad2976629d0688b3f278a0a0df",
+	"guid": "6624ccbe132ffe065388f0f017b88628",
 	"FolderImporter": {}
 }

+ 2 - 9
Roboman3DTypeScript/Resources/Models/Materials/Crate.Basic.material

@@ -1,17 +1,10 @@
 <?xml version="1.0"?>
 <material>
-	<technique name="Techniques/DiffNormalSpec.xml" quality="0" loddistance="0" />
+	<technique name="Techniques/DiffNormalSpec.xml" />
 	<texture unit="diffuse" name="Textures/Crate-Diffuse.jpg" />
 	<texture unit="normal" name="Textures/Crate-Normal.jpg" />
 	<texture unit="specular" name="Textures/Crate-Specular.jpg" />
-	<parameter name="UOffset" value="1 0 0 0" />
-	<parameter name="VOffset" value="0 1 0 0" />
 	<parameter name="MatDiffColor" value="0.64 0.64 0.64 1" />
-	<parameter name="MatEmissiveColor" value="0 0 0 1" />
-	<parameter name="MatEnvMapColor" value="1 1 1" />
 	<parameter name="MatSpecColor" value="0.5 0.5 0.5 9.60784" />
-	<cull value="ccw" />
-	<shadowcull value="ccw" />
-	<fill value="solid" />
-	<depthbias constant="0" slopescaled="0" />
+	<parameter name="MatEmissiveColor" value="0 0 0 1" />
 </material>

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Materials/Crate.Basic.material.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "c044ca5a75af687be42b3eaf7543ffbe",
+	"guid": "153f6788464b746c4e34407a27fc2696",
 	"MaterialImporter": {}
 }

+ 3 - 3
Roboman3DTypeScript/Resources/Models/Materials/DefaultMaterial.material

@@ -2,12 +2,12 @@
 <material>
 	<technique name="Techniques/Diff.xml" quality="0" loddistance="0" />
 	<texture unit="diffuse" name="Textures/BlueGrid.png" />
-	<parameter name="UOffset" value="16 0 0 0" />
-	<parameter name="VOffset" value="0 16 0 0" />
+	<parameter name="UOffset" value="8 0 0 0" />
+	<parameter name="VOffset" value="0 8 0 0" />
 	<parameter name="MatDiffColor" value="0.8 0.8 0.8 1" />
 	<parameter name="MatEmissiveColor" value="0 0 0 1" />
 	<parameter name="MatEnvMapColor" value="1 1 1" />
-	<parameter name="MatSpecColor" value="1 1 1 1" />
+	<parameter name="MatSpecColor" value="0.6 0.6 0.6 16" />
 	<cull value="ccw" />
 	<shadowcull value="ccw" />
 	<fill value="solid" />

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Materials/DefaultMaterial.material.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "49ab5153c450ff55fd534434c8dcbe8e",
+	"guid": "b5d7107a4d4aa450e70ca23d82c47141",
 	"MaterialImporter": {}
 }

+ 2 - 9
Roboman3DTypeScript/Resources/Models/Materials/Pallet.material

@@ -1,17 +1,10 @@
 <?xml version="1.0"?>
 <material>
-	<technique name="Techniques/DiffNormalSpec.xml" quality="0" loddistance="0" />
+	<technique name="Techniques/DiffNormalSpec.xml" />
 	<texture unit="diffuse" name="Textures/Pallet-Difuse.jpg" />
 	<texture unit="normal" name="Textures/Pallet-Normal.jpg" />
 	<texture unit="specular" name="Textures/Pallet-Specular.jpg" />
-	<parameter name="UOffset" value="1 0 0 0" />
-	<parameter name="VOffset" value="0 1 0 0" />
 	<parameter name="MatDiffColor" value="0.64 0.64 0.64 1" />
-	<parameter name="MatEmissiveColor" value="0 0 0 1" />
-	<parameter name="MatEnvMapColor" value="1 1 1" />
 	<parameter name="MatSpecColor" value="0.5 0.5 0.5 9.60784" />
-	<cull value="ccw" />
-	<shadowcull value="ccw" />
-	<fill value="solid" />
-	<depthbias constant="0" slopescaled="0" />
+	<parameter name="MatEmissiveColor" value="0 0 0 1" />
 </material>

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Materials/Pallet.material.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "78ea4b7da9e4e54c1b654700d2392729",
+	"guid": "05ba50117cf320362b848bd9c648e2be",
 	"MaterialImporter": {}
 }

+ 2 - 2
Roboman3DTypeScript/Resources/Models/Materials/Robot_01_mat.material

@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
 <material>
 	<technique name="Techniques/Diff.xml" quality="0" loddistance="0" />
-	<texture unit="diffuse" name="Textures/AtomicRobot_01_Diffuse.png" />
+	<texture unit="diffuse" name="Textures/AtomicRobot.png" />
 	<parameter name="UOffset" value="1 0 0 0" />
 	<parameter name="VOffset" value="0 1 0 0" />
 	<parameter name="MatDiffColor" value="0.8 0.8 0.8 1" />
 	<parameter name="MatEmissiveColor" value="0 0 0 1" />
 	<parameter name="MatEnvMapColor" value="1 1 1" />
-	<parameter name="MatSpecColor" value="0.6 0.6 0.6 16" />
+	<parameter name="MatSpecColor" value="0.4 0.4 0.4 16" />
 	<cull value="ccw" />
 	<shadowcull value="ccw" />
 	<fill value="solid" />

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Materials/Robot_01_mat.material.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "c62b2bc5d7b673dc92c31c7b2f2da210",
+	"guid": "75252c6d50e5b9694e30345c8aae1952",
 	"MaterialImporter": {}
 }

+ 1 - 1
Roboman3DTypeScript/Resources/Models/Pallet.fbx.asset

@@ -1,6 +1,6 @@
 {
 	"version": 1,
-	"guid": "c43aa0822c8c1ae85e7d9dbbbd9babe3",
+	"guid": "57fddae4d4352ac0b9c3036f28f9e62b",
 	"ModelImporter": {
 		"scale": 4,
 		"importAnimations": false,

BIN
Roboman3DTypeScript/Resources/Models/Plane.blend


+ 9 - 0
Roboman3DTypeScript/Resources/Models/Plane.blend.asset

@@ -0,0 +1,9 @@
+{
+	"version": 1,
+	"guid": "895f519a3a33e921a43471088cba958b",
+	"ModelImporter": {
+		"scale": 1,
+		"importAnimations": false,
+		"animInfo": []
+	}
+}

+ 7 - 2
Roboman3DTypeScript/Resources/Models/Robo_01.fbx

@@ -1,8 +1,8 @@
 {
 	"version": 1,
-	"guid": "d38e388fff4ff0de84b3eee74e36d66f",
+	"guid": "e30fa79a0b75b75cbe5b03a73baa28a5",
 	"ModelImporter": {
-		"scale": 0.75,
+		"scale": 0.5,
 		"importAnimations": true,
 		"animInfo": [
 			{
@@ -10,6 +10,11 @@
 				"startTime": 1,
 				"endTime": 49
 			},
+			{
+				"name": "Walk",
+				"startTime": 81,
+				"endTime": 107
+			},
 			{
 				"name": "Run",
 				"startTime": 108,

+ 38 - 0
Roboman3DTypeScript/Resources/Modules/DPad.d.ts

@@ -0,0 +1,38 @@
+// Type definition for DPad.js
+declare module "DPad" {
+    export class DPad {
+        constructor();
+
+        //init function should be called adding vertical/horizontal buttons
+        //it's like we are commiting ours buttons
+        init(view?: Atomic.UIView);
+
+        //adds horizontal and vertical buttons
+        addAll();
+
+        //adds horizontal buttons
+        addHorizontal();
+
+        //adds vertical buttons
+        addVertical();
+
+        //inits layout prams for up/down buttons
+        initUpDownLayoutParams();
+
+        //inits layout params for left/right buttons
+        initLeftRightLayoutParams();
+
+        //set horizontal spacing
+        setSpacingX(spacing: number);
+
+        //set vertical spacing
+        setSpacingY(spacing: number);
+
+        //set view position
+        setPosition(x: number, y: number);
+
+        updateViewSize();
+
+        remove();
+    }
+}

+ 7 - 0
Roboman3DTypeScript/Resources/Modules/DPad.d.ts.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "618f27713f90a2d1ad44595ad729712c",
+	"TypeScriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 183 - 0
Roboman3DTypeScript/Resources/Modules/DPad.js

@@ -0,0 +1,183 @@
+function DPad() {
+
+    var width = Atomic.graphics.width;
+    var height = Atomic.graphics.height;
+    //create a new view for ours dpad
+    //horizontal buttons sizeX, sizeY
+    var horizButtonsSize = [75, 61];
+    var verticButtonsSize = [61, 75];
+    var dpadSpacingX = -30;
+    var dpadSpacingY = 30;
+    //init function should be called adding vertical/horizontal buttons
+    //it's like we are commiting ours buttons
+    this.init = function(view) {
+      if (view) this.view = view;
+      else this.view = new Atomic.UIView();
+      //if  touch buttons skin is not loaded
+      if(!DPad.skinLoaded) {
+        //load skin
+        Atomic.ui.loadSkin("UI/DPadSkin.ui");
+        DPad.skinLoaded = true;
+      }
+      //create a dpad layout
+      this.dpad = new Atomic.UILayout();
+      this.dpad.rect = this.view.rect;
+      if(this.leftLayout)
+        this.leftLayout.rect = this.dpad.rect;
+      if(this.rightLayout)
+        this.rightLayout.rect = this.dpad.rect;
+      if(this.upDownLayout)
+        this.upDownLayout.rect = this.dpad.rect;
+      //sets dpad position
+      //move buttons a bit closer to each other
+      this.dpad.spacing = dpadSpacingX;
+      if(this.upDownLayout)
+        this.upDownLayout.spacing = dpadSpacingY;
+      //if layouts are exists, add them
+      if(this.leftLayout)
+        this.dpad.addChild(this.leftLayout);
+      if(this.upDownLayout)
+        this.dpad.addChild(this.upDownLayout);
+      if(this.rightLayout)
+        this.dpad.addChild(this.rightLayout);
+      //ok, add ours dpad to the view
+      this.view.addChild(this.dpad);
+      //if we are using special view for dpad
+      if(!view) {
+        //update its size and position
+        this.updateViewSize();
+        this.setPosition(width/20, height/2);
+      } else {
+        //if we are using custom view, then just set dpad position
+        this.dpad.setPosition(-width/3, height/4);
+      }
+    }
+    //adds horizontal and vertical buttons
+    this.addAll = function() {
+      //adds horizontal buttons
+      this.addHorizontal();
+      //adds vertical buttons
+      this.addVertical();
+
+    }
+    //adds horizontal buttons
+    this.addHorizontal = function() {
+      //if layout params doesn't exist create a new one
+      if(!this.layoutParamsLeftRight) this.initLeftRightLayoutParams();
+      //new layout for left button
+      this.leftLayout = new Atomic.UILayout();
+      this.leftLayout.layoutSize = Atomic.UI_LAYOUT_SIZE_PREFERRED;
+      //create a left button
+      this.leftButton = new Atomic.UIButton();
+      this.leftButton.skinBg = "TouchButtonLeft";
+      this.leftButton.layoutParams = this.layoutParamsLeftRight;
+      this.leftLayout.addChild(this.leftButton);
+      //new layout for right button
+      this.rightLayout = new Atomic.UILayout();
+      this.rightLayout.layoutSize = Atomic.UI_LAYOUT_SIZE_PREFERRED;
+      //create a right button
+      this.rightButton = new Atomic.UIButton();
+      this.rightButton.skinBg = "TouchButtonRight";
+      this.rightButton.layoutParams = this.layoutParamsLeftRight;
+      this.rightLayout.addChild(this.rightButton);
+
+
+      //it makes ours buttons uncaptured, this is used for the multiTouch, to don't `concentrate` only on one button
+      this.leftButton.setCapturing(false);
+      this.rightButton.setCapturing(false);
+
+      //bind our ui button to the specified Keyboard Key
+      Atomic.input.bindButton(this.rightButton, Atomic.KEY_RIGHT);
+      Atomic.input.bindButton(this.leftButton, Atomic.KEY_LEFT);
+
+    }
+    //adds vertical buttons
+    this.addVertical = function() {
+      //if layout params doesn't exist create a new one
+      if(!this.layoutParamsUpDown) this.initUpDownLayoutParams();
+      //create a new layout for up and down buttons
+      this.upDownLayout = new Atomic.UILayout();
+      this.upDownLayout.axis = Atomic.UI_AXIS_Y;
+      this.upDownLayout.spacing = 50;
+      //create an up buttons
+      this.upButton = new Atomic.UIButton();
+      this.upButton.skinBg = "TouchButtonUp";
+      this.upButton.layoutParams = this.layoutParamsUpDown;
+      this.upDownLayout.addChild(this.upButton);
+      //create a down button
+      this.downButton = new Atomic.UIButton();
+      this.downButton.skinBg = "TouchButtonDown";
+      this.downButton.layoutParams = this.layoutParamsUpDown;
+      this.upDownLayout.addChild(this.downButton);
+
+      this.upDownLayout.layoutSize = Atomic.UI_LAYOUT_SIZE_PREFERRED;
+
+      //it makes ours buttons uncaptured, this is used for the multiTouch, to don't `concentrate` only on one button
+      this.upButton.setCapturing(false);
+      this.downButton.setCapturing(false);
+
+      //bind our ui button to the specified Keyboard Button
+      Atomic.input.bindButton(this.upButton, Atomic.KEY_UP);
+      Atomic.input.bindButton(this.downButton, Atomic.KEY_DOWN);
+
+    }
+
+    //inits layout prams for up/down buttons
+    this.initUpDownLayoutParams = function() {
+
+      this.layoutParamsUpDown = new Atomic.UILayoutParams();
+
+      this.layoutParamsUpDown.minWidth = verticButtonsSize[0];
+      this.layoutParamsUpDown.minHeight = verticButtonsSize[1];
+
+      this.layoutParamsUpDown.width = verticButtonsSize[0]*2;
+      this.layoutParamsUpDown.height = verticButtonsSize[1]*2;
+
+      this.layoutParamsUpDown.maxWidth = verticButtonsSize[0]*6;
+      this.layoutParamsUpDown.maxHeight = verticButtonsSize[1]*6;
+
+    }
+
+    //inits layout params for left/right buttons
+    this.initLeftRightLayoutParams = function() {
+
+      this.layoutParamsLeftRight = new Atomic.UILayoutParams();
+
+      this.layoutParamsLeftRight.minWidth = horizButtonsSize[0];
+      this.layoutParamsLeftRight.minHeight = horizButtonsSize[1];
+
+      this.layoutParamsLeftRight.width = horizButtonsSize[0]*2;
+      this.layoutParamsLeftRight.height = horizButtonsSize[1]*2;
+
+      this.layoutParamsLeftRight.maxWidth = horizButtonsSize[0]*6;
+      this.layoutParamsLeftRight.maxHeight = horizButtonsSize[1]*6;
+
+    }
+
+    //set horizontal spacing
+    this.setSpacingX = function(spacing) {
+      dpadSpacingX = spacing;
+      this.dpad.spacing = spacing;
+    }
+
+    //set vertical spacing
+    this.setSpacingY = function(spacing) {
+      dpadSpacingY = spacing;
+      this.upDownLayout.spacing = spacing;
+    }
+
+    //set view position
+    this.setPosition = function(x, y) {
+      this.view.setPosition(x, y);
+    }
+
+    this.updateViewSize = function() {
+      this.view.setSize(horizButtonsSize[0]*4+verticButtonsSize[0]*2+dpadSpacingX, horizButtonsSize[1]*2+verticButtonsSize[1]*4+dpadSpacingY);
+    }
+
+    this.remove = function() {
+      this.view.removeChild(this.dpad);
+    }
+}
+
+module.exports = DPad;

+ 7 - 0
Roboman3DTypeScript/Resources/Modules/DPad.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "47051f6659671304bba3d08ab4ccf711",
+	"JavascriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 7 - 0
Roboman3DTypeScript/Resources/Modules/gl-matrix.d.ts.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "2d15e79c1beb8f85617c7712f50d497b",
+	"TypeScriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 6 - 7
Roboman3DTypeScript/Resources/Prefabs/Crate.prefab

@@ -1,21 +1,20 @@
 <?xml version="1.0"?>
-<node id="365">
+<node id="448">
 	<attribute name="Is Enabled" value="true" />
 	<attribute name="Name" value="Crate" />
-	<attribute name="Position" value="0 3.7305 0" />
+	<attribute name="Position" value="0 0 0" />
 	<attribute name="Rotation" value="1 0 0 0" />
 	<attribute name="Scale" value="1 1 1" />
 	<attribute name="Variables" />
-	<component type="StaticModel" id="1980">
-		<attribute name="Model" value="Model;79ec41080b4462c1557456e1a838d85e.mdl" />
+	<component type="StaticModel" id="2402">
+		<attribute name="Model" value="Model;36ba46e851eaa3896f434f50d34cbda6.mdl" />
 		<attribute name="Material" value="Material;Models/Materials/Crate.Basic.material" />
 		<attribute name="Cast Shadows" value="true" />
 	</component>
-	<component type="CollisionShape" id="1981">
+	<component type="CollisionShape" id="2403">
 		<attribute name="Size" value="2 2 2" />
 	</component>
-	<component type="RigidBody" id="1982">
-		<attribute name="Physics Position" value="0 3.7305 0" />
+	<component type="RigidBody" id="2404">
 		<attribute name="Mass" value="1" />
 	</component>
 </node>

+ 1 - 1
Roboman3DTypeScript/Resources/Prefabs/Crate.prefab.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "36bf96b8dc4bf9b244e640f76ca8e4df",
+	"guid": "f28b0342cc83510cd46702d551c58f02",
 	"PrefabImporter": {}
 }

+ 5 - 6
Roboman3DTypeScript/Resources/Prefabs/Pallet.prefab

@@ -1,21 +1,20 @@
 <?xml version="1.0"?>
-<node id="379">
+<node id="451">
 	<attribute name="Is Enabled" value="true" />
 	<attribute name="Name" value="Pallet" />
 	<attribute name="Position" value="0 0 0" />
 	<attribute name="Rotation" value="1 0 0 0" />
 	<attribute name="Scale" value="1 1 1" />
 	<attribute name="Variables" />
-	<component type="StaticModel" id="2005">
-		<attribute name="Model" value="Model;c43aa0822c8c1ae85e7d9dbbbd9babe3.mdl" />
+	<component type="StaticModel" id="2405">
+		<attribute name="Model" value="Model;57fddae4d4352ac0b9c3036f28f9e62b.mdl" />
 		<attribute name="Material" value="Material;Models/Materials/Pallet.material" />
 		<attribute name="Cast Shadows" value="true" />
 	</component>
-	<component type="CollisionShape" id="2006">
+	<component type="CollisionShape" id="2406">
 		<attribute name="Size" value="4.064 0.609602 4.8768" />
 	</component>
-	<component type="RigidBody" id="2007">
-		<attribute name="Physics Position" value="-7.6669 4.1864 0" />
+	<component type="RigidBody" id="2407">
 		<attribute name="Mass" value="1" />
 	</component>
 </node>

+ 1 - 1
Roboman3DTypeScript/Resources/Prefabs/Pallet.prefab.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "00b07a518bf4b42fc70159163d3a53c6",
+	"guid": "9e1083378dc59da1d98981cf2acf9f7c",
 	"PrefabImporter": {}
 }

+ 11 - 11
Roboman3DTypeScript/Resources/Prefabs/Robo_01.prefab

@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
-<node id="438">
+<node id="386">
 	<attribute name="Is Enabled" value="true" />
 	<attribute name="Name" value="Robo_01" />
 	<attribute name="Position" value="0 0 0" />
 	<attribute name="Rotation" value="1 0 0 0" />
 	<attribute name="Scale" value="1 1 1" />
 	<attribute name="Variables" />
-	<component type="AnimatedModel" id="2118">
-		<attribute name="Model" value="Model;d38e388fff4ff0de84b3eee74e36d66f.mdl" />
+	<component type="AnimatedModel" id="2244">
+		<attribute name="Model" value="Model;e30fa79a0b75b75cbe5b03a73baa28a5.mdl" />
 		<attribute name="Material" value="Material;Models/Materials/Robot_01_mat.material" />
 		<attribute name="Cast Shadows" value="true" />
 		<attribute name="Bone Animation Enabled">
@@ -183,20 +183,20 @@
 			<variant type="Int" value="0" />
 		</attribute>
 	</component>
-	<component type="AnimationController" id="2119">
+	<component type="AnimationController" id="2245">
 		<attribute name="Node Animation States">
 			<variant type="Int" value="0" />
 		</attribute>
-		<attribute name="Animation Resources" value="Animation;d38e388fff4ff0de84b3eee74e36d66f_Idle.ani;d38e388fff4ff0de84b3eee74e36d66f_Run.ani" />
+		<attribute name="Autoplay" value="false" />
+		<attribute name="AnimationResources" value="Animation;e30fa79a0b75b75cbe5b03a73baa28a5_Idle.ani;e30fa79a0b75b75cbe5b03a73baa28a5_Walk.ani;e30fa79a0b75b75cbe5b03a73baa28a5_Run.ani" />
 	</component>
-	<component type="JSComponent" id="2120">
-		<attribute name="ComponentFile" value="JSComponentFile;Components/Roboman.js" />
+	<component type="JSComponent" id="2246">
+		<attribute name="ComponentFile" value="JSComponentFile;Components/RoboMan.js" />
 	</component>
-	<component type="JSComponent" id="2121">
+	<component type="JSComponent" id="2008">
+		<attribute name="ComponentFile" value="JSComponentFile;Components/AvatarController.js" />
 		<attribute name="FieldValues">
-			<variant hash="2079012011" type="Float" value="12" />
-			<variant hash="273365031" type="Float" value="1.5" />
+			<variant hash="273365031" type="Float" value="1" />
 		</attribute>
-		<attribute name="ComponentFile" value="JSComponentFile;Components/AvatarController.js" />
 	</component>
 </node>

+ 1 - 1
Roboman3DTypeScript/Resources/Prefabs/Robo_01.prefab.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "e8cb3d94df18b9e5bacca4ccdadeec3a",
+	"guid": "fd7bc91efd0b91d949c35435539dcbc8",
 	"PrefabImporter": {}
 }

+ 16 - 0
Roboman3DTypeScript/Resources/Prefabs/Water.prefab

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<node id="374">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="Water" />
+	<attribute name="Position" value="0 0 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticModel" id="1979">
+		<attribute name="Model" value="Model;895f519a3a33e921a43471088cba958b.mdl" />
+		<attribute name="Material" value="Material;Models/Materials/DefaultMaterial.material" />
+	</component>
+	<component type="JSComponent" id="1984">
+		<attribute name="Component Name" value="Water" />
+	</component>
+</node>

+ 5 - 0
Roboman3DTypeScript/Resources/Prefabs/Water.prefab.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "59441bd8e6b45f7db38165c3cfca4255",
+	"PrefabImporter": {}
+}

+ 0 - 169
Roboman3DTypeScript/Resources/Scenes/Scene.scene

@@ -1,169 +0,0 @@
-<?xml version="1.0"?>
-<scene id="1">
-	<attribute name="Name" value="" />
-	<attribute name="Time Scale" value="1" />
-	<attribute name="Smoothing Constant" value="50" />
-	<attribute name="Snap Threshold" value="5" />
-	<attribute name="Elapsed Time" value="0" />
-	<attribute name="Next Replicated Node ID" value="439" />
-	<attribute name="Next Replicated Component ID" value="2123" />
-	<attribute name="Next Local Node ID" value="16778496" />
-	<attribute name="Next Local Component ID" value="16777216" />
-	<attribute name="Variables" />
-	<attribute name="Variable Names" value="" />
-	<component type="PhysicsWorld" id="1" />
-	<component type="Octree" id="2" />
-	<component type="DebugRenderer" id="3" />
-	<node id="2">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Zone" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="Zone" id="4">
-			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
-			<attribute name="Bounding Box Max" value="10000 10000 10000" />
-			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
-		</component>
-	</node>
-	<node id="3">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="GlobalLight" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="0.888074 0.325058 -0.325058 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="Light" id="5">
-			<attribute name="Light Type" value="Directional" />
-			<attribute name="Cast Shadows" value="true" />
-			<attribute name="CSM Splits" value="10 20 50 0" />
-			<attribute name="View Size Quantize" value="1" />
-			<attribute name="View Size Minimum" value="5" />
-			<attribute name="Depth Constant Bias" value="0.00025" />
-			<attribute name="Depth Slope Bias" value="0.001" />
-		</component>
-	</node>
-	<node id="361">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Camera" />
-		<attribute name="Position" value="0.593735 2.88545 -17.9696" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="Camera" id="1973" />
-	</node>
-	<node id="364">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Ground" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="100 1 100" />
-		<attribute name="Variables" />
-		<component type="StaticModel" id="1977">
-			<attribute name="Model" value="Model;d13f4de7c37ef066793b23eb12fa7289.mdl" />
-			<attribute name="Material" value="Material;Models/Materials/DefaultMaterial.material" />
-		</component>
-		<component type="CollisionShape" id="1978" />
-		<component type="RigidBody" id="1979" />
-	</node>
-	<node id="366">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="0 2.01242 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="1983">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="368">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="2.15234 2.01242 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="1984">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="370">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="4.38466 2.01242 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="1988">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="372">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="4.38466 4.1864 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="1992">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="374">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="2.151 4.1864 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="1996">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="381">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Crate" />
-		<attribute name="Position" value="-0.0384986 4.1864 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="2009">
-			<attribute name="PrefabGUID" value="36bf96b8dc4bf9b244e640f76ca8e4df" />
-		</component>
-	</node>
-	<node id="383">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Pallet" />
-		<attribute name="Position" value="-0.377713 7.16289 -0.253161" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="2013">
-			<attribute name="PrefabGUID" value="00b07a518bf4b42fc70159163d3a53c6" />
-		</component>
-	</node>
-	<node id="385">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Pallet" />
-		<attribute name="Position" value="4.30384 7.16289 -0.237222" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="2014">
-			<attribute name="PrefabGUID" value="00b07a518bf4b42fc70159163d3a53c6" />
-		</component>
-	</node>
-	<node id="437">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Robo_01" />
-		<attribute name="Position" value="4.86633 2.02861 -12.6946" />
-		<attribute name="Rotation" value="-4.37114e-08 0 1 -0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="PrefabComponent" id="2122">
-			<attribute name="PrefabGUID" value="e8cb3d94df18b9e5bacca4ccdadeec3a" />
-		</component>
-	</node>
-</scene>

+ 0 - 5
Roboman3DTypeScript/Resources/Scenes/Scene.scene.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "e3886eccb0e37b9eee822ccfeab4309f",
-	"SceneImporter": {}
-}

+ 336 - 0
Roboman3DTypeScript/Resources/Scenes/Test.scene

@@ -0,0 +1,336 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="474" />
+	<attribute name="Next Replicated Component ID" value="2841" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="PhysicsWorld" id="1" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
+	<node id="3">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="GlobalLight" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="0.313506 0.889258 -0.110741 0.314117" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Light" id="5">
+			<attribute name="Light Type" value="Directional" />
+			<attribute name="Cast Shadows" value="true" />
+			<attribute name="CSM Splits" value="10 20 50 0" />
+			<attribute name="View Size Quantize" value="1" />
+			<attribute name="View Size Minimum" value="5" />
+			<attribute name="Depth Constant Bias" value="0.00025" />
+			<attribute name="Depth Slope Bias" value="0.001" />
+		</component>
+	</node>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Ground" />
+		<attribute name="Position" value="0 -7.02201 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="50 1 50" />
+		<attribute name="Variables" />
+		<component type="StaticModel" id="1973">
+			<attribute name="Model" value="Model;15934bd919b214d7f7810775e5d852d3.mdl" />
+			<attribute name="Material" value="Material;Models/Materials/DefaultMaterial.material" />
+		</component>
+		<component type="CollisionShape" id="1974" />
+		<component type="RigidBody" id="1975">
+			<attribute name="Physics Position" value="0 -7.02201 0" />
+		</component>
+	</node>
+	<node id="386">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Robo_01" />
+		<attribute name="Position" value="-1.18 -4.91 8.68" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="1992">
+			<attribute name="PrefabGUID" value="fd7bc91efd0b91d949c35435539dcbc8" />
+		</component>
+	</node>
+	<node id="407">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="MainCamera" />
+		<attribute name="Position" value="-0.92 -1.3 17.69" />
+		<attribute name="Rotation" value="-4.37114e-08 -0 -1 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="2004" />
+	</node>
+	<node id="422">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-2.09 -5.11 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2023">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="429">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="0.2 -5.11 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2032">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="435">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="2.47 -5.11 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2047">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="436">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="4.70119 -5.11 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2051">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="438">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-4.42 -5.11 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2065">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="439">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-4.42 -2.9 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2069">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="440">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-2.09 -2.9 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2073">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="441">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="0.2 -2.9 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2077">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="442">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="2.47 -2.9 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2081">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="444">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="0.2 -0.75 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2089">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="445">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-2.09 -0.75 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2093">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="446">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-4.42 -0.75 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2097">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="447">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-2.09 1.42 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2101">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="448">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-4.42 1.42 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2105">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="450">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Pallet" />
+		<attribute name="Position" value="8.54 -5.75 9.53" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2271">
+			<attribute name="PrefabGUID" value="9e1083378dc59da1d98981cf2acf9f7c" />
+		</component>
+	</node>
+	<node id="451">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Pallet" />
+		<attribute name="Position" value="-7.15 -4.32 -2.56" />
+		<attribute name="Rotation" value="0.632814 -0.315509 0.632814 0.315509" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2272">
+			<attribute name="PrefabGUID" value="9e1083378dc59da1d98981cf2acf9f7c" />
+		</component>
+	</node>
+	<node id="452">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Pallet" />
+		<attribute name="Position" value="7.66 -4.53 -2.36" />
+		<attribute name="Rotation" value="0.692911 0.140974 0.692911 -0.140974" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2276">
+			<attribute name="PrefabGUID" value="9e1083378dc59da1d98981cf2acf9f7c" />
+		</component>
+	</node>
+	<node id="464">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="8.56 -3.81 10.55" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2561">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="465">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="8.56 -3.81 8.52" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2565">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="466">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="8.56 -1.32 9.46" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2569">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="467">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-0.62 4.02 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2573">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="468">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-2.05 6.68 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2577">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+	<node id="469">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Crate" />
+		<attribute name="Position" value="-5.68 4.02 -2.6" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="PrefabComponent" id="2581">
+			<attribute name="PrefabGUID" value="f28b0342cc83510cd46702d551c58f02" />
+		</component>
+	</node>
+</scene>

+ 5 - 0
Roboman3DTypeScript/Resources/Scenes/Test.scene.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "627532ce83065783581852967b660c15",
+	"SceneImporter": {}
+}

+ 43 - 10
Roboman3DTypeScript/Resources/Scripts/main.js

@@ -1,10 +1,43 @@
-// This script is the main entry point of the game
-
-var scene = Atomic.player.loadScene("Scenes/Scene.scene");
-
-// called per frame, optional
-function update(timeStep) {
-
-}
-
-exports.update = update;
+"use strict";
+var DPad_1 = require("DPad");
+// called per frame, optional
+function update(timeStep) {
+    // Handle update
+}
+exports.update = update;
+// This script is the main entry point of the game
+//Load scene
+Atomic.player.loadScene("Scenes/Test.scene");
+//init DPad if its a mobile platform
+if (Atomic.platform == "Android" || Atomic.platform == "iOS") {
+    var dpad = new DPad_1.DPad();
+    dpad.addAll();
+    dpad.init();
+    var jumpView = new Atomic.UIView();
+    var jumpButton = new Atomic.UIButton();
+    //unset its skin, because we will use UIImageWidget
+    jumpButton.skinBg = "";
+    //create ours jump button image
+    var jumpButtonImage = new Atomic.UIImageWidget();
+    //load image
+    jumpButtonImage.setImage("UI/jumpButton.png");
+    //resize ours image by 2.2x
+    var jumpButtonWidth = jumpButtonImage.imageWidth * 2.2;
+    var jumpButtonHeight = jumpButtonImage.imageHeight * 2.2;
+    //calculate position
+    var posX = Atomic.graphics.width - Atomic.graphics.width / 8 - jumpButtonWidth / 2;
+    var posY = Atomic.graphics.height - Atomic.graphics.height / 4 - jumpButtonHeight / 2;
+    //sets jumpButton rect, specify position and end position
+    jumpView.rect = [posX, posY, posX + jumpButtonWidth, posY + jumpButtonHeight];
+    jumpButton.rect = [0, 0, jumpButtonWidth, jumpButtonHeight];
+    //sets jumpButtonImage rect, we specify there only end position
+    jumpButtonImage.rect = [0, 0, jumpButtonWidth, jumpButtonHeight];
+    //adds image to jumpButton
+    jumpButton.addChild(jumpButtonImage);
+    //adds jumpButton to the dpad view
+    jumpView.addChild(jumpButton);
+    //sets jumpButton capturing to false, because we wanna make it multitouchable
+    jumpButton.setCapturing(false);
+    //binds jumpButton to KEY_SPACE
+    Atomic.input.bindButton(jumpButton, Atomic.KEY_SPACE);
+}

+ 47 - 0
Roboman3DTypeScript/Resources/Scripts/main.ts

@@ -0,0 +1,47 @@
+import {DPad} from "DPad";
+
+// called per frame, optional
+export function update(timeStep:number) {
+    // Handle update
+}
+
+// This script is the main entry point of the game
+//Load scene
+Atomic.player.loadScene("Scenes/Test.scene");
+
+//init DPad if its a mobile platform
+if (Atomic.platform == "Android" || Atomic.platform == "iOS") {
+    const dpad = new DPad();
+    dpad.addAll();
+    dpad.init();
+
+    const jumpView = new Atomic.UIView();
+
+    const jumpButton = new Atomic.UIButton();
+    //unset its skin, because we will use UIImageWidget
+    jumpButton.skinBg = "";
+    //create ours jump button image
+    const jumpButtonImage = new Atomic.UIImageWidget();
+    //load image
+    jumpButtonImage.setImage("UI/jumpButton.png");
+    //resize ours image by 2.2x
+    const jumpButtonWidth = jumpButtonImage.imageWidth * 2.2;
+    const jumpButtonHeight = jumpButtonImage.imageHeight * 2.2;
+    //calculate position
+    const posX = Atomic.graphics.width - Atomic.graphics.width / 8 - jumpButtonWidth / 2;
+    const posY = Atomic.graphics.height - Atomic.graphics.height / 4 - jumpButtonHeight / 2;
+
+    //sets jumpButton rect, specify position and end position
+    jumpView.rect = [posX, posY, posX + jumpButtonWidth, posY + jumpButtonHeight];
+    jumpButton.rect = [0, 0, jumpButtonWidth, jumpButtonHeight];
+    //sets jumpButtonImage rect, we specify there only end position
+    jumpButtonImage.rect = [0, 0, jumpButtonWidth, jumpButtonHeight];
+    //adds image to jumpButton
+    jumpButton.addChild(jumpButtonImage);
+    //adds jumpButton to the dpad view
+    jumpView.addChild(jumpButton);
+    //sets jumpButton capturing to false, because we wanna make it multitouchable
+    jumpButton.setCapturing(false);
+    //binds jumpButton to KEY_SPACE
+    Atomic.input.bindButton(jumpButton, Atomic.KEY_SPACE);
+}

+ 7 - 0
Roboman3DTypeScript/Resources/Scripts/main.ts.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "49c6c0a669e983144df7853421f15a55",
+	"TypeScriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 0 - 0
Roboman3DTypeScript/Resources/Textures/AtomicRobot_01_Diffuse.png → Roboman3DTypeScript/Resources/Textures/AtomicRobot.png


+ 5 - 0
Roboman3DTypeScript/Resources/Textures/AtomicRobot.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "118261830f9abdc818a05a9577822e58",
+	"TextureImporter": {}
+}

+ 0 - 5
Roboman3DTypeScript/Resources/Textures/AtomicRobot_01_Diffuse.png.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "13483a8d875f949ce4ff5dad5d309f6c",
-	"TextureImporter": {}
-}

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/BlueGrid.png.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "23020080ea94322458dad912fbe6e185",
+	"guid": "f23157495cd9f8b0a41bdbf4b780b353",
 	"TextureImporter": {}
 }

BIN
Roboman3DTypeScript/Resources/Textures/Crate-Bump.jpg


+ 5 - 0
Roboman3DTypeScript/Resources/Textures/Crate-Bump.jpg.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "31b7f68671b5580c0951abb15af193a9",
+	"TextureImporter": {}
+}

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Crate-Diffuse.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "234b91d98c19f52344edb9efcb835552",
+	"guid": "e6126ed129fabe92c167289aba92c051",
 	"TextureImporter": {}
 }

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Crate-Normal.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "cd7e644911942256266554a63b39881b",
+	"guid": "142e85dfba0ab7d971371dd25795627a",
 	"TextureImporter": {}
 }

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Crate-Specular.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "edec68295b22ab06c6852cdcb9fda851",
+	"guid": "e4a719a307e46a878668edd4447e1e3c",
 	"TextureImporter": {}
 }

BIN
Roboman3DTypeScript/Resources/Textures/Pallet-Bump.jpg


+ 5 - 0
Roboman3DTypeScript/Resources/Textures/Pallet-Bump.jpg.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "04d8b8652f43376a52054bc8b687b8c0",
+	"TextureImporter": {}
+}

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Pallet-Difuse.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "95a7733c9cac374283563fa2812d46a2",
+	"guid": "b9a3026da1599521f2dc742d9512fe99",
 	"TextureImporter": {}
 }

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Pallet-Normal.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "6b98e43bb553a8fdcd7b24439d35041c",
+	"guid": "4c0c21f8c0a547acdf1c7d5abf222965",
 	"TextureImporter": {}
 }

+ 1 - 1
Roboman3DTypeScript/Resources/Textures/Pallet-Specular.jpg.asset

@@ -1,5 +1,5 @@
 {
 	"version": 1,
-	"guid": "334fbcdc6a62fd9e626c28af4ca6b703",
+	"guid": "f008b9a2156cf7c89dc0a8b804b1bd89",
 	"TextureImporter": {}
 }

BIN
Roboman3DTypeScript/Resources/Textures/Robot_01_Diffuse.png


+ 5 - 0
Roboman3DTypeScript/Resources/Textures/Robot_01_Diffuse.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "63abd2ae74f973dbccbe1da6fce2ad44",
+	"TextureImporter": {}
+}

+ 0 - 5
Roboman3DTypeScript/Resources/TypeScript.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "d01621e929a55a8319423b8578162d09",
-	"FolderImporter": {}
-}

+ 0 - 169
Roboman3DTypeScript/Resources/TypeScript/AtomicWork.d.ts

@@ -1,169 +0,0 @@
-/// <reference path="Atomic.d.ts" />
-
-
-declare module Atomic {
-
-    export function print(...args: any[]);
-
-    export var platform: string;
-
-    // subsystems
-
-    export var engine: Engine;
-    export var graphics: Graphics;
-    export var renderer: Renderer;
-    export var cache: ResourceCache;
-    export var input: Input;
-    export var fileSystem: FileSystem;
-    export var network: Network;
-
-    // end subsystems
-
-
-    export interface PathInfo {
-
-        pathName: string;
-        fileName: string;
-        ext: string;
-
-    }
-
-    export interface ScreenModeEvent {
-
-        width: number;
-        height: number;
-        fullscreen: boolean;
-        resizable: boolean;
-        borderless: boolean;
-
-    }
-
-
-    export interface UIShortcutEvent {
-
-        // keycode
-        key: number;
-        //  Atomic.QUAL_SHIFT, Atomic.QUAL_CTRL, Atomic.QUAL_ALT, Atomic.QUAL_ANY
-        qualifiers: number;
-
-    }
-
-    export interface NodeAddedEvent {
-
-        scene: Atomic.Scene;
-        parent: Atomic.Node;
-        node: Atomic.Node;
-
-    }
-
-    export interface NodeRemovedEvent {
-
-        scene: Atomic.Scene;
-        parent: Atomic.Node;
-        node: Atomic.Node;
-
-    }
-
-    export interface NodeNameChangedEvent {
-
-        scene: Atomic.Scene;
-        node: Atomic.Node;
-
-    }
-
-    export interface UIWidgetEvent {
-
-        handler: UIWidget;
-        target: UIWidget;
-        type: number; /*UIWidgetEventType*/
-        x: number;
-        y: number;
-        deltax: number;
-        deltay: number;
-        count: number;
-        key: number;
-        specialkey: number;
-        modifierkeys: number;
-        refid: string;
-        touch: boolean;
-    }
-
-    export interface UIWidgetDeletedEvent {
-
-        widget: UIWidget;
-    }
-
-    export interface DragBeginEvent {
-
-        source: UIWidget;
-        dragObject: UIDragObject;
-    }
-
-    export interface DragEnterWidgetEvent {
-
-        widget: UIWidget;
-        dragObject: UIDragObject;
-    }
-
-    export interface DragExitWidgetEvent {
-
-        widget: UIWidget;
-        dragObject: UIDragObject;
-    }
-
-    export interface DragEndedEvent {
-
-        target: UIWidget;
-        dragObject: UIDragObject;
-    }
-
-    export interface TemporaryChangedEvent {
-
-        serializable: Atomic.Serializable;
-
-    }
-
-    export interface IPCJSErrorEvent {
-
-        errorName: string;
-        errorMessage: string;
-        errorFileName: string;
-        errorLineNumber: number;
-        errorStack: string;
-
-    }
-
-    export interface AttributeInfo {
-
-        type: VariantType;
-        name: string;
-        mode: number; // AM_*
-        defaultValue: string;
-        enumNames: string[];
-
-    }
-
-    export interface ShaderParameter {
-
-        name: string;
-        value: any;
-        valueString: string;
-        typeName: string;
-        type: VariantType;
-
-    }
-
-    export function getArguments(): Array<string>;
-    export function getEngine(): Engine;
-    export function getInput(): Input;
-    export function getGraphics(): Graphics;
-    export function getFileSystem(): FileSystem;
-    export function getResourceCache(): ResourceCache;
-
-    export function getParentPath(path: string): string;
-    export function addTrailingSlash(path: string): string;
-    export function getExtension(path: string): string;
-
-    export function splitPath(path: string): PathInfo;
-
-}

+ 5 - 0
Roboman3DTypeScript/Resources/UI.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "0342764d78982a9bfbfd08c693573161",
+	"FolderImporter": {}
+}

+ 9 - 0
Roboman3DTypeScript/Resources/UI/DPadSkin.ui

@@ -0,0 +1,9 @@
+elements
+	TouchButtonLeft
+		bitmap buttonLeft.png
+	TouchButtonUp
+		bitmap buttonUp.png
+	TouchButtonRight
+		bitmap buttonRight.png
+	TouchButtonDown
+		bitmap buttonDown.png

BIN
Roboman3DTypeScript/Resources/UI/buttonDown.png


+ 5 - 0
Roboman3DTypeScript/Resources/UI/buttonDown.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "69053659eacc3702757b6fed1b3ca55e",
+	"TextureImporter": {}
+}

BIN
Roboman3DTypeScript/Resources/UI/buttonLeft.png


+ 5 - 0
Roboman3DTypeScript/Resources/UI/buttonLeft.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "b0e1188aee4a3219052adcd92e3d4f5c",
+	"TextureImporter": {}
+}

BIN
Roboman3DTypeScript/Resources/UI/buttonRight.png


+ 5 - 0
Roboman3DTypeScript/Resources/UI/buttonRight.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "953b82fe439eeed3fc0e68443cb92cd6",
+	"TextureImporter": {}
+}

BIN
Roboman3DTypeScript/Resources/UI/buttonUp.png


+ 5 - 0
Roboman3DTypeScript/Resources/UI/buttonUp.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "bea9061876eee3b95d752f49c4d93477",
+	"TextureImporter": {}
+}

BIN
Roboman3DTypeScript/Resources/UI/jumpButton.png


+ 5 - 0
Roboman3DTypeScript/Resources/UI/jumpButton.png.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "867694a3386810fb9e4430517a2574ca",
+	"TextureImporter": {}
+}

+ 0 - 21
Roboman3DTypeScript/Resources/tsconfig.json

@@ -1,21 +0,0 @@
-{
-    "compilerOptions": {
-        "target": "es5",
-        "module": "commonjs",
-        "declaration": false,
-        "noImplicitAny": false,
-        "removeComments": true,
-        "noLib": false
-    },
-    "filesGlob": [
-        "./**/*.ts"
-    ],
-    "files": [
-        "./Components/AvatarController.ts",
-        "./Components/Roboman.ts",
-        "./Modules/gl-matrix.d.ts",
-        "./TypeScript/Atomic.d.ts",
-        "./TypeScript/AtomicPlayer.d.ts",
-        "./TypeScript/AtomicWork.d.ts"
-    ]
-}

+ 49 - 0
Roboman3DTypeScript/Settings/Engine.json

@@ -0,0 +1,49 @@
+{
+  "desktop": {
+
+    "engine" : {
+      "workerThreads" : true,
+      "logQuiet" : false,
+      "logLevel" : 1
+    },
+
+    "graphics": {
+      "headless": false,
+      "frameLimiter" : true,
+      "flushGPU" : false,
+      "forceGL2" : false,
+      "orientations" : "LandscapeLeft LandscapeRight",
+      "vsync" : false,
+      "tripleBuffer" : false,
+      "multiSample" : 1,
+      "renderPath" : "forward",
+      "shadows" : true,
+      "lowQualityShadows" : false,
+      "materialQuality" : "high",
+      "textureQuality" : "high",
+      "textureFilterMode" : "trilinear",
+      "textureAnisotropy" : 4
+    },
+
+    "window" : {
+      "title" : "Roboman3D",
+      "fullscreen" : false,
+      "borderless" : false,
+      "resizable" : false
+    },
+
+    "sound": {
+      "enabled" : true,
+      "interpolation" : true,
+      "stereo" : true,
+      "bufferMS": 100,
+      "mixRate" : 44100
+    },
+
+    "input" : {
+      "touchEmulation" : false
+    }
+
+  }
+  
+}

+ 32 - 0
Roboman3DTypeScript/tsconfig.json

@@ -0,0 +1,32 @@
+{
+    "compilerOptions": {
+        "noImplicitAny": false,
+        "target": "ES5",
+        "module": "commonjs",
+        "declaration": false,
+        "inlineSourceMap": false,
+        "removeComments": false
+    },
+    "filesGlob": [
+        "!node_modules/**",
+        "!build/**",
+        "Resources/**/*.ts",
+        "typings/**/*.ts"
+    ],
+    "files": [
+        "Resources/Components/AvatarController.ts",
+        "Resources/Components/Roboman.ts",
+        "Resources/Modules/DPad.d.ts",
+        "Resources/Modules/gl-matrix.d.ts",
+        "Resources/Scripts/main.ts",
+        "typings/Atomic/Atomic.d.ts",
+        "typings/Atomic/AtomicNET.d.ts",
+        "typings/Atomic/AtomicPlayer.d.ts",
+        "typings/Atomic/AtomicWork.d.ts",
+        "typings/Atomic/Editor.d.ts",
+        "typings/Atomic/ToolCore.d.ts"
+    ],
+    "atom": {
+        "rewriteTsconfig": true
+    }
+}

File diff suppressed because it is too large
+ 387 - 95
Roboman3DTypeScript/typings/Atomic/Atomic.d.ts


+ 121 - 0
Roboman3DTypeScript/typings/Atomic/AtomicNET.d.ts

@@ -0,0 +1,121 @@
+//Atomic TypeScript Definitions
+
+
+/// <reference path="Atomic.d.ts" />
+
+declare module AtomicNET {
+
+
+   // enum CSComponentMethod
+   export type CSComponentMethod = number;
+   export var CSComponentMethod_Start: CSComponentMethod;
+   export var CSComponentMethod_DelayedStart: CSComponentMethod;
+   export var CSComponentMethod_Update: CSComponentMethod;
+   export var CSComponentMethod_PostUpdate: CSComponentMethod;
+   export var CSComponentMethod_FixedUpdate: CSComponentMethod;
+   export var CSComponentMethod_PostFixedUpdate: CSComponentMethod;
+
+
+//----------------------------------------------------
+// MODULE: NETCore
+//----------------------------------------------------
+
+
+   export class NETCore extends Atomic.AObject {
+
+      context: Atomic.Context;
+
+      // Construct.
+      constructor();
+
+      shutdown(): void;
+      addAssemblyLoadPath(assemblyPath: string): void;
+      execAssembly(assemblyName: string, args: string[]): number;
+      waitForDebuggerConnect(): void;
+      // to get a reference from
+      static getContext(): Atomic.Context;
+
+   }
+
+   export class NETVariantMap extends Atomic.RefCounted {
+
+      constructor();
+
+      getBool(key: string): boolean;
+      getInt(key: string): number;
+      getFloat(key: string): number;
+      getVector3(key: string): Atomic.Vector3;
+      getQuaternion(key: string): Atomic.Quaternion;
+      getPtr(key: string): Atomic.RefCounted;
+      getString(key: string): string;
+      getVariantType(key: string): Atomic.VariantType;
+      getResourceFromRef(key: string): Atomic.Resource;
+      contains(key: string): boolean;
+
+   }
+
+
+
+//----------------------------------------------------
+// MODULE: NETScript
+//----------------------------------------------------
+
+
+   export class CSComponent extends Atomic.ScriptComponent {
+
+      componentClassName: string;
+      componentFile: Atomic.ScriptComponentFile;
+      assemblyFile: CSComponentAssembly;
+
+      // Construct.
+      constructor();
+
+      applyAttributes(): void;
+      // Handle enabled/disabled state change. Changes update event subscription.
+      onSetEnabled(): void;
+      applyFieldValues(): void;
+      setComponentClassName(name: string): void;
+      getComponentClassName(): string;
+      getComponentFile(): Atomic.ScriptComponentFile;
+      getAssemblyFile(): CSComponentAssembly;
+      setAssemblyFile(assemblyFile: CSComponentAssembly): void;
+
+   }
+
+   export class CSComponentAssembly extends Atomic.ScriptComponentFile {
+
+      classNames: string[];
+
+      // Construct.
+      constructor();
+
+      createCSComponent(classname: string): CSComponent;
+      // Only valid in editor, as we don't inspect assembly at runtime
+      getClassNames(): string[];
+
+   }
+
+   export class CSManaged extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+      initialize(): boolean;
+      nETUpdate(timeStep: number): void;
+      cSComponentCreate(assemblyName: string, componentName: string): CSComponent;
+      cSComponentApplyFields(component: CSComponent, fieldMapPtr: NETVariantMap): void;
+      cSComponentCallMethod(id: number, methodID: CSComponentMethod, value?: number): void;
+
+   }
+
+   export class CSScriptObject extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+
+   }
+
+
+
+}

+ 3 - 0
Roboman3DTypeScript/Resources/TypeScript/AtomicPlayer.d.ts → Roboman3DTypeScript/typings/Atomic/AtomicPlayer.d.ts

@@ -13,10 +13,13 @@ declare module AtomicPlayer {
 
    export class Player extends Atomic.AObject {
 
+      currentScene: Atomic.Scene;
+
       // Construct.
       constructor();
 
       loadScene(filename: string, camera?: Atomic.Camera): Atomic.Scene;
+      getCurrentScene(): Atomic.Scene;
 
    }
 

+ 395 - 0
Roboman3DTypeScript/typings/Atomic/AtomicWork.d.ts

@@ -0,0 +1,395 @@
+/// <reference path="Atomic.d.ts" />
+/// <reference path="ToolCore.d.ts" />
+/// <reference path="Editor.d.ts" />
+/// <reference path="AtomicPlayer.d.ts" />
+
+declare module Atomic {
+
+    export function print(...args: any[]);
+
+    export var platform: string;
+
+    // subsystems
+
+    export var engine: Engine;
+    export var graphics: Graphics;
+    export var renderer: Renderer;
+    export var cache: ResourceCache;
+    export var input: Input;
+    export var fileSystem: FileSystem;
+    export var network: Network;
+    export var ui: UI;
+    export var audio: Audio;
+    export var player: AtomicPlayer.Player;
+
+    export var editorMode: Editor.EditorMode;
+
+    // end subsystems
+
+
+    export interface PathInfo {
+
+        pathName: string;
+        fileName: string;
+        ext: string;
+
+    }
+
+    export interface ScreenModeEvent {
+
+        width: number;
+        height: number;
+        fullscreen: boolean;
+        resizable: boolean;
+        borderless: boolean;
+
+    }
+
+    export interface KeyDownEvent {
+
+        // keycode
+        key: number;
+        //  Atomic.QUAL_SHIFT, Atomic.QUAL_CTRL, Atomic.QUAL_ALT, Atomic.QUAL_ANY
+        qualifiers: number;
+
+        // mouse buttons down
+        buttons: number;
+
+    }
+
+    export interface KeyUpEvent {
+
+        // keycode
+        key: number;
+        //  Atomic.QUAL_SHIFT, Atomic.QUAL_CTRL, Atomic.QUAL_ALT, Atomic.QUAL_ANY
+        qualifiers: number;
+        // mouse buttons down
+        buttons: number;
+
+    }
+
+    export interface UIShortcutEvent {
+
+        // keycode
+        key: number;
+        //  Atomic.QUAL_SHIFT, Atomic.QUAL_CTRL, Atomic.QUAL_ALT, Atomic.QUAL_ANY
+        qualifiers: number;
+
+    }
+
+    export interface UIListViewSelectionChangedEvent {
+
+        refid: string;
+        selected: boolean;
+
+    }
+
+    export interface NodeAddedEvent {
+
+        scene: Atomic.Scene;
+        parent: Atomic.Node;
+        node: Atomic.Node;
+
+    }
+
+    export interface NodeRemovedEvent {
+
+        scene: Atomic.Scene;
+        parent: Atomic.Node;
+        node: Atomic.Node;
+
+    }
+
+    export interface NodeNameChangedEvent {
+
+        scene: Atomic.Scene;
+        node: Atomic.Node;
+
+    }
+
+    export interface UIWidgetEvent {
+
+        handler: UIWidget;
+        target: UIWidget;
+        type: number; /*UIWidgetEventType*/
+        x: number;
+        y: number;
+        deltax: number;
+        deltay: number;
+        count: number;
+        key: number;
+        specialkey: number;
+        modifierkeys: number;
+        refid: string;
+        touch: boolean;
+    }
+
+    export interface UIWidgetFocusChangedEvent {
+        widget: UIWidget;
+        focused: boolean;
+    }
+
+    export interface UIWidgetEditCompleteEvent {
+        widget: UIWidget;
+    }
+
+    export interface UIWidgetDeletedEvent {
+
+        widget: UIWidget;
+    }
+
+    export interface DragBeginEvent {
+
+        source: UIWidget;
+        dragObject: UIDragObject;
+    }
+
+    export interface DragEnterWidgetEvent {
+
+        widget: UIWidget;
+        dragObject: UIDragObject;
+    }
+
+    export interface DragExitWidgetEvent {
+
+        widget: UIWidget;
+        dragObject: UIDragObject;
+    }
+
+    export interface DragEndedEvent {
+
+        target: UIWidget;
+        dragObject: UIDragObject;
+    }
+
+    export interface TemporaryChangedEvent {
+
+        serializable: Atomic.Serializable;
+
+    }
+
+    export interface ComponentAddedEvent {
+
+        scene: Atomic.Scene;
+        node: Atomic.Node;
+        component: Atomic.Component;
+
+    }
+
+    export interface ComponentRemovedEvent {
+
+        scene: Atomic.Scene;
+        node: Atomic.Node;
+        component: Atomic.Component;
+
+    }
+
+    export interface IPCJSErrorEvent {
+
+        errorName: string;
+        errorMessage: string;
+        errorFileName: string;
+        errorLineNumber: number;
+        errorStack: string;
+
+    }
+
+
+    export interface IPCMessageEvent {
+
+        message: string;
+        value: number;
+    }
+
+    export interface AttributeInfo {
+
+        type: VariantType;
+        name: string;
+        mode: number; // AM_*
+        defaultValue: string;
+        enumNames: string[];
+        resourceTypeName: string;
+        dynamic: boolean;
+
+    }
+
+    export interface ShaderParameter {
+
+        name: string;
+        value: any;
+        valueString: string;
+        typeName: string;
+        type: VariantType;
+
+    }
+
+    export function getArguments(): Array<string>;
+    export function getEngine(): Engine;
+    export function getInput(): Input;
+    export function getGraphics(): Graphics;
+    export function getFileSystem(): FileSystem;
+    export function getResourceCache(): ResourceCache;
+    export function getRenderer(): Atomic.Renderer;
+    export function getNetwork(): Atomic.Network;
+    export function getUI(): Atomic.UI;
+
+    export function assert();
+    export function js_module_read_file(path: string);
+    export function openConsoleWindow();
+    export function script(script: string): boolean;
+    export function destroy(node: Atomic.Node): boolean;
+    export function destroy(scene: Atomic.Scene): boolean;
+    export function destroy(component: Atomic.JSComponent): boolean;
+
+    export function getParentPath(path: string): string;
+    export function addTrailingSlash(path: string): string;
+    export function getExtension(path: string): string;
+
+    export function splitPath(path: string): PathInfo;
+
+}
+
+declare module AtomicNET {
+
+    export interface CSComponentClassChangedEvent {
+
+        cscomponent: CSComponent;
+        classname: string;
+
+    }
+
+}
+
+declare module Editor {
+
+    export interface SceneNodeSelectedEvent {
+        scene: Atomic.Scene;
+        node: Atomic.Node;
+        selected: boolean;
+        quiet: boolean;
+    }
+
+    export interface SceneEditAddRemoveNodesEvent {
+
+        end: boolean;
+
+    }
+
+
+    export interface SceneEditNodeAddedEvent {
+
+        scene: Atomic.Scene;
+        parent: Atomic.Node;
+        node: Atomic.Node;
+
+    }
+
+    export interface SceneEditNodeRemovedEvent {
+
+        scene: Atomic.Scene;
+        parent: Atomic.Node;
+        node: Atomic.Node;
+
+    }
+
+    export interface SceneEditComponentAddedRemovedEvent {
+
+        scene: Atomic.Scene;
+        node: Atomic.Node;
+        component: Atomic.Component;
+        removed: boolean;
+    }
+
+    export interface SceneEditStateChangeEvent {
+
+        serializable: Atomic.Serializable;
+
+    }
+
+    export interface SceneEditNodeCreatedEvent {
+        node: Atomic.Node;
+    }
+
+    export interface GizmoEditModeChangedEvent {
+        mode: EditMode;
+    }
+
+    export interface GizmoAxisModeChangedEvent {
+        mode: AxisMode;
+    }
+
+}
+
+declare module ToolCore {
+
+    export interface ResourceAddedEvent {
+
+        guid: string;
+
+    }
+
+    export interface ResourceRemovedEvent {
+
+        guid: string;
+
+    }
+
+    export interface LicenseDeactivationErrorEvent {
+
+        message: string;
+
+    }
+
+    export interface AssetImportErrorEvent {
+
+        path: string;
+        guid: string;
+        error: string;
+    }
+
+    export interface AssetRenamedEvent {
+
+        asset: Asset;
+
+    }
+
+    export interface AssetMovedEvent {
+
+        asset: Asset;
+        oldPath: string;
+
+    }
+
+
+    export interface PlatformChangedEvent {
+
+        platform: ToolCore.Platform;
+
+    }
+
+    export interface BuildOutputEvent {
+
+        text: string;
+
+    }
+
+    export interface BuildCompleteEvent {
+
+        platformID: number;
+        message: string;
+        success: boolean;
+        buildFolder: string;
+
+    }
+
+    export var toolEnvironment: ToolEnvironment;
+    export var toolSystem: ToolSystem;
+    export var assetDatabase: AssetDatabase;
+    export var licenseSystem: LicenseSystem;
+    export var buildSystem: BuildSystem;
+
+    export function getToolEnvironment(): ToolEnvironment;
+    export function getToolSystem(): ToolSystem;
+    export function getAssetDatabase(): AssetDatabase;
+    export function getLicenseSystem(): LicenseSystem;
+}

+ 252 - 0
Roboman3DTypeScript/typings/Atomic/Editor.d.ts

@@ -0,0 +1,252 @@
+//Atomic TypeScript Definitions
+
+
+/// <reference path="Atomic.d.ts" />
+
+declare module Editor {
+
+
+   // enum EditMode
+   export type EditMode = number;
+   export var EDIT_SELECT: EditMode;
+   export var EDIT_MOVE: EditMode;
+   export var EDIT_ROTATE: EditMode;
+   export var EDIT_SCALE: EditMode;
+
+
+   // enum AxisMode
+   export type AxisMode = number;
+   export var AXIS_WORLD: AxisMode;
+   export var AXIS_LOCAL: AxisMode;
+
+
+   // enum SceneEditType
+   export type SceneEditType = number;
+   export var SCENEEDIT_UNKNOWN: SceneEditType;
+   export var SCENEEDIT_SELECTION: SceneEditType;
+
+
+   export var FINDTEXT_FLAG_NONE: number;
+   export var FINDTEXT_FLAG_CASESENSITIVE: number;
+   export var FINDTEXT_FLAG_WHOLEWORD: number;
+   export var FINDTEXT_FLAG_WRAP: number;
+   export var FINDTEXT_FLAG_NEXT: number;
+   export var FINDTEXT_FLAG_PREV: number;
+   export var EDITOR_MODALERROR: number;
+   export var EDITOR_MODALINFO: number;
+
+
+//----------------------------------------------------
+// MODULE: Editor
+//----------------------------------------------------
+
+
+   export class FileUtils extends Atomic.AObject {
+
+      mobileProvisionPath: string;
+
+      // Construct.
+      constructor();
+
+      createDirs(folder: string): boolean;
+      getMobileProvisionPath(): string;
+      getAndroidSDKPath(defaultPath: string): string;
+      getAntPath(defaultPath: string): string;
+      getJDKRootPath(defaultPath: string): string;
+      openProjectFileDialog(): string;
+      newProjectFileDialog(): string;
+      getBuildPath(defaultPath: string): string;
+      revealInFinder(fullpath: string): void;
+
+   }
+
+   export class EditorMode extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+      playProject(addArgs: string, debug?: boolean): boolean;
+      isPlayerEnabled(): boolean;
+
+   }
+
+   export class PlayerMode extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+      launchedByEditor(): boolean;
+
+   }
+
+   export class JSResourceEditor extends ResourceEditor {
+
+      constructor(fullpath: string, container: Atomic.UITabContainer);
+
+      findText(findText: string, flags: number): boolean;
+      findTextClose(): void;
+      gotoTokenPos(tokenPos: number): void;
+      gotoLineNumber(lineNumber: number): void;
+      formatCode(): void;
+      setFocus(): void;
+      save(): boolean;
+
+   }
+
+   export class ResourceEditor extends Atomic.AObject {
+
+      button: Atomic.UIButton;
+      fullPath: string;
+      rootContentWidget: Atomic.UIWidget;
+      modified: boolean;
+
+      constructor(fullpath: string, container: Atomic.UITabContainer);
+
+      getButton(): Atomic.UIButton;
+      hasUnsavedModifications(): boolean;
+      setFocus(): void;
+      close(navigateToAvailableResource?: boolean): void;
+      findText(text: string, flags: number): boolean;
+      findTextClose(): void;
+      requiresInspector(): boolean;
+      getFullPath(): string;
+      undo(): void;
+      redo(): void;
+      save(): boolean;
+      getRootContentWidget(): Atomic.UIWidget;
+      invokeShortcut(shortcut: string): void;
+      requestClose(): void;
+      setModified(modified: boolean): void;
+
+   }
+
+   export class Gizmo3D extends Atomic.AObject {
+
+      view: SceneView3D;
+      axisMode: AxisMode;
+      editMode: EditMode;
+      gizmoNode: Atomic.Node;
+      snapTranslationX: number;
+      snapTranslationY: number;
+      snapTranslationZ: number;
+      snapRotation: number;
+      snapScale: number;
+
+      constructor();
+
+      setView(view3D: SceneView3D): void;
+      setAxisMode(mode: AxisMode): void;
+      getAxisMode(): AxisMode;
+      setEditMode(mode: EditMode): void;
+      selected(): boolean;
+      show(): void;
+      hide(): void;
+      update(): void;
+      getGizmoNode(): Atomic.Node;
+      getSnapTranslationX(): number;
+      getSnapTranslationY(): number;
+      getSnapTranslationZ(): number;
+      getSnapRotation(): number;
+      getSnapScale(): number;
+      setSnapTranslationX(value: number): void;
+      setSnapTranslationY(value: number): void;
+      setSnapTranslationZ(value: number): void;
+      setSnapRotation(value: number): void;
+      setSnapScale(value: number): void;
+
+   }
+
+   export class SceneEditor3D extends ResourceEditor {
+
+      selection: SceneSelection;
+      sceneView3D: SceneView3D;
+      scene: Atomic.Scene;
+      gizmo: Gizmo3D;
+
+      constructor(fullpath: string, container: Atomic.UITabContainer);
+
+      getSelection(): SceneSelection;
+      getSceneView3D(): SceneView3D;
+      registerNode(node: Atomic.Node): void;
+      reparentNode(node: Atomic.Node, newParent: Atomic.Node): void;
+      getScene(): Atomic.Scene;
+      getGizmo(): Gizmo3D;
+      setFocus(): void;
+      requiresInspector(): boolean;
+      close(navigateToAvailableResource?: boolean): void;
+      save(): boolean;
+      undo(): void;
+      redo(): void;
+      cut(): void;
+      copy(): void;
+      paste(): void;
+      invokeShortcut(shortcut: string): void;
+      static getSceneEditor(scene: Atomic.Scene): SceneEditor3D;
+
+   }
+
+   export class SceneSelection extends Atomic.AObject {
+
+      selectedNodeCount: number;
+
+      constructor(sceneEditor: SceneEditor3D);
+
+      cut(): void;
+      copy(): void;
+      paste(): void;
+      delete(): void;
+      // Add a node to the selection, if clear specified removes current nodes first
+      addNode(node: Atomic.Node, clear?: boolean): void;
+      removeNode(node: Atomic.Node, quiet?: boolean): void;
+      getBounds(bbox: Atomic.BoundingBox): void;
+      contains(node: Atomic.Node): boolean;
+      getSelectedNode(index: number): Atomic.Node;
+      getSelectedNodeCount(): number;
+      clear(): void;
+
+   }
+
+   export class SceneView3D extends Atomic.UISceneView {
+
+      pitch: number;
+      yaw: number;
+      debugRenderer: Atomic.DebugRenderer;
+      sceneEditor3D: SceneEditor3D;
+
+      constructor(sceneEditor: SceneEditor3D);
+
+      setPitch(pitch: number): void;
+      setYaw(yaw: number): void;
+      frameSelection(): void;
+      enable(): void;
+      disable(): void;
+      isEnabled(): boolean;
+      getDebugRenderer(): Atomic.DebugRenderer;
+      getSceneEditor3D(): SceneEditor3D;
+
+   }
+
+   export class CubemapGenerator extends EditorComponent {
+
+      imageSize: number;
+
+      // Construct.
+      constructor();
+
+      render(): boolean;
+      getImageSize(): number;
+      setImageSize(size: number): void;
+
+   }
+
+   export class EditorComponent extends Atomic.Component {
+
+      // Construct.
+      constructor();
+
+
+   }
+
+
+
+}

+ 874 - 0
Roboman3DTypeScript/typings/Atomic/ToolCore.d.ts

@@ -0,0 +1,874 @@
+//Atomic TypeScript Definitions
+
+
+/// <reference path="Atomic.d.ts" />
+
+declare module ToolCore {
+
+
+   // enum PlatformID
+   export type PlatformID = number;
+   export var PLATFORMID_UNDEFINED: PlatformID;
+   export var PLATFORMID_WINDOWS: PlatformID;
+   export var PLATFORMID_MAC: PlatformID;
+   export var PLATFORMID_ANDROID: PlatformID;
+   export var PLATFORMID_IOS: PlatformID;
+   export var PLATFORMID_WEB: PlatformID;
+
+
+   export var PROJECTFILE_VERSION: number;
+
+
+//----------------------------------------------------
+// MODULE: ToolCore
+//----------------------------------------------------
+
+
+   export class ToolEnvironment extends Atomic.AObject {
+
+      rootSourceDir: string;
+      toolPrefs: ToolPrefs;
+      rootBuildDir: string;
+      editorBinary: string;
+      playerBinary: string;
+      toolBinary: string;
+      coreDataDir: string;
+      playerDataDir: string;
+      editorDataDir: string;
+      nETCoreCLRAbsPath: string;
+      nETAssemblyLoadPaths: string;
+      nETTPAPaths: string;
+      atomicNETEngineAssemblyPath: string;
+      deploymentDataDir: string;
+      toolDataDir: string;
+      devConfigFilename: string;
+      playerAppFolder: string;
+      iOSDeployBinary: string;
+
+      constructor();
+
+      initFromPackage(): boolean;
+      initFromJSON(atomicTool?: boolean): boolean;
+      // Root source and build directories for development source tree builds
+      setRootSourceDir(sourceDir: string): void;
+      setRootBuildDir(buildDir: string, setBinaryPaths?: boolean): void;
+      getToolPrefs(): ToolPrefs;
+      saveToolPrefs(): void;
+      loadToolPrefs(): void;
+      getRootSourceDir(): string;
+      getRootBuildDir(): string;
+      // Binaries
+      getEditorBinary(): string;
+      getPlayerBinary(): string;
+      getToolBinary(): string;
+      // Resource directories
+      getCoreDataDir(): string;
+      getPlayerDataDir(): string;
+      getEditorDataDir(): string;
+      // AtomicNET
+      getNETCoreCLRAbsPath(): string;
+      getNETAssemblyLoadPaths(): string;
+      getNETTPAPaths(): string;
+      getAtomicNETEngineAssemblyPath(): string;
+      // Data directories
+      getDeploymentDataDir(): string;
+      getToolDataDir(): string;
+      getDevConfigFilename(): string;
+      getPlayerAppFolder(): string;
+      getIOSDeployBinary(): string;
+      dump(): void;
+
+   }
+
+   export class ToolPrefs extends Atomic.AObject {
+
+      androidSDKPath: string;
+      jDKRootPath: string;
+      antPath: string;
+      prefsPath: string;
+
+      constructor();
+
+      getAndroidSDKPath(): string;
+      getJDKRootPath(): string;
+      getAntPath(): string;
+      setAndroidSDKPath(path: string): void;
+      setJDKRootPath(path: string): void;
+      setAntPath(path: string): void;
+      getPrefsPath(): string;
+      load(): void;
+      save(): void;
+
+   }
+
+   export class ToolSystem extends Atomic.AObject {
+
+      project: Project;
+      dataPath: string;
+      currentPlatform: Platform;
+
+      constructor();
+
+      loadProject(fullpath: string): boolean;
+      getProject(): Project;
+      closeProject(): void;
+      getDataPath(): string;
+      setDataPath(path: string): void;
+      registerPlatform(platform: Platform): void;
+      getPlatformByID(platform: PlatformID): Platform;
+      getPlatformByName(name: string): Platform;
+      setCurrentPlatform(platform: PlatformID): void;
+      getCurrentPlatform(): Platform;
+      setCLI(): void;
+      isCLI(): boolean;
+
+   }
+
+   export class Project extends Atomic.AObject {
+
+      resourcePath: string;
+      componentsPath: string;
+      scriptsPath: string;
+      modulesPath: string;
+      buildSettings: ProjectBuildSettings;
+      userPrefs: ProjectUserPrefs;
+      projectPath: string;
+      projectFilePath: string;
+      userPrefsFullPath: string;
+      buildSettingsFullPath: string;
+      version: string;
+
+      // Construct.
+      constructor();
+
+      load(fullpath: string): boolean;
+      save(fullpath: string): void;
+      // Paths
+      getResourcePath(): string;
+      setResourcePath(resourcePath: string): void;
+      getComponentsPath(): string;
+      getScriptsPath(): string;
+      getModulesPath(): string;
+      isComponentsDirOrFile(fullPath: string): boolean;
+      isScriptsDirOrFile(fullPath: string): boolean;
+      isModulesDirOrFile(fullPath: string): boolean;
+      addPlatform(platformID: PlatformID): void;
+      containsPlatform(platformID: PlatformID): boolean;
+      removePlatform(platformID: PlatformID): void;
+      isDirty(): boolean;
+      setDirty(): void;
+      getBuildSettings(): ProjectBuildSettings;
+      getUserPrefs(): ProjectUserPrefs;
+      getProjectPath(): string;
+      getProjectFilePath(): string;
+      getUserPrefsFullPath(): string;
+      getBuildSettingsFullPath(): string;
+      getVersion(): string;
+      setVersion(version: string): void;
+      saveBuildSettings(): void;
+      loadBuildSettings(): boolean;
+      saveUserPrefs(): void;
+      loadUserPrefs(): boolean;
+
+   }
+
+   export class MacBuildSettings extends Atomic.RefCounted {
+
+      appName: string;
+      packageName: string;
+      companyName: string;
+      productName: string;
+
+      constructor();
+
+      getAppName(): string;
+      getPackageName(): string;
+      getCompanyName(): string;
+      getProductName(): string;
+      setAppName(name: string): void;
+      setPackageName(packageName: string): void;
+      setCompanyName(companyName: string): void;
+      setProductName(productName: string): void;
+
+   }
+
+   export class WebBuildSettings extends Atomic.RefCounted {
+
+      appName: string;
+      packageName: string;
+      companyName: string;
+      productName: string;
+
+      constructor();
+
+      getAppName(): string;
+      getPackageName(): string;
+      getCompanyName(): string;
+      getProductName(): string;
+      setAppName(name: string): void;
+      setPackageName(packageName: string): void;
+      setCompanyName(companyName: string): void;
+      setProductName(productName: string): void;
+
+   }
+
+   export class WindowsBuildSettings extends Atomic.RefCounted {
+
+      appName: string;
+      packageName: string;
+      companyName: string;
+      productName: string;
+
+      constructor();
+
+      getAppName(): string;
+      getPackageName(): string;
+      getCompanyName(): string;
+      getProductName(): string;
+      setAppName(name: string): void;
+      setPackageName(packageName: string): void;
+      setCompanyName(companyName: string): void;
+      setProductName(productName: string): void;
+
+   }
+
+   export class AndroidBuildSettings extends Atomic.RefCounted {
+
+      appName: string;
+      packageName: string;
+      companyName: string;
+      productName: string;
+      sDKVersion: string;
+      minSDKVersion: string;
+      activityName: string;
+
+      constructor();
+
+      getAppName(): string;
+      getPackageName(): string;
+      getCompanyName(): string;
+      getProductName(): string;
+      getSDKVersion(): string;
+      getMinSDKVersion(): string;
+      getActivityName(): string;
+      setAppName(name: string): void;
+      setPackageName(packageName: string): void;
+      setCompanyName(companyName: string): void;
+      setProductName(productName: string): void;
+      setSDKVersion(value: string): void;
+      setMinSDKVersion(value: string): void;
+      setActivityName(value: string): void;
+
+   }
+
+   export class IOSBuildSettings extends Atomic.RefCounted {
+
+      appName: string;
+      packageName: string;
+      companyName: string;
+      productName: string;
+      provisionFile: string;
+      appIDPrefix: string;
+
+      constructor();
+
+      getAppName(): string;
+      getPackageName(): string;
+      getCompanyName(): string;
+      getProductName(): string;
+      getProvisionFile(): string;
+      getAppIDPrefix(): string;
+      setAppName(name: string): void;
+      setPackageName(packageName: string): void;
+      setCompanyName(companyName: string): void;
+      setProductName(productName: string): void;
+      setProvisionFile(value: string): void;
+      setAppIDPrefix(value: string): void;
+
+   }
+
+   export class ProjectBuildSettings extends Atomic.AObject {
+
+      macBuildSettings: MacBuildSettings;
+      windowsBuildSettings: WindowsBuildSettings;
+      webBuildSettings: WebBuildSettings;
+      androidBuildSettings: AndroidBuildSettings;
+      iOSBuildSettings: IOSBuildSettings;
+
+      // Construct.
+      constructor();
+
+      getMacBuildSettings(): MacBuildSettings;
+      getWindowsBuildSettings(): WindowsBuildSettings;
+      getWebBuildSettings(): WebBuildSettings;
+      getAndroidBuildSettings(): AndroidBuildSettings;
+      getIOSBuildSettings(): IOSBuildSettings;
+      load(path: string): boolean;
+      save(path: string): void;
+
+   }
+
+   export class ProjectFile extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+      save(project: Project): void;
+      load(project: Project): boolean;
+      writeNewProject(fullpath: string): void;
+
+   }
+
+   export class ProjectUserPrefs extends Atomic.AObject {
+
+      defaultPlatform: PlatformID;
+      lastBuildPath: string;
+      snapTranslationX: number;
+      snapTranslationY: number;
+      snapTranslationZ: number;
+      snapRotation: number;
+      snapScale: number;
+
+      // Construct.
+      constructor();
+
+      getDefaultPlatform(): PlatformID;
+      getLastBuildPath(): string;
+      setLastBuildPath(path: string): void;
+      getSnapTranslationX(): number;
+      getSnapTranslationY(): number;
+      getSnapTranslationZ(): number;
+      getSnapRotation(): number;
+      getSnapScale(): number;
+      setSnapTranslationX(value: number): void;
+      setSnapTranslationY(value: number): void;
+      setSnapTranslationZ(value: number): void;
+      setSnapRotation(value: number): void;
+      setSnapScale(value: number): void;
+
+   }
+
+   export class Platform extends Atomic.AObject {
+
+      license: boolean;
+      name: string;
+      platformID: PlatformID;
+
+      constructor();
+
+      getLicense(): boolean;
+      getName(): string;
+      getPlatformID(): PlatformID;
+      newBuild(project: Project): BuildBase;
+
+   }
+
+   export class PlatformAndroid extends Platform {
+
+      license: boolean;
+      name: string;
+      platformID: PlatformID;
+      androidCommand: string;
+      aDBCommand: string;
+      androidTargets: string[];
+
+      constructor();
+
+      getLicense(): boolean;
+      getName(): string;
+      getPlatformID(): PlatformID;
+      getAndroidCommand(): string;
+      getADBCommand(): string;
+      refreshAndroidTargets(): void;
+      getAndroidTargets(): string[];
+      newBuild(project: Project): BuildBase;
+
+   }
+
+   export class PlatformIOS extends Platform {
+
+      name: string;
+      platformID: PlatformID;
+      license: boolean;
+
+      constructor();
+
+      getName(): string;
+      getPlatformID(): PlatformID;
+      newBuild(project: Project): BuildBase;
+      parseProvisionAppIdentifierPrefix(provisionFile: string): string;
+      getLicense(): boolean;
+
+   }
+
+   export class PlatformMac extends Platform {
+
+      name: string;
+      platformID: PlatformID;
+      license: boolean;
+
+      constructor();
+
+      getName(): string;
+      getPlatformID(): PlatformID;
+      newBuild(project: Project): BuildBase;
+      getLicense(): boolean;
+
+   }
+
+   export class PlatformWeb extends Platform {
+
+      name: string;
+      platformID: PlatformID;
+      license: boolean;
+
+      constructor();
+
+      getName(): string;
+      getPlatformID(): PlatformID;
+      newBuild(project: Project): BuildBase;
+      getLicense(): boolean;
+
+   }
+
+   export class PlatformWindows extends Platform {
+
+      name: string;
+      platformID: PlatformID;
+      license: boolean;
+
+      constructor();
+
+      getName(): string;
+      getPlatformID(): PlatformID;
+      newBuild(project: Project): BuildBase;
+      getLicense(): boolean;
+
+   }
+
+   export class Command extends Atomic.AObject {
+
+      constructor();
+
+      parse(command: string): boolean;
+      run(): void;
+      finished(): void;
+      error(errorMsg: string): void;
+      cancel(): void;
+      requiresProjectLoad(): boolean;
+      requiresLicenseValidation(): boolean;
+
+   }
+
+   export class PlayCmd extends Command {
+
+      constructor();
+
+      run(): void;
+
+   }
+
+   export class OpenAssetImporter extends Atomic.AObject {
+
+      errorMessage: string;
+      importNode: Atomic.Node;
+      startTime: number;
+      endTime: number;
+      scale: number;
+      exportAnimations: boolean;
+      verboseLog: boolean;
+
+      constructor();
+
+      load(assetPath: string): boolean;
+      getErrorMessage(): string;
+      exportModel(outName: string, animName?: string, animationOnly?: boolean): boolean;
+      setImportNode(node: Atomic.Node): void;
+      setStartTime(startTime: number): void;
+      setEndTime(endTime: number): void;
+      setScale(scale: number): void;
+      setExportAnimations(exportAnimations: boolean): void;
+      setVerboseLog(verboseLog: boolean): void;
+
+   }
+
+   export class Asset extends Atomic.AObject {
+
+      guid: string;
+      name: string;
+      path: string;
+      extension: string;
+      relativePath: string;
+      cachePath: string;
+      importerType: string;
+      importerTypeName: string;
+      importer: AssetImporter;
+      parent: Asset;
+      dirty: boolean;
+      fileTimestamp: number;
+      dotAssetFilename: string;
+
+      // Construct.
+      constructor();
+
+      import(): boolean;
+      preload(): boolean;
+      setPath(path: string): boolean;
+      getGUID(): string;
+      getName(): string;
+      getPath(): string;
+      getExtension(): string;
+      // Get the path relative to project
+      getRelativePath(): string;
+      getCachePath(): string;
+      getResource(typeName?: string): Atomic.Resource;
+      getImporterType(): string;
+      getImporterTypeName(): string;
+      getImporter(): AssetImporter;
+      postImportError(message: string): void;
+      getParent(): Asset;
+      setDirty(dirty: boolean): void;
+      isDirty(): boolean;
+      // Get the last timestamp as seen by the AssetDatabase
+      getFileTimestamp(): number;
+      // Sets the time stamp to the asset files current time
+      updateFileTimestamp(): void;
+      getDotAssetFilename(): string;
+      // Rename the asset, which depending on the asset type may be nontrivial
+      rename(newName: string): boolean;
+      // Move the asset, which depending on the asset type may be nontrivial
+      move(newPath: string): boolean;
+      isFolder(): boolean;
+      load(): boolean;
+      save(): boolean;
+      // Instantiate a node from the asset
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+
+   }
+
+   export class AssetDatabase extends Atomic.AObject {
+
+      cachePath: string;
+
+      // Construct.
+      constructor();
+
+      getAssetByGUID(guid: string): Asset;
+      getAssetByPath(path: string): Asset;
+      getAssetByCachePath(cachePath: string): Asset;
+      generateAssetGUID(): string;
+      registerGUID(guid: string): void;
+      getCachePath(): string;
+      deleteAsset(asset: Asset): void;
+      scan(): void;
+      getResourceImporterName(resourceTypeName: string): string;
+      getDotAssetFilename(path: string): string;
+      getFolderAssets(folder:string):ToolCore.Asset[];
+      getAssetsByImporterType(importerType:string, resourceType:string):ToolCore.Asset[];
+
+   }
+
+   export class AssetImporter extends Atomic.AObject {
+
+      asset: Asset;
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      preload(): boolean;
+      getAsset(): Asset;
+      getResource(typeName?: string): Atomic.Resource;
+      requiresCacheFile(): boolean;
+      // Instantiate a node from the asset
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+      rename(newName: string): boolean;
+      move(newPath: string): boolean;
+
+   }
+
+   export class AudioImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName?: string): Atomic.Resource;
+
+   }
+
+   export class JavascriptImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      isComponentFile(): boolean;
+      getResource(typeName?: string): Atomic.Resource;
+
+   }
+
+   export class JSONImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName?: string): Atomic.Resource;
+
+   }
+
+   export class MaterialImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      saveMaterial(): void;
+      getResource(typeName?: string): Atomic.Resource;
+
+   }
+
+   export class AnimationImportInfo extends Atomic.AObject {
+
+      name: string;
+      startTime: number;
+      endTime: number;
+
+      constructor();
+
+      getName(): string;
+      getStartTime(): number;
+      getEndTime(): number;
+      setName(name: string): void;
+      setStartTime(time: number): void;
+      setEndTime(time: number): void;
+
+   }
+
+   export class ModelImporter extends AssetImporter {
+
+      scale: number;
+      importAnimations: boolean;
+      animationCount: number;
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getScale(): number;
+      setScale(scale: number): void;
+      getImportAnimations(): boolean;
+      setImportAnimations(importAnimations: boolean): void;
+      getAnimationCount(): number;
+      setAnimationCount(count: number): void;
+      getResource(typeName?: string): Atomic.Resource;
+      getAnimationInfo(index: number): AnimationImportInfo;
+      // Instantiate a node from the asset
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+      getAnimations():Atomic.Animation[];
+
+   }
+
+   export class NETAssemblyImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName?: string): Atomic.Resource;
+
+   }
+
+   export class PEXImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName: string): Atomic.Resource;
+
+   }
+
+   export class PrefabImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      preload(): boolean;
+      // Instantiate a node from the asset
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+
+   }
+
+   export class SpriterImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName?: string): Atomic.Resource;
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+
+   }
+
+   export class TextureImporter extends AssetImporter {
+
+      // Construct.
+      constructor(asset: Asset);
+
+      setDefaults(): void;
+      getResource(typeName?: string): Atomic.Resource;
+      instantiateNode(parent: Atomic.Node, name: string): Atomic.Node;
+
+   }
+
+   export class LicenseSystem extends Atomic.AObject {
+
+      sourceBuild: boolean;
+      licenseWindows: boolean;
+      licenseMac: boolean;
+      licenseAndroid: boolean;
+      licenseIOS: boolean;
+      licenseHTML5: boolean;
+      licenseModule3D: boolean;
+      key: string;
+      email: string;
+
+      // Construct.
+      constructor();
+
+      initialize(): void;
+      getSourceBuild(): boolean;
+      getLicenseWindows(): boolean;
+      getLicenseMac(): boolean;
+      getLicenseAndroid(): boolean;
+      getLicenseIOS(): boolean;
+      getLicenseHTML5(): boolean;
+      getLicenseModule3D(): boolean;
+      // Returns whether there are any platform licenses available
+      isStandardLicense(): boolean;
+      // Returns true if request to deactivate is made
+      deactivate(): boolean;
+      resetLicense(): void;
+      loadLicense(): boolean;
+      // Basic key validation
+      validateKey(key: string): boolean;
+      // Activate on server
+      requestServerActivation(key: string): void;
+      getKey(): string;
+      generateMachineID(): string;
+      getEmail(): string;
+      licenseAgreementConfirmed(): void;
+
+   }
+
+   export class BuildAndroid extends BuildBase {
+
+      buildSubfolder: string;
+
+      constructor(project: Project);
+
+      build(buildPath: string): void;
+      getBuildSubfolder(): string;
+
+   }
+
+   export class BuildBase extends Atomic.AObject {
+
+      buildSubfolder: string;
+
+      constructor(project: Project, platform: PlatformID);
+
+      build(buildPath: string): void;
+      useResourcePackager(): boolean;
+      getBuildSubfolder(): string;
+      addResourceDir(dir: string): void;
+      buildLog(message: string, sendEvent?: boolean): void;
+      buildWarn(warning: string, sendEvent?: boolean): void;
+      buildError(error: string, sendEvent?: boolean): void;
+      // Fail the current build
+      failBuild(message: string): void;
+
+   }
+
+   export class BuildIOS extends BuildBase {
+
+      buildSubfolder: string;
+
+      constructor(project: Project);
+
+      getBuildSubfolder(): string;
+      build(buildPath: string): void;
+
+   }
+
+   export class BuildMac extends BuildBase {
+
+      buildSubfolder: string;
+
+      constructor(project: Project);
+
+      getBuildSubfolder(): string;
+      build(buildPath: string): void;
+
+   }
+
+   export class BuildSystem extends Atomic.AObject {
+
+      buildPath: string;
+
+      // Construct.
+      constructor();
+
+      setBuildPath(path: string): void;
+      getBuildPath(): string;
+      queueBuild(buildBase: BuildBase): void;
+      startNextBuild(): boolean;
+      buildComplete(platform: PlatformID, buildFolder: string, success?: boolean, buildMessage?: string): void;
+
+   }
+
+   export class BuildWeb extends BuildBase {
+
+      buildSubfolder: string;
+
+      constructor(project: Project);
+
+      build(buildPath: string): void;
+      getBuildSubfolder(): string;
+
+   }
+
+   export class BuildWindows extends BuildBase {
+
+      buildSubfolder: string;
+
+      constructor(project: Project);
+
+      getBuildSubfolder(): string;
+      build(buildPath: string): void;
+
+   }
+
+   export class Subprocess extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+
+   }
+
+   export class SubprocessSystem extends Atomic.AObject {
+
+      // Construct.
+      constructor();
+
+      launch(command: string, args: string[], initialDirectory: string): Subprocess;
+
+   }
+
+
+
+}

Some files were not shown because too many files changed in this diff