From bbd70809b313bb5a5511b09cd250ba3e3441cb0f Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Thu, 19 Feb 2015 14:30:58 -0330 Subject: [PATCH] Camera; apply view transform to underlying entity, so entity based transform changes are applied correctly. fix #110 --- luxe/Camera.hx | 11 ++++++----- phoenix/Camera.hx | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/luxe/Camera.hx b/luxe/Camera.hx index ae901faff..92f2b1aa3 100644 --- a/luxe/Camera.hx +++ b/luxe/Camera.hx @@ -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; diff --git a/phoenix/Camera.hx b/phoenix/Camera.hx index 31aaf4a6d..2553aa57d 100644 --- a/phoenix/Camera.hx +++ b/phoenix/Camera.hx @@ -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