Permalink
Browse files

Merge branch 'dev' into cubic_path

  • Loading branch information...
2 parents f8d67a0 + 45b023d commit f79d2b1f6ff5e4e710f77710c1aa66d57481d18a @bbeaumont committed May 5, 2012
Showing with 26 additions and 74 deletions.
  1. +1 −0 .gitignore
  2. +0 −1 src/away3d/animators/data/AnimationStateBase.as
  3. +0 −1 src/away3d/animators/data/SkeletonAnimationState.as
  4. +1 −1 src/away3d/bounds/BoundingSphere.as
  5. +1 −1 src/away3d/cameras/Camera3D.as
  6. +0 −2 src/away3d/cameras/lenses/FreeMatrixLens.as
  7. +0 −1 src/away3d/cameras/lenses/LensBase.as
  8. +0 −3 src/away3d/containers/View3D.as
  9. +1 −1 src/away3d/controllers/FirstPersonController.as
  10. +0 −2 src/away3d/core/managers/Mouse3DManager.as
  11. +0 −2 src/away3d/core/raycast/colliders/TriangleCollider.as
  12. +0 −1 src/away3d/core/render/RendererBase.as
  13. +0 −1 src/away3d/library/AssetLibrary.as
  14. +0 −4 src/away3d/lights/PointLight.as
  15. +3 −2 src/away3d/loaders/parsers/AC3DParser.as
  16. +0 −1 src/away3d/loaders/parsers/OBJParser.as
  17. +0 −1 src/away3d/materials/DefaultMaterialBase.as
  18. +0 −1 src/away3d/materials/MaterialBase.as
  19. +1 −1 src/away3d/materials/methods/BasicSpecularMethod.as
  20. +0 −1 src/away3d/materials/methods/DitheredShadowMapMethod.as
  21. +0 −1 src/away3d/materials/methods/FilteredShadowMapMethod.as
  22. +0 −2 src/away3d/materials/methods/HardShadowMapMethod.as
  23. +1 −3 src/away3d/materials/methods/LightMapDiffuseMethod.as
  24. +0 −2 src/away3d/materials/methods/ShadowMapMethodBase.as
  25. +0 −3 src/away3d/materials/methods/SoftShadowMapMethod.as
  26. +1 −2 src/away3d/materials/methods/WrapDiffuseMethod.as
  27. +2 −2 src/away3d/materials/passes/MaterialPassBase.as
  28. +0 −4 src/away3d/materials/passes/SkyBoxPass.as
  29. +0 −1 src/away3d/primitives/CapsuleGeometry.as
  30. +2 −2 src/away3d/primitives/ConeGeometry.as
  31. +1 −1 src/away3d/primitives/CubeGeometry.as
  32. +1 −1 src/away3d/primitives/CylinderGeometry.as
  33. +1 −1 src/away3d/primitives/PlaneGeometry.as
  34. +0 −6 src/away3d/primitives/PrimitiveBase.as
  35. +2 −3 src/away3d/primitives/RegularPolygonGeometry.as
  36. +1 −2 src/away3d/primitives/SphereGeometry.as
  37. +1 −1 src/away3d/primitives/TorusGeometry.as
  38. +1 −1 src/away3d/primitives/WireframeCylinder.as
  39. +0 −1 src/away3d/textures/CubeTextureBase.as
  40. +0 −2 src/away3d/textures/RenderCubeTexture.as
  41. +1 −1 src/away3d/tools/commands/Weld.as
  42. +1 −1 src/away3d/tools/helpers/MeshHelper.as
  43. +1 −1 src/away3d/tools/helpers/data/MeshDebug.as
  44. +1 −1 src/away3d/tools/utils/Drag3D.as
  45. +0 −1 src/away3d/utils/Cast.as
View
@@ -1,6 +1,7 @@
/.flexLibProperties
/target
/.project
+/.settings
/.actionScriptProperties
*.iml
out
@@ -5,7 +5,6 @@ package away3d.animators.data
import away3d.core.managers.Stage3DProxy;
import away3d.entities.Mesh;
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
@@ -37,7 +37,6 @@ package away3d.animators.data
private var _globalInput : Boolean;
private var _buffersValid : Dictionary = new Dictionary();
private var _globalMatricesInvalid : Boolean;
- private var _useCondensedIndices : Boolean;
private var _condensedMatrices : Vector.<Number>;
@@ -260,7 +260,7 @@ package away3d.bounds
var c:Number = px * px + py * py + pz * pz - _radius * _radius;
var det:Number = b * b - 4 * a * c;
if( det >= 0 ) { // ray goes through sphere
- var sqrtDet:Number = Math.sqrt( det )
+ var sqrtDet:Number = Math.sqrt( det );
t = ( -b - sqrtDet ) / ( 2 * a );
_rayFarT = ( -b + sqrtDet ) / ( 2 * a );
if( t > 0 ) {
@@ -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)); } }}
@@ -2,8 +2,6 @@ package away3d.cameras.lenses
{
import away3d.arcane;
- import flash.geom.Matrix3D;
-
use namespace arcane;
/**
@@ -7,7 +7,6 @@ package away3d.cameras.lenses
import flash.events.EventDispatcher;
import flash.geom.Matrix3D;
- import flash.geom.Point;
import flash.geom.Vector3D;
use namespace arcane;
@@ -12,9 +12,6 @@
import away3d.core.render.Filter3DRenderer;
import away3d.core.render.RendererBase;
import away3d.core.traverse.EntityCollector;
- import away3d.lights.DirectionalLight;
- import away3d.lights.LightBase;
- import away3d.lights.PointLight;
import away3d.textures.Texture2DBase;
import flash.display.Sprite;
Oops, something went wrong.

0 comments on commit f79d2b1

Please sign in to comment.