Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8a51b86
wip
DnMllr May 13, 2015
31a7d0b
wip
DnMllr May 21, 2015
f9a2479
fix: transform changes after rebase
DnMllr May 21, 2015
7456a06
fix: removed default onMount and onDismount
DnMllr May 21, 2015
52e27a5
fix: Scene
DnMllr May 21, 2015
d5447f9
fixed issues from rebase
DnMllr May 26, 2015
3c7bdd7
fix: tests with changes
DnMllr May 26, 2015
14dec05
fix: Engine test to use ENUM
DnMllr May 26, 2015
b9e2ce4
fix: rebase killed DOMRenderer
DnMllr May 27, 2015
ff12750
fix: Correctly handle TIME command in Context
alexanderGugel May 27, 2015
b75be5e
refact: Make Commands an object literal
alexanderGugel May 27, 2015
d0119f5
feature: broke out world and local transforms into their own events
DnMllr May 28, 2015
5b0e8e1
feature: broke Layer out of systems
DnMllr May 29, 2015
fe8c345
wip: completing Node's delegation to TransformSystem
DnMllr May 29, 2015
539a756
fix: Fix gimbal lock case in quaternion -> euler conversion
alexanderGugel Jun 1, 2015
5ccb3e5
fix: Call change functions with vectors
alexanderGugel Jun 1, 2015
c324395
feature: added size system
DnMllr Jun 1, 2015
d78b886
fixing bugs
DnMllr Jun 1, 2015
28a4ec3
fix: delegated to systems for .get Methods
DnMllr Jun 2, 2015
0e25e71
fix: renamed Layer to PathStore
DnMllr Jun 3, 2015
871621e
wip: adding documentation
DnMllr Jun 3, 2015
a24ba33
chore: added more tests and docs
DnMllr Jun 3, 2015
f60ac5d
chore: added path tests
DnMllr Jun 4, 2015
b643845
wip: started in on tests for PathStore
DnMllr Jun 4, 2015
0870f50
fix: Fix PathStore#remove
alexanderGugel Jun 4, 2015
a7b0e54
doc: Fix invalid doc
alexanderGugel Jun 4, 2015
88a3a95
fix: Fix Node#dismount
alexanderGugel Jun 4, 2015
47053d3
chore: added tests for PathStore
DnMllr Jun 4, 2015
69a9aae
chore: added more tests for PathStore
DnMllr Jun 4, 2015
b5168ea
chore: added test files and comments to transform.js
DnMllr Jun 4, 2015
f7ee413
chore: added documentation to transformsystem
DnMllr Jun 8, 2015
29e20d4
chore: added documentation to transform
DnMllr Jun 9, 2015
5420258
chore: add comments to commands
DnMllr Jun 9, 2015
9eee175
wip: removing unused parts of node
DnMllr Jun 9, 2015
1a8e770
fix: problems regarding mount and node updates
DnMllr Jun 9, 2015
d867a0f
chore: added test stubs for Node
DnMllr Jun 9, 2015
d66ea9f
added test script
DnMllr Jun 10, 2015
ce831d6
wip: testing script
DnMllr Jun 10, 2015
3e041e4
fix: fixed failing tests for Path
DnMllr Jun 10, 2015
8b77488
chore: added more tests for transform
DnMllr Jun 10, 2015
03cde5a
chore: added tests for transform
DnMllr Jun 10, 2015
2b456bf
fixed some bugs
DnMllr Jun 11, 2015
1918458
fix: made SizeSystem and TransformSystem be able to take components
DnMllr Jun 11, 2015
d9d6774
chore added tests and improved runner
DnMllr Jun 12, 2015
d2477b9
chore: add new commands
DnMllr Jun 12, 2015
b609001
chore: added comments to node
DnMllr Jun 12, 2015
06e6f8e
fixed error in Context after rebase
DnMllr Jun 12, 2015
c31351a
fix: Node can have values set before it was mounted
DnMllr Jun 12, 2015
195deb6
fix: forgot console.log
DnMllr Jun 12, 2015
cb099d4
feature: added comments to size
DnMllr Jun 12, 2015
d722ff2
chore: fixed test runner
DnMllr Jun 12, 2015
1f662eb
chore: remove legacy from rebase
DnMllr Jun 12, 2015
2ef7012
fixed some tests
DnMllr Jun 13, 2015
e0a75ea
chore: 'update package.json
michaelobriena Jun 15, 2015
029f522
Merge pull request #11 from michaelobriena/fix-pkgjson
DnMllr Jun 15, 2015
d529d9d
fix: better equality testing
DnMllr Jun 16, 2015
2c82db0
fix: don't print function sort
DnMllr Jun 16, 2015
cfb1409
chore: lint
DnMllr Jun 16, 2015
6a0cd0b
fix: bug in sizesystem
DnMllr Jun 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions components/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

'use strict';

var Commands = require('../core/Commands');

/**
* Camera is a component that is responsible for sending information to the renderer about where
* the camera is in the scene. This allows the user to set the type of projection, the focal depth,
Expand Down Expand Up @@ -202,32 +204,32 @@ Camera.prototype.onUpdate = function onUpdate() {
var path = this._node.getLocation();

this._node
.sendDrawCommand('WITH')
.sendDrawCommand(Commands.WITH)
.sendDrawCommand(path);

if (this._perspectiveDirty) {
this._perspectiveDirty = false;

switch (this._projectionType) {
case Camera.FRUSTUM_PROJECTION:
this._node.sendDrawCommand('FRUSTUM_PROJECTION');
this._node.sendDrawCommand(Commands.FRUSTRUM_PROJECTION);
this._node.sendDrawCommand(this._near);
this._node.sendDrawCommand(this._far);
break;
case Camera.PINHOLE_PROJECTION:
this._node.sendDrawCommand('PINHOLE_PROJECTION');
this._node.sendDrawCommand(Commands.PINHOLE_PROJECTION);
this._node.sendDrawCommand(this._focalDepth);
break;
case Camera.ORTHOGRAPHIC_PROJECTION:
this._node.sendDrawCommand('ORTHOGRAPHIC_PROJECTION');
this._node.sendDrawCommand(Commands.ORTHOGRAPHIC_PROJECTION);
break;
}
}

if (this._viewDirty) {
this._viewDirty = false;

this._node.sendDrawCommand('CHANGE_VIEW_TRANSFORM');
this._node.sendDrawCommand(Commands.CHANGE_VIEW_TRANSFORM);
this._node.sendDrawCommand(this._viewTransform[0]);
this._node.sendDrawCommand(this._viewTransform[1]);
this._node.sendDrawCommand(this._viewTransform[2]);
Expand Down
69 changes: 69 additions & 0 deletions core/Commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Famous Industries Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

'use strict';

/**
* An enumeration of the commands in our command queue.
*/
var Commands = {
INIT_DOM: 0,
DOM_RENDER_SIZE: 1,
CHANGE_TRANSFORM: 2,
CHANGE_SIZE: 3,
CHANGE_PROPERTY: 4,
CHANGE_CONTENT: 5,
CHANGE_ATTRIBUTE: 6,
ADD_CLASS: 7,
REMOVE_CLASS: 8,
SUBSCRIBE: 9,
GL_SET_DRAW_OPTIONS: 10,
GL_AMBIENT_LIGHT: 11,
GL_LIGHT_POSITION: 12,
GL_LIGHT_COLOR: 13,
MATERIAL_INPUT: 14,
GL_SET_GEOMETRY: 15,
GL_UNIFORMS: 16,
GL_BUFFER_DATA: 17,
GL_CUTOUT_STATE: 18,
GL_MESH_VISIBILITY: 19,
GL_REMOVE_MESH: 20,
PINHOLE_PROJECTION: 21,
ORTHOGRAPHIC_PROJECTION: 22,
CHANGE_VIEW_TRANSFORM: 23,
WITH: 24,
FRAME: 25,
ENGINE: 26,
START: 27,
STOP: 28,
TIME: 29,
TRIGGER: 30,
NEED_SIZE_FOR: 31,
DOM: 32,
READY: 33,
ALLOW_DEFAULT: 34,
PREVENT_DEFAULT: 35
};

module.exports = Commands;
Loading