Skip to content

Commit

Permalink
Merge branch 'dev' into cubic_path
Browse files Browse the repository at this point in the history
  • Loading branch information
bbeaumont committed May 5, 2012
2 parents f8d67a0 + 45b023d commit f79d2b1
Show file tree
Hide file tree
Showing 45 changed files with 26 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
/.flexLibProperties /.flexLibProperties
/target /target
/.project /.project
/.settings
/.actionScriptProperties /.actionScriptProperties
*.iml *.iml
out out
1 change: 0 additions & 1 deletion src/away3d/animators/data/AnimationStateBase.as
Expand Up @@ -5,7 +5,6 @@ package away3d.animators.data
import away3d.core.managers.Stage3DProxy; import away3d.core.managers.Stage3DProxy;
import away3d.entities.Mesh; import away3d.entities.Mesh;
import away3d.errors.AbstractMethodError; import away3d.errors.AbstractMethodError;
import away3d.materials.passes.MaterialPassBase;


/** /**
* AnimationStateBase provides an abstract base class for all animation states. This defines the actual state of the * AnimationStateBase provides an abstract base class for all animation states. This defines the actual state of the
Expand Down
1 change: 0 additions & 1 deletion src/away3d/animators/data/SkeletonAnimationState.as
Expand Up @@ -37,7 +37,6 @@ package away3d.animators.data
private var _globalInput : Boolean; private var _globalInput : Boolean;
private var _buffersValid : Dictionary = new Dictionary(); private var _buffersValid : Dictionary = new Dictionary();
private var _globalMatricesInvalid : Boolean; private var _globalMatricesInvalid : Boolean;
private var _useCondensedIndices : Boolean;
private var _condensedMatrices : Vector.<Number>; private var _condensedMatrices : Vector.<Number>;




Expand Down
2 changes: 1 addition & 1 deletion src/away3d/bounds/BoundingSphere.as
Expand Up @@ -260,7 +260,7 @@ package away3d.bounds
var c:Number = px * px + py * py + pz * pz - _radius * _radius; var c:Number = px * px + py * py + pz * pz - _radius * _radius;
var det:Number = b * b - 4 * a * c; var det:Number = b * b - 4 * a * c;
if( det >= 0 ) { // ray goes through sphere if( det >= 0 ) { // ray goes through sphere
var sqrtDet:Number = Math.sqrt( det ) var sqrtDet:Number = Math.sqrt( det );
t = ( -b - sqrtDet ) / ( 2 * a ); t = ( -b - sqrtDet ) / ( 2 * a );
_rayFarT = ( -b + sqrtDet ) / ( 2 * a ); _rayFarT = ( -b + sqrtDet ) / ( 2 * a );
if( t > 0 ) { if( t > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/away3d/cameras/Camera3D.as
@@ -1 +1 @@
package away3d.cameras{ import away3d.arcane; import away3d.cameras.lenses.LensBase; import away3d.cameras.lenses.PerspectiveLens; import away3d.core.math.Matrix3DUtils; import away3d.core.math.Plane3D; import away3d.core.partition.CameraNode; import away3d.core.partition.EntityNode; import away3d.entities.Entity; import away3d.events.LensEvent; import flash.geom.Matrix3D; import flash.geom.Point; import flash.geom.Vector3D; use namespace arcane; /** * A Camera3D object represents a virtual camera through which we view the scene. */ public class Camera3D extends Entity { private var _viewProjection : Matrix3D = new Matrix3D(); private var _viewProjectionDirty : Boolean = true; private var _lens : LensBase; private var _frustumPlanes : Vector.<Plane3D>; private var _frustumPlanesDirty : Boolean = true; /** * Creates a new Camera3D object * @param lens An optional lens object that will perform the projection. Defaults to PerspectiveLens. * * @see away3d.cameras.lenses.PerspectiveLens */ public function Camera3D(lens : LensBase = null) { super(); //setup default lens _lens = lens || new PerspectiveLens(); _lens.addEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); //setup default frustum planes _frustumPlanes = new Vector.<Plane3D>(6, true); for (var i : int = 0; i < 6; ++i) _frustumPlanes[i] = new Plane3D(); z = -1000; } private function onLensMatrixChanged(event : LensEvent) : void { _viewProjectionDirty = true; _frustumPlanesDirty = true; dispatchEvent(event); } /** * */ public function get frustumPlanes() : Vector.<Plane3D> { if (_frustumPlanesDirty) { var c11 : Number,c12 : Number,c13 : Number,c14 : Number; var c21 : Number,c22 : Number,c23 : Number,c24 : Number; var c31 : Number,c32 : Number,c33 : Number,c34 : Number; var c41 : Number,c42 : Number,c43 : Number,c44 : Number; var p : Plane3D; var raw : Vector.<Number> = Matrix3DUtils.RAW_DATA_CONTAINER; viewProjection.copyRawDataTo(raw); c11 = raw[uint(0)]; c12 = raw[uint(4)]; c13 = raw[uint(8)]; c14 = raw[uint(12)]; c21 = raw[uint(1)]; c22 = raw[uint(5)]; c23 = raw[uint(9)]; c24 = raw[uint(13)]; c31 = raw[uint(2)]; c32 = raw[uint(6)]; c33 = raw[uint(10)]; c34 = raw[uint(14)]; c41 = raw[uint(3)]; c42 = raw[uint(7)]; c43 = raw[uint(11)]; c44 = raw[uint(15)]; // left plane p = _frustumPlanes[0]; p.a = c41 + c11; p.b = c42 + c12; p.c = c43 + c13; p.d = c44 + c14; // right plane p = _frustumPlanes[1]; p.a = c41 - c11; p.b = c42 - c12; p.c = c43 - c13; p.d = c44 - c14; // bottom p = _frustumPlanes[2]; p.a = c41 + c21; p.b = c42 + c22; p.c = c43 + c23; p.d = c44 + c24; // top p = _frustumPlanes[3]; p.a = c41 - c21; p.b = c42 - c22; p.c = c43 - c23; p.d = c44 - c24; // near p = _frustumPlanes[4]; p.a = c31; p.b = c32; p.c = c33; p.d = c34; // far p = _frustumPlanes[5]; p.a = c41 - c31; p.b = c42 - c32; p.c = c43 - c33; p.d = c44 - c34; _frustumPlanesDirty = false; } return _frustumPlanes; } /** * @inheritDoc */ override protected function invalidateSceneTransform() : void { super.invalidateSceneTransform(); _viewProjectionDirty = true; _frustumPlanesDirty = true; } /** * @inheritDoc */ override protected function updateBounds() : void { _bounds.nullify(); _boundsInvalid = false; } /** * @inheritDoc */ override protected function createEntityPartitionNode() : EntityNode { return new CameraNode(this); } /** * The lens used by the camera to perform the projection; */ public function get lens() : LensBase { return _lens; } public function set lens(value : LensBase) : void { if (_lens == value) return; if (!value) throw new Error("Lens cannot be null!"); _lens.removeEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); _lens = value; _lens.addEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); dispatchEvent(new LensEvent(LensEvent.MATRIX_CHANGED, value)); } /** * The view projection matrix of the camera. */ public function get viewProjection() : Matrix3D { if (_viewProjectionDirty) { _viewProjection.copyFrom(inverseSceneTransform); _viewProjection.append(_lens.matrix); _viewProjectionDirty = false; } return _viewProjection; } /** * */ public function unproject(mX : Number, mY : Number, useTranslation:Boolean = false):Vector3D { if(useTranslation) return sceneTransform.transformVector(lens.unproject(mX, mY, 0)); return sceneTransform.deltaTransformVector(lens.unproject(mX, mY, 0)); } /** * */ public function project(point3d : Vector3D) : Vector3D { return lens.project(inverseSceneTransform.transformVector(point3d)); } }} package away3d.cameras{ import away3d.arcane; import away3d.cameras.lenses.LensBase; import away3d.cameras.lenses.PerspectiveLens; import away3d.core.math.Matrix3DUtils; import away3d.core.math.Plane3D; import away3d.core.partition.CameraNode; import away3d.core.partition.EntityNode; import away3d.entities.Entity; import away3d.events.LensEvent; import flash.geom.Matrix3D; import flash.geom.Vector3D; use namespace arcane; /** * A Camera3D object represents a virtual camera through which we view the scene. */ public class Camera3D extends Entity { private var _viewProjection : Matrix3D = new Matrix3D(); private var _viewProjectionDirty : Boolean = true; private var _lens : LensBase; private var _frustumPlanes : Vector.<Plane3D>; private var _frustumPlanesDirty : Boolean = true; /** * Creates a new Camera3D object * @param lens An optional lens object that will perform the projection. Defaults to PerspectiveLens. * * @see away3d.cameras.lenses.PerspectiveLens */ public function Camera3D(lens : LensBase = null) { super(); //setup default lens _lens = lens || new PerspectiveLens(); _lens.addEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); //setup default frustum planes _frustumPlanes = new Vector.<Plane3D>(6, true); for (var i : int = 0; i < 6; ++i) _frustumPlanes[i] = new Plane3D(); z = -1000; } private function onLensMatrixChanged(event : LensEvent) : void { _viewProjectionDirty = true; _frustumPlanesDirty = true; dispatchEvent(event); } /** * */ public function get frustumPlanes() : Vector.<Plane3D> { if (_frustumPlanesDirty) { var c11 : Number,c12 : Number,c13 : Number,c14 : Number; var c21 : Number,c22 : Number,c23 : Number,c24 : Number; var c31 : Number,c32 : Number,c33 : Number,c34 : Number; var c41 : Number,c42 : Number,c43 : Number,c44 : Number; var p : Plane3D; var raw : Vector.<Number> = Matrix3DUtils.RAW_DATA_CONTAINER; viewProjection.copyRawDataTo(raw); c11 = raw[uint(0)]; c12 = raw[uint(4)]; c13 = raw[uint(8)]; c14 = raw[uint(12)]; c21 = raw[uint(1)]; c22 = raw[uint(5)]; c23 = raw[uint(9)]; c24 = raw[uint(13)]; c31 = raw[uint(2)]; c32 = raw[uint(6)]; c33 = raw[uint(10)]; c34 = raw[uint(14)]; c41 = raw[uint(3)]; c42 = raw[uint(7)]; c43 = raw[uint(11)]; c44 = raw[uint(15)]; // left plane p = _frustumPlanes[0]; p.a = c41 + c11; p.b = c42 + c12; p.c = c43 + c13; p.d = c44 + c14; // right plane p = _frustumPlanes[1]; p.a = c41 - c11; p.b = c42 - c12; p.c = c43 - c13; p.d = c44 - c14; // bottom p = _frustumPlanes[2]; p.a = c41 + c21; p.b = c42 + c22; p.c = c43 + c23; p.d = c44 + c24; // top p = _frustumPlanes[3]; p.a = c41 - c21; p.b = c42 - c22; p.c = c43 - c23; p.d = c44 - c24; // near p = _frustumPlanes[4]; p.a = c31; p.b = c32; p.c = c33; p.d = c34; // far p = _frustumPlanes[5]; p.a = c41 - c31; p.b = c42 - c32; p.c = c43 - c33; p.d = c44 - c34; _frustumPlanesDirty = false; } return _frustumPlanes; } /** * @inheritDoc */ override protected function invalidateSceneTransform() : void { super.invalidateSceneTransform(); _viewProjectionDirty = true; _frustumPlanesDirty = true; } /** * @inheritDoc */ override protected function updateBounds() : void { _bounds.nullify(); _boundsInvalid = false; } /** * @inheritDoc */ override protected function createEntityPartitionNode() : EntityNode { return new CameraNode(this); } /** * The lens used by the camera to perform the projection; */ public function get lens() : LensBase { return _lens; } public function set lens(value : LensBase) : void { if (_lens == value) return; if (!value) throw new Error("Lens cannot be null!"); _lens.removeEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); _lens = value; _lens.addEventListener(LensEvent.MATRIX_CHANGED, onLensMatrixChanged); dispatchEvent(new LensEvent(LensEvent.MATRIX_CHANGED, value)); } /** * The view projection matrix of the camera. */ public function get viewProjection() : Matrix3D { if (_viewProjectionDirty) { _viewProjection.copyFrom(inverseSceneTransform); _viewProjection.append(_lens.matrix); _viewProjectionDirty = false; } return _viewProjection; } /** * */ public function unproject(mX : Number, mY : Number, useTranslation:Boolean = false):Vector3D { if(useTranslation) return sceneTransform.transformVector(lens.unproject(mX, mY, 0)); return sceneTransform.deltaTransformVector(lens.unproject(mX, mY, 0)); } /** * */ public function project(point3d : Vector3D) : Vector3D { return lens.project(inverseSceneTransform.transformVector(point3d)); } }}
Expand Down
2 changes: 0 additions & 2 deletions src/away3d/cameras/lenses/FreeMatrixLens.as
Expand Up @@ -2,8 +2,6 @@ package away3d.cameras.lenses
{ {
import away3d.arcane; import away3d.arcane;


import flash.geom.Matrix3D;

use namespace arcane; use namespace arcane;


/** /**
Expand Down
1 change: 0 additions & 1 deletion src/away3d/cameras/lenses/LensBase.as
Expand Up @@ -7,7 +7,6 @@ package away3d.cameras.lenses
import flash.events.EventDispatcher; import flash.events.EventDispatcher;


import flash.geom.Matrix3D; import flash.geom.Matrix3D;
import flash.geom.Point;
import flash.geom.Vector3D; import flash.geom.Vector3D;


use namespace arcane; use namespace arcane;
Expand Down
3 changes: 0 additions & 3 deletions src/away3d/containers/View3D.as
Expand Up @@ -12,9 +12,6 @@
import away3d.core.render.Filter3DRenderer; import away3d.core.render.Filter3DRenderer;
import away3d.core.render.RendererBase; import away3d.core.render.RendererBase;
import away3d.core.traverse.EntityCollector; import away3d.core.traverse.EntityCollector;
import away3d.lights.DirectionalLight;
import away3d.lights.LightBase;
import away3d.lights.PointLight;
import away3d.textures.Texture2DBase; import away3d.textures.Texture2DBase;


import flash.display.Sprite; import flash.display.Sprite;
Expand Down

0 comments on commit f79d2b1

Please sign in to comment.