Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Camera updates

  • Loading branch information...
commit 6166516f033d81f27b547b486335b2e421524343 1 parent 92d4d9c
Greg Caldwell Greg209 authored
4 awaybuilder-core/src/awaybuilder/utils/scene/Scene3DManager.as
View
@@ -1,5 +1,6 @@
package awaybuilder.utils.scene
{
+ import away3d.cameras.lenses.LensBase;
import avmplus.*;
import away3d.cameras.*;
@@ -56,6 +57,7 @@ package awaybuilder.utils.scene
public static var selectedObject:ObjectContainer3D;
public static var multiSelection:Boolean = false;
public static var mouseSelection:ObjectContainer3D;
+ public static var lensSelected:LensBase;
// public static var objects:ArrayList = new ArrayList(); // TODO: Use vector
// public static var lights:ArrayList = new ArrayList();// TODO: Use vector
@@ -1037,6 +1039,8 @@ package awaybuilder.utils.scene
{
instance.dispatchEvent(new Scene3DManagerEvent(Scene3DManagerEvent.ENABLE_TRANSFORM_MODES));
+ lensSelected = null;
+
var itemsDeselected:Boolean = false;
for(var i:int=0;i<selectedObjects.length;i++)
{
5 awaybuilder-core/src/awaybuilder/view/mediators/CoreEditorMediator.as
View
@@ -1655,6 +1655,11 @@ package awaybuilder.view.mediators
var camera:CameraVO = event.items[0] as CameraVO;
selectCamerasScene( assets.GetObject( camera ) as Camera3D );
}
+ else if( event.items[0] is LensVO )
+ {
+ var lens:LensVO = event.items[0] as LensVO;
+ Scene3DManager.lensSelected = assets.GetObject( lens ) as LensBase;
+ }
else {
Scene3DManager.unselectAll();
}
25 awaybuilder-core/src/awaybuilder/view/scene/controls/CameraGizmo3D.as
View
@@ -118,25 +118,21 @@ package awaybuilder.view.scene.controls
bodyFrame.z = -150;
_camera.addChild(bodyFrame);
- var cyl1:Mesh = new Mesh(new CylinderGeometry(85, 85, 50), camMat);
- cyl1.x = -50;
- cyl1.z = -125;
+ var cyl1:Mesh = new Mesh(new CylinderGeometry(75, 75, 50), camMat);
+ cyl1.z = -75;
_camera.addChild(cyl1);
- var cyl2:Mesh = new Mesh(new CylinderGeometry(85, 85, 50), camMat);
- cyl2.x = -50;
- cyl2.z = -250;
+ var cyl2:Mesh = new Mesh(new CylinderGeometry(75, 75, 50), camMat);
+ cyl2.z = -225;
_camera.addChild(cyl2);
cyl1.mouseEnabled = cyl2.mouseEnabled = true;
- var cylFrame1:WireframeCylinder = new WireframeCylinder(85, 85, 50, 16, 1, 0xffffff, 0.5);
- cylFrame1.x = -50;
- cylFrame1.z = -125;
+ var cylFrame1:WireframeCylinder = new WireframeCylinder(75, 75, 50, 16, 1, 0xffffff, 0.5);
+ cylFrame1.z = -75;
_camera.addChild(cylFrame1);
- var cylFrame2:WireframeCylinder = new WireframeCylinder(85, 85, 50, 16, 1, 0xffffff, 0.5);
- cylFrame2.x = -50;
- cylFrame2.z = -250;
+ var cylFrame2:WireframeCylinder = new WireframeCylinder(75, 75, 50, 16, 1, 0xffffff, 0.5);
+ cylFrame2.z = -225;
_camera.addChild(cylFrame2);
- cyl1.y = cyl2.y = cylFrame1.y = cylFrame2.y = 90;
+ cyl1.y = cyl2.y = cylFrame1.y = cylFrame2.y = 150;
cyl1.rotationZ = cyl2.rotationZ = cylFrame1.rotationZ = cylFrame2.rotationZ = -90;
_representation.transform = originalCamera.transform.clone();
@@ -192,10 +188,11 @@ package awaybuilder.view.scene.controls
_orthoPlaneNear.width = _orthoPlaneFar.width = (orthoOCLens.maxX - orthoOCLens.minX);
_orthoPlaneNear.height = _orthoPlaneFar.height = (orthoOCLens.maxY - orthoOCLens.minY);
}
+
var oldFrustumVis:Boolean = _frustum.visible;
_perspectiveCone.visible = (perspLens!=null || perspOCLens!=null);
_frustum.visible = _perspectiveCone.visible && (_overrideObjectSelection || Scene3DManager.selectedObject == _representation);
-
+
var oldOrthoCubeVis:Boolean = _orthoPlaneNear.visible;
_orthoCube.visible = !_perspectiveCone.visible;
_orthoPlaneNear.visible = _orthoPlaneFar.visible = _orthoCube.visible && (_overrideObjectSelection || Scene3DManager.selectedObject == _representation);
Please sign in to comment.
Something went wrong with that request. Please try again.