Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Camera; apply view transform to underlying entity, so entity based tr…
Browse files Browse the repository at this point in the history
…ansform changes are applied correctly. fix #110
  • Loading branch information
ruby0x1 committed Feb 19, 2015
1 parent d36f9bb commit bbd7080
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions luxe/Camera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ class Camera extends Entity {
}
}

//create or assign the underlying camera view
view = options.view == null ? new phoenix.Camera( options ) : options.view;

//Init the entity part
super({
name : _name,
no_scene : options.no_scene
name: _name,
no_scene: options.no_scene,
transform: view.transform
});

//Apply options
view = options.view == null ? new phoenix.Camera( options ) : options.view;

//Start with the transform
_final_pos = view.pos;

Expand Down
8 changes: 4 additions & 4 deletions phoenix/Camera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class Camera {
@:isVar public var near (default,set) : Float = 1000;
@:isVar public var far (default,set) : Float = -1000;
//specific to perspective
@:isVar public var fov (default, set) : Float = 60;
public var fov_type(default, set) : FOVType = FOVType.horizontal;
@:isVar public var aspect (default,set) : Float = 1.5;
@:isVar public var target (default,set) : Vector;
@:isVar public var fov (default, set) : Float = 60;
@:isVar public var fov_type (default, set) : FOVType = FOVType.horizontal;
@:isVar public var aspect (default,set) : Float = 1.5;
@:isVar public var target (default,set) : Vector;

//we keep a local pos variable as an unaltered position
//to keep the center relative to the viewport, and allow setting position as 0,0 not center
Expand Down

0 comments on commit bbd7080

Please sign in to comment.