diff --git a/away3d/animators/ParticleAnimationSet.hx b/away3d/animators/ParticleAnimationSet.hx index f65fcf9b..9eada37e 100644 --- a/away3d/animators/ParticleAnimationSet.hx +++ b/away3d/animators/ParticleAnimationSet.hx @@ -103,11 +103,11 @@ class ParticleAnimationSet extends AnimationSetBase implements IAnimationSet var i:Int; var n:ParticleNodeBase = cast(node, ParticleNodeBase); n.processAnimationSetting(this); - if (n.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (n.mode == LOCAL_STATIC) { n.dataOffset = _totalLenOfOneVertex; _totalLenOfOneVertex += n.dataLength; _localStaticNodes.push(n); - } else if (n.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) + } else if (n.mode == LOCAL_DYNAMIC) _localDynamicNodes.push(n); i = _particleNodes.length - 1; diff --git a/away3d/animators/ParticleAnimator.hx b/away3d/animators/ParticleAnimator.hx index d605aa10..f9b8b2e6 100644 --- a/away3d/animators/ParticleAnimator.hx +++ b/away3d/animators/ParticleAnimator.hx @@ -47,7 +47,7 @@ class ParticleAnimator extends AnimatorBase implements IAnimator var node:ParticleNodeBase; for (node in _particleAnimationSet.particleNodes) { state = cast(getAnimationState(node), ParticleStateBase); - if (node.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) { + if (node.mode == LOCAL_DYNAMIC) { _animatorParticleStates.push(state); node.dataOffset = _totalLenOfOneVertex; _totalLenOfOneVertex += node.dataLength; diff --git a/away3d/animators/VertexAnimationSet.hx b/away3d/animators/VertexAnimationSet.hx index 4895bbd1..faa0c9d2 100644 --- a/away3d/animators/VertexAnimationSet.hx +++ b/away3d/animators/VertexAnimationSet.hx @@ -15,11 +15,11 @@ import openfl.Vector; class VertexAnimationSet extends AnimationSetBase implements IAnimationSet { public var numPoses(get, never):Int; - public var blendMode(get, never):String; + public var blendMode(get, never):VertexAnimationMode; public var useNormals(get, never):Bool; private var _numPoses:Int; - private var _blendMode:String; + private var _blendMode:VertexAnimationMode; private var _streamIndices:Map = new Map(); private var _useNormals:Map = new Map(); private var _useTangents:Map = new Map(); @@ -37,7 +37,7 @@ class VertexAnimationSet extends AnimationSetBase implements IAnimationSet /** * Returns the active blend mode of the vertex animator object. */ - private function get_blendMode():String + private function get_blendMode():VertexAnimationMode { return _blendMode; } @@ -58,7 +58,7 @@ class VertexAnimationSet extends AnimationSetBase implements IAnimationSet * * @see away3d.animators.data.VertexAnimationMode */ - public function new(numPoses:Int = 2, blendMode:String = "absolute") + public function new(numPoses:Int = 2, blendMode:VertexAnimationMode = ABSOLUTE) { super(); @@ -71,7 +71,7 @@ class VertexAnimationSet extends AnimationSetBase implements IAnimationSet */ public function getAGALVertexCode(pass:MaterialPassBase, sourceRegisters:Vector, targetRegisters:Vector, profile:String):String { - if (_blendMode == VertexAnimationMode.ABSOLUTE) + if (_blendMode == ABSOLUTE) return getAbsoluteAGALCode(pass, sourceRegisters, targetRegisters); else return getAdditiveAGALCode(pass, sourceRegisters, targetRegisters); diff --git a/away3d/animators/VertexAnimator.hx b/away3d/animators/VertexAnimator.hx index e80b0652..709aa6eb 100644 --- a/away3d/animators/VertexAnimator.hx +++ b/away3d/animators/VertexAnimator.hx @@ -23,7 +23,7 @@ class VertexAnimator extends AnimatorBase implements IAnimator private var _poses:Vector = new Vector(); private var _weights:Vector = Vector.ofArray([1, 0, 0, 0.0]); private var _numPoses:Int; - private var _blendMode:String; + private var _blendMode:VertexAnimationMode; private var _activeVertexState:IVertexAnimationState; /** @@ -115,7 +115,7 @@ class VertexAnimator extends AnimatorBase implements IAnimator stage3DProxy.context3D.setProgramConstantsFromVector(Context3DProgramType.VERTEX, vertexConstantOffset, _weights, 1); - if (_blendMode == VertexAnimationMode.ABSOLUTE) { + if (_blendMode == ABSOLUTE) { i = 1; subGeom = _poses[0].subGeometries[subMesh._index]; // set the base sub-geometry so the material can simply pick up on this data @@ -142,7 +142,7 @@ class VertexAnimator extends AnimatorBase implements IAnimator { stage3DProxy._context3D.setProgramConstantsFromVector(Context3DProgramType.VERTEX, vertexConstantOffset, _weights, 1); - if (_blendMode == VertexAnimationMode.ABSOLUTE) { + if (_blendMode == ABSOLUTE) { var len:Int = _numPoses; for (i in 0...len) { renderable.activateVertexBuffer(vertexStreamOffset++, stage3DProxy); diff --git a/away3d/animators/data/ParticlePropertiesMode.hx b/away3d/animators/data/ParticlePropertiesMode.hx index 1368375a..119708b9 100644 --- a/away3d/animators/data/ParticlePropertiesMode.hx +++ b/away3d/animators/data/ParticlePropertiesMode.hx @@ -3,21 +3,21 @@ package away3d.animators.data; /** * Options for setting the properties mode of a particle animation node. */ -class ParticlePropertiesMode +@:enum abstract ParticlePropertiesMode(Int) from Int to Int { /** * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state). */ - public static inline var GLOBAL:Int = 0; + public var GLOBAL = 0; /** * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising function on the animation set). */ - public static inline var LOCAL_STATIC:Int = 1; + public var LOCAL_STATIC = 1; /** * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state). */ - public static inline var LOCAL_DYNAMIC:Int = 2; + public var LOCAL_DYNAMIC = 2; } \ No newline at end of file diff --git a/away3d/animators/data/VertexAnimationMode.hx b/away3d/animators/data/VertexAnimationMode.hx index 22bc963d..b8a12cb0 100644 --- a/away3d/animators/data/VertexAnimationMode.hx +++ b/away3d/animators/data/VertexAnimationMode.hx @@ -5,15 +5,15 @@ package away3d.animators.data; * * @see away3d.animators.VertexAnimator */ -class VertexAnimationMode +@:enum abstract VertexAnimationMode(String) from String to String { /** * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose. */ - public static var ADDITIVE:String = "additive"; + public var ADDITIVE = "additive"; /** * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose. */ - public static var ABSOLUTE:String = "absolute"; + public var ABSOLUTE = "absolute"; } diff --git a/away3d/animators/nodes/ParticleAccelerationNode.hx b/away3d/animators/nodes/ParticleAccelerationNode.hx index 5f9f7b28..329e121d 100644 --- a/away3d/animators/nodes/ParticleAccelerationNode.hx +++ b/away3d/animators/nodes/ParticleAccelerationNode.hx @@ -33,7 +33,7 @@ class ParticleAccelerationNode extends ParticleNodeBase * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. */ - public function new(mode:Int, acceleration:Vector3D = null) + public function new(mode:ParticlePropertiesMode, acceleration:Vector3D = null) { super("ParticleAcceleration", mode, 3); @@ -48,7 +48,7 @@ class ParticleAccelerationNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var accelerationValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var accelerationValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, ACCELERATION_INDEX, accelerationValue.index); var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); diff --git a/away3d/animators/nodes/ParticleBezierCurveNode.hx b/away3d/animators/nodes/ParticleBezierCurveNode.hx index 946b71d7..78b8c0bf 100644 --- a/away3d/animators/nodes/ParticleBezierCurveNode.hx +++ b/away3d/animators/nodes/ParticleBezierCurveNode.hx @@ -46,7 +46,7 @@ class ParticleBezierCurveNode extends ParticleNodeBase * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. * @param [optional] endPoint Defines the default end point of the node, used when in global mode. */ - public function new(mode:Int, controlPoint:Vector3D = null, endPoint:Vector3D = null) + public function new(mode:ParticlePropertiesMode, controlPoint:Vector3D = null, endPoint:Vector3D = null) { super("ParticleBezierCurve", mode, 6); @@ -66,10 +66,10 @@ class ParticleBezierCurveNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var controlValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var controlValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, BEZIER_CONTROL_INDEX, controlValue.index); - var endValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var endValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, BEZIER_END_INDEX, endValue.index); var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); diff --git a/away3d/animators/nodes/ParticleBillboardNode.hx b/away3d/animators/nodes/ParticleBillboardNode.hx index f1c546bc..eb79f965 100644 --- a/away3d/animators/nodes/ParticleBillboardNode.hx +++ b/away3d/animators/nodes/ParticleBillboardNode.hx @@ -25,7 +25,7 @@ class ParticleBillboardNode extends ParticleNodeBase */ public function new(billboardAxis:Vector3D = null) { - super("ParticleBillboard", ParticlePropertiesMode.GLOBAL, 0, 4); + super("ParticleBillboard", GLOBAL, 0, 4); _stateConstructor = cast ParticleBillboardState.new; diff --git a/away3d/animators/nodes/ParticleColorNode.hx b/away3d/animators/nodes/ParticleColorNode.hx index f0ef2388..fda02b78 100644 --- a/away3d/animators/nodes/ParticleColorNode.hx +++ b/away3d/animators/nodes/ParticleColorNode.hx @@ -80,7 +80,7 @@ class ParticleColorNode extends ParticleNodeBase * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. */ - public function new(mode:Int, usesMultiplier:Bool = true, usesOffset:Bool = true, usesCycle:Bool = false, usesPhase:Bool = false, startColor:ColorTransform = null, endColor:ColorTransform = null, cycleDuration:Float = 1, cyclePhase:Float = 0) + public function new(mode:ParticlePropertiesMode, usesMultiplier:Bool = true, usesOffset:Bool = true, usesCycle:Bool = false, usesPhase:Bool = false, startColor:ColorTransform = null, endColor:ColorTransform = null, cycleDuration:Float = 1, cyclePhase:Float = 0) { _stateConstructor = cast ParticleColorState.new; @@ -128,8 +128,8 @@ class ParticleColorNode extends ParticleNodeBase } if (_usesMultiplier) { - var startMultiplierValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - var deltaMultiplierValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var startMultiplierValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var deltaMultiplierValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, START_MULTIPLIER_INDEX, startMultiplierValue.index); animationRegisterCache.setRegisterIndex(this, DELTA_MULTIPLIER_INDEX, deltaMultiplierValue.index); @@ -140,8 +140,8 @@ class ParticleColorNode extends ParticleNodeBase } if (_usesOffset) { - var startOffsetValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - var deltaOffsetValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + var startOffsetValue:ShaderRegisterElement = (_mode == LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + var deltaOffsetValue:ShaderRegisterElement = (_mode == LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); animationRegisterCache.setRegisterIndex(this, START_OFFSET_INDEX, startOffsetValue.index); animationRegisterCache.setRegisterIndex(this, DELTA_OFFSET_INDEX, deltaOffsetValue.index); diff --git a/away3d/animators/nodes/ParticleFollowNode.hx b/away3d/animators/nodes/ParticleFollowNode.hx index f7d276f4..6e93f8f2 100644 --- a/away3d/animators/nodes/ParticleFollowNode.hx +++ b/away3d/animators/nodes/ParticleFollowNode.hx @@ -42,7 +42,7 @@ class ParticleFollowNode extends ParticleNodeBase _usesRotation = usesRotation; _smooth = smooth; - super("ParticleFollow", ParticlePropertiesMode.LOCAL_DYNAMIC, (_usesPosition && _usesRotation)? 6 : 3, ParticleAnimationSet.POST_PRIORITY); + super("ParticleFollow", LOCAL_DYNAMIC, (_usesPosition && _usesRotation)? 6 : 3, ParticleAnimationSet.POST_PRIORITY); } /** diff --git a/away3d/animators/nodes/ParticleInitialColorNode.hx b/away3d/animators/nodes/ParticleInitialColorNode.hx index a2068542..ca3234bd 100644 --- a/away3d/animators/nodes/ParticleInitialColorNode.hx +++ b/away3d/animators/nodes/ParticleInitialColorNode.hx @@ -34,7 +34,7 @@ class ParticleInitialColorNode extends ParticleNodeBase */ public static inline var COLOR_INITIAL_COLORTRANSFORM:String = "ColorInitialColorTransform"; - public function new(mode:Int, usesMultiplier:Bool = true, usesOffset:Bool = false, initialColor:ColorTransform = null) + public function new(mode:ParticlePropertiesMode, usesMultiplier:Bool = true, usesOffset:Bool = false, initialColor:ColorTransform = null) { _stateConstructor = cast ParticleInitialColorState.new; @@ -56,14 +56,14 @@ class ParticleInitialColorNode extends ParticleNodeBase if (animationRegisterCache.needFragmentAnimation) { if (_usesMultiplier) { - var multiplierValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var multiplierValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, MULTIPLIER_INDEX, multiplierValue.index); code += "mul " + animationRegisterCache.colorMulTarget + "," + multiplierValue + "," + animationRegisterCache.colorMulTarget + "\n"; } if (_usesOffset) { - var offsetValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + var offsetValue:ShaderRegisterElement = (_mode == LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); animationRegisterCache.setRegisterIndex(this, OFFSET_INDEX, offsetValue.index); code += "add " + animationRegisterCache.colorAddTarget + "," + offsetValue + "," + animationRegisterCache.colorAddTarget + "\n"; diff --git a/away3d/animators/nodes/ParticleNodeBase.hx b/away3d/animators/nodes/ParticleNodeBase.hx index 25eac7fe..ca690f0d 100644 --- a/away3d/animators/nodes/ParticleNodeBase.hx +++ b/away3d/animators/nodes/ParticleNodeBase.hx @@ -1,5 +1,6 @@ package away3d.animators.nodes; +import away3d.animators.data.ParticlePropertiesMode; import away3d.animators.data.ParticleProperties; import away3d.animators.ParticleAnimationSet; import away3d.animators.data.AnimationRegisterCache; @@ -12,12 +13,12 @@ import openfl.Vector; */ class ParticleNodeBase extends AnimationNodeBase { - public var mode(get, never):Int; + public var mode(get, never):ParticlePropertiesMode; public var priority(get, never):Int; public var dataLength(get, never):Int; public var oneData(get, never):Vector; - private var _mode:Int; + private var _mode:ParticlePropertiesMode; private var _priority:Int; private var _dataLength:Int = 3; @@ -105,7 +106,7 @@ class ParticleNodeBase extends AnimationNodeBase * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. */ - public function new(name:String, mode:Int, dataLength:Int, priority:Int = 1) + public function new(name:String, mode:ParticlePropertiesMode, dataLength:Int, priority:Int = 1) { super(); diff --git a/away3d/animators/nodes/ParticleOrbitNode.hx b/away3d/animators/nodes/ParticleOrbitNode.hx index 9b24c825..907bf423 100644 --- a/away3d/animators/nodes/ParticleOrbitNode.hx +++ b/away3d/animators/nodes/ParticleOrbitNode.hx @@ -57,7 +57,7 @@ class ParticleOrbitNode extends ParticleNodeBase * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. */ - public function new(mode:Int, usesEulers:Bool = true, usesCycle:Bool = false, usesPhase:Bool = false, radius:Float = 100, cycleDuration:Float = 1, cyclePhase:Float = 0, eulers:Vector3D = null) + public function new(mode:ParticlePropertiesMode, usesEulers:Bool = true, usesCycle:Bool = false, usesPhase:Bool = false, radius:Float = 100, cycleDuration:Float = 1, cyclePhase:Float = 0, eulers:Vector3D = null) { var len:Int = 3; if (usesPhase) @@ -84,7 +84,7 @@ class ParticleOrbitNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var orbitRegister:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var orbitRegister:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, ORBIT_INDEX, orbitRegister.index); var eulersMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); diff --git a/away3d/animators/nodes/ParticleOscillatorNode.hx b/away3d/animators/nodes/ParticleOscillatorNode.hx index e8bdcac3..c0f1f69f 100644 --- a/away3d/animators/nodes/ParticleOscillatorNode.hx +++ b/away3d/animators/nodes/ParticleOscillatorNode.hx @@ -33,7 +33,7 @@ class ParticleOscillatorNode extends ParticleNodeBase * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. */ - public function new(mode:Int, oscillator:Vector3D = null) + public function new(mode:ParticlePropertiesMode, oscillator:Vector3D = null) { super("ParticleOscillator", mode, 4); @@ -49,7 +49,7 @@ class ParticleOscillatorNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var oscillatorRegister:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var oscillatorRegister:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, OSCILLATOR_INDEX, oscillatorRegister.index); var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); var dgree:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); diff --git a/away3d/animators/nodes/ParticlePositionNode.hx b/away3d/animators/nodes/ParticlePositionNode.hx index fb34713a..355b2b49 100644 --- a/away3d/animators/nodes/ParticlePositionNode.hx +++ b/away3d/animators/nodes/ParticlePositionNode.hx @@ -33,7 +33,7 @@ class ParticlePositionNode extends ParticleNodeBase * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. */ - public function new(mode:Int, position:Vector3D = null) + public function new(mode:ParticlePropertiesMode, position:Vector3D = null) { super("ParticlePosition", mode, 3); @@ -49,7 +49,7 @@ class ParticlePositionNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var positionAttribute:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var positionAttribute:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, POSITION_INDEX, positionAttribute.index); return "add " + animationRegisterCache.positionTarget + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; diff --git a/away3d/animators/nodes/ParticleRotateToHeadingNode.hx b/away3d/animators/nodes/ParticleRotateToHeadingNode.hx index 61e51503..622c68fa 100644 --- a/away3d/animators/nodes/ParticleRotateToHeadingNode.hx +++ b/away3d/animators/nodes/ParticleRotateToHeadingNode.hx @@ -20,7 +20,7 @@ class ParticleRotateToHeadingNode extends ParticleNodeBase */ public function new() { - super("ParticleRotateToHeading", ParticlePropertiesMode.GLOBAL, 0, 3); + super("ParticleRotateToHeading", GLOBAL, 0, 3); _stateConstructor = cast ParticleRotateToHeadingState.new; } diff --git a/away3d/animators/nodes/ParticleRotateToPositionNode.hx b/away3d/animators/nodes/ParticleRotateToPositionNode.hx index da2c2770..261fac94 100644 --- a/away3d/animators/nodes/ParticleRotateToPositionNode.hx +++ b/away3d/animators/nodes/ParticleRotateToPositionNode.hx @@ -32,7 +32,7 @@ class ParticleRotateToPositionNode extends ParticleNodeBase /** * Creates a new ParticleRotateToPositionNode */ - public function new(mode:Int, position:Vector3D = null) + public function new(mode:ParticlePropertiesMode, position:Vector3D = null) { super("ParticleRotateToPosition", mode, 3, 3); @@ -48,7 +48,7 @@ class ParticleRotateToPositionNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var positionAttribute:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var positionAttribute:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, POSITION_INDEX, positionAttribute.index); var code:String = ""; diff --git a/away3d/animators/nodes/ParticleRotationalVelocityNode.hx b/away3d/animators/nodes/ParticleRotationalVelocityNode.hx index 059c07a4..a294251c 100644 --- a/away3d/animators/nodes/ParticleRotationalVelocityNode.hx +++ b/away3d/animators/nodes/ParticleRotationalVelocityNode.hx @@ -32,7 +32,7 @@ class ParticleRotationalVelocityNode extends ParticleNodeBase * * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. */ - public function new(mode:Int, rotationalVelocity:Vector3D = null) + public function new(mode:ParticlePropertiesMode, rotationalVelocity:Vector3D = null) { _stateConstructor = cast ParticleRotationalVelocityState.new; @@ -48,7 +48,7 @@ class ParticleRotationalVelocityNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var rotationRegister:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var rotationRegister:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, ROTATIONALVELOCITY_INDEX, rotationRegister.index); var nrmVel:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); diff --git a/away3d/animators/nodes/ParticleScaleNode.hx b/away3d/animators/nodes/ParticleScaleNode.hx index 29248a25..30e22440 100644 --- a/away3d/animators/nodes/ParticleScaleNode.hx +++ b/away3d/animators/nodes/ParticleScaleNode.hx @@ -50,7 +50,7 @@ class ParticleScaleNode extends ParticleNodeBase * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. */ - public function new(mode:Int, usesCycle:Bool, usesPhase:Bool, minScale:Float = 1, maxScale:Float = 1, cycleDuration:Float = 1, cyclePhase:Float = 0) + public function new(mode:ParticlePropertiesMode, usesCycle:Bool, usesPhase:Bool, minScale:Float = 1, maxScale:Float = 1, cycleDuration:Float = 1, cyclePhase:Float = 0) { var len:Int = 2; if (usesCycle) @@ -78,7 +78,7 @@ class ParticleScaleNode extends ParticleNodeBase var code:String = ""; var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - var scaleRegister:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var scaleRegister:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, SCALE_INDEX, scaleRegister.index); if (_usesCycle) { diff --git a/away3d/animators/nodes/ParticleSegmentedColorNode.hx b/away3d/animators/nodes/ParticleSegmentedColorNode.hx index 5e3c213e..691d604c 100644 --- a/away3d/animators/nodes/ParticleSegmentedColorNode.hx +++ b/away3d/animators/nodes/ParticleSegmentedColorNode.hx @@ -41,7 +41,7 @@ class ParticleSegmentedColorNode extends ParticleNodeBase _stateConstructor = cast ParticleSegmentedColorState.new; //because of the stage3d register limitation, it only support the global mode - super("ParticleSegmentedColor", ParticlePropertiesMode.GLOBAL, 0, ParticleAnimationSet.COLOR_PRIORITY); + super("ParticleSegmentedColor", GLOBAL, 0, ParticleAnimationSet.COLOR_PRIORITY); if (numSegmentPoint > 4) throw(new Error("the numSegmentPoint must be less or equal 4")); diff --git a/away3d/animators/nodes/ParticleSegmentedScaleNode.hx b/away3d/animators/nodes/ParticleSegmentedScaleNode.hx index a97e4654..d539c08b 100644 --- a/away3d/animators/nodes/ParticleSegmentedScaleNode.hx +++ b/away3d/animators/nodes/ParticleSegmentedScaleNode.hx @@ -35,7 +35,7 @@ class ParticleSegmentedScaleNode extends ParticleNodeBase _stateConstructor = cast ParticleSegmentedScaleState.new; //because of the stage3d register limitation, it only support the global mode - super("ParticleSegmentedScale", ParticlePropertiesMode.GLOBAL, 0, 3); + super("ParticleSegmentedScale", GLOBAL, 0, 3); _numSegmentPoint = numSegmentPoint; _startScale = startScale; diff --git a/away3d/animators/nodes/ParticleSpriteSheetNode.hx b/away3d/animators/nodes/ParticleSpriteSheetNode.hx index 64159461..75b8c950 100644 --- a/away3d/animators/nodes/ParticleSpriteSheetNode.hx +++ b/away3d/animators/nodes/ParticleSpriteSheetNode.hx @@ -88,7 +88,7 @@ class ParticleSpriteSheetNode extends ParticleNodeBase * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. */ - public function new(mode:Int, usesCycle:Bool, usesPhase:Bool, numColumns:Int = 1, numRows:Int = 1, cycleDuration:Float = 1, cyclePhase:Float = 0, totalFrames:Int = -1) + public function new(mode:ParticlePropertiesMode, usesCycle:Bool, usesPhase:Bool, numColumns:Int = 1, numRows:Int = 1, cycleDuration:Float = 1, cyclePhase:Float = 0, totalFrames:Int = -1) { //todo totalFrames = Math.POSITIVE_INFINITY; @@ -120,7 +120,7 @@ class ParticleSpriteSheetNode extends ParticleNodeBase { //get 2 vc var uvParamConst1:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - var uvParamConst2:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var uvParamConst2:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, UV_INDEX_0, uvParamConst1.index); animationRegisterCache.setRegisterIndex(this, UV_INDEX_1, uvParamConst2.index); diff --git a/away3d/animators/nodes/ParticleTimeNode.hx b/away3d/animators/nodes/ParticleTimeNode.hx index 770c598c..e52033e2 100644 --- a/away3d/animators/nodes/ParticleTimeNode.hx +++ b/away3d/animators/nodes/ParticleTimeNode.hx @@ -40,7 +40,7 @@ class ParticleTimeNode extends ParticleNodeBase _usesLooping = usesLooping; _usesDelay = usesDelay; - super("ParticleTime", ParticlePropertiesMode.LOCAL_STATIC, 4, 0); + super("ParticleTime", LOCAL_STATIC, 4, 0); } /** diff --git a/away3d/animators/nodes/ParticleUVNode.hx b/away3d/animators/nodes/ParticleUVNode.hx index 950861b4..a9c1bed1 100644 --- a/away3d/animators/nodes/ParticleUVNode.hx +++ b/away3d/animators/nodes/ParticleUVNode.hx @@ -51,7 +51,7 @@ class ParticleUVNode extends ParticleNodeBase * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. */ - public function new(mode:Int, cycle:Float = 1, scale:Float = 1, axis:String = "x") + public function new(mode:ParticlePropertiesMode, cycle:Float = 1, scale:Float = 1, axis:String = "x") { super("ParticleUV", mode, 4, ParticleAnimationSet.POST_PRIORITY + 1); diff --git a/away3d/animators/nodes/ParticleVelocityNode.hx b/away3d/animators/nodes/ParticleVelocityNode.hx index 2ddba050..a9f9c1ef 100644 --- a/away3d/animators/nodes/ParticleVelocityNode.hx +++ b/away3d/animators/nodes/ParticleVelocityNode.hx @@ -33,7 +33,7 @@ class ParticleVelocityNode extends ParticleNodeBase * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. */ - public function new(mode:Int, velocity:Vector3D = null) + public function new(mode:ParticlePropertiesMode, velocity:Vector3D = null) { super("ParticleVelocity", mode, 3); @@ -49,7 +49,7 @@ class ParticleVelocityNode extends ParticleNodeBase */ override public function getAGALVertexCode(pass:MaterialPassBase, animationRegisterCache:AnimationRegisterCache):String { - var velocityValue:ShaderRegisterElement = (_mode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var velocityValue:ShaderRegisterElement = (_mode == GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); animationRegisterCache.setRegisterIndex(this, VELOCITY_INDEX, velocityValue.index); var distance:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); diff --git a/away3d/animators/states/ParticleAccelerationState.hx b/away3d/animators/states/ParticleAccelerationState.hx index 5f335d49..53189eda 100644 --- a/away3d/animators/states/ParticleAccelerationState.hx +++ b/away3d/animators/states/ParticleAccelerationState.hx @@ -60,7 +60,7 @@ class ParticleAccelerationState extends ParticleStateBase var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleAccelerationNode.ACCELERATION_INDEX); - if (_particleAccelerationNode.mode == ParticlePropertiesMode.LOCAL_STATIC) + if (_particleAccelerationNode.mode == LOCAL_STATIC) animationSubGeometry.activateVertexBuffer(index, _particleAccelerationNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3); else animationRegisterCache.setVertexConst(index, _halfAcceleration.x, _halfAcceleration.y, _halfAcceleration.z); @@ -68,7 +68,7 @@ class ParticleAccelerationState extends ParticleStateBase private function updateAccelerationData():Void { - if (_particleAccelerationNode.mode == ParticlePropertiesMode.GLOBAL) + if (_particleAccelerationNode.mode == GLOBAL) _halfAcceleration = new Vector3D(_acceleration.x/2, _acceleration.y/2, _acceleration.z/2); } } \ No newline at end of file diff --git a/away3d/animators/states/ParticleBezierCurveState.hx b/away3d/animators/states/ParticleBezierCurveState.hx index 66afe7e3..6a1183c9 100644 --- a/away3d/animators/states/ParticleBezierCurveState.hx +++ b/away3d/animators/states/ParticleBezierCurveState.hx @@ -69,7 +69,7 @@ class ParticleBezierCurveState extends ParticleStateBase var controlIndex:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleBezierCurveNode.BEZIER_CONTROL_INDEX); var endIndex:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleBezierCurveNode.BEZIER_END_INDEX); - if (_particleBezierCurveNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleBezierCurveNode.mode == LOCAL_STATIC) { animationSubGeometry.activateVertexBuffer(controlIndex, _particleBezierCurveNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3); animationSubGeometry.activateVertexBuffer(endIndex, _particleBezierCurveNode.dataOffset + 3, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3); } else { diff --git a/away3d/animators/states/ParticleColorState.hx b/away3d/animators/states/ParticleColorState.hx index 21cff67c..5f998d56 100644 --- a/away3d/animators/states/ParticleColorState.hx +++ b/away3d/animators/states/ParticleColorState.hx @@ -129,7 +129,7 @@ class ParticleColorState extends ParticleStateBase animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(_animationNode, ParticleColorNode.CYCLE_INDEX), _cycleData.x, _cycleData.y, _cycleData.z, _cycleData.w); if (_usesMultiplier) { - if (_particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleColorNode.mode == LOCAL_STATIC) { animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(_animationNode, ParticleColorNode.START_MULTIPLIER_INDEX), dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); dataOffset += 4; animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(_animationNode, ParticleColorNode.DELTA_MULTIPLIER_INDEX), dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); @@ -140,7 +140,7 @@ class ParticleColorState extends ParticleStateBase } } if (_usesOffset) { - if (_particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleColorNode.mode == LOCAL_STATIC) { animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(_animationNode, ParticleColorNode.START_OFFSET_INDEX), dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); dataOffset += 4; animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(_animationNode, ParticleColorNode.DELTA_OFFSET_INDEX), dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); @@ -160,7 +160,7 @@ class ParticleColorState extends ParticleStateBase throw(new Error("the cycle duration must be greater than zero")); _cycleData = new Vector3D(Math.PI*2/_cycleDuration, _cyclePhase*Math.PI/180, 0, 0); } - if (_particleColorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleColorNode.mode == GLOBAL) { if (_usesCycle) { if (_usesMultiplier) { _startMultiplierData = new Vector3D((_startColor.redMultiplier + _endColor.redMultiplier)/2, (_startColor.greenMultiplier + _endColor.greenMultiplier)/2, (_startColor.blueMultiplier + _endColor.blueMultiplier)/2, (_startColor.alphaMultiplier + _endColor.alphaMultiplier)/2); diff --git a/away3d/animators/states/ParticleInitialColorState.hx b/away3d/animators/states/ParticleInitialColorState.hx index 4cf7e8fa..26ab29fc 100644 --- a/away3d/animators/states/ParticleInitialColorState.hx +++ b/away3d/animators/states/ParticleInitialColorState.hx @@ -58,7 +58,7 @@ class ParticleInitialColorState extends ParticleStateBase // TODO: not used if (animationRegisterCache.needFragmentAnimation) { - if (_particleInitialColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleInitialColorNode.mode == LOCAL_STATIC) { var dataOffset:Int = _particleInitialColorNode.dataOffset; if (_usesMultiplier) { animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(_animationNode, ParticleInitialColorNode.MULTIPLIER_INDEX), dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); @@ -77,7 +77,7 @@ class ParticleInitialColorState extends ParticleStateBase private function updateColorData():Void { - if (_particleInitialColorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleInitialColorNode.mode == GLOBAL) { if (_usesMultiplier) _multiplierData = new Vector3D(_initialColor.redMultiplier, _initialColor.greenMultiplier, _initialColor.blueMultiplier, _initialColor.alphaMultiplier); if (_usesOffset) diff --git a/away3d/animators/states/ParticleOrbitState.hx b/away3d/animators/states/ParticleOrbitState.hx index 98273db3..482f3612 100644 --- a/away3d/animators/states/ParticleOrbitState.hx +++ b/away3d/animators/states/ParticleOrbitState.hx @@ -118,7 +118,7 @@ class ParticleOrbitState extends ParticleStateBase { var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleOrbitNode.ORBIT_INDEX); - if (_particleOrbitNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleOrbitNode.mode == LOCAL_STATIC) { if (_usesPhase) animationSubGeometry.activateVertexBuffer(index, _particleOrbitNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); else @@ -138,7 +138,7 @@ class ParticleOrbitState extends ParticleStateBase _eulersMatrix.appendRotation(_eulers.y, Vector3D.Y_AXIS); _eulersMatrix.appendRotation(_eulers.z, Vector3D.Z_AXIS); } - if (_particleOrbitNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleOrbitNode.mode == GLOBAL) { _orbitData = new Vector3D(_radius, 0, _radius*Math.PI*2, _cyclePhase*Math.PI/180); if (_usesCycle) { if (_cycleDuration <= 0) diff --git a/away3d/animators/states/ParticleOscillatorState.hx b/away3d/animators/states/ParticleOscillatorState.hx index 0cd76452..15247362 100644 --- a/away3d/animators/states/ParticleOscillatorState.hx +++ b/away3d/animators/states/ParticleOscillatorState.hx @@ -57,7 +57,7 @@ class ParticleOscillatorState extends ParticleStateBase { var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleOscillatorNode.OSCILLATOR_INDEX); - if (_particleOscillatorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) + if (_particleOscillatorNode.mode == LOCAL_STATIC) animationSubGeometry.activateVertexBuffer(index, _particleOscillatorNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); else animationRegisterCache.setVertexConst(index, _oscillatorData.x, _oscillatorData.y, _oscillatorData.z, _oscillatorData.w); @@ -65,7 +65,7 @@ class ParticleOscillatorState extends ParticleStateBase private function updateOscillatorData():Void { - if (_particleOscillatorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleOscillatorNode.mode == GLOBAL) { if (_oscillator.w <= 0) throw(new Error("the cycle duration must greater than zero")); if (_oscillatorData == null) diff --git a/away3d/animators/states/ParticlePositionState.hx b/away3d/animators/states/ParticlePositionState.hx index 303df3bb..234ddeed 100644 --- a/away3d/animators/states/ParticlePositionState.hx +++ b/away3d/animators/states/ParticlePositionState.hx @@ -65,12 +65,12 @@ class ParticlePositionState extends ParticleStateBase */ override public function setRenderState(stage3DProxy:Stage3DProxy, renderable:IRenderable, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera3D):Void { - if (_particlePositionNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) + if (_particlePositionNode.mode == LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) updateDynamicProperties(animationSubGeometry); var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticlePositionNode.POSITION_INDEX); - if (_particlePositionNode.mode == ParticlePropertiesMode.GLOBAL) + if (_particlePositionNode.mode == GLOBAL) animationRegisterCache.setVertexConst(index, _position.x, _position.y, _position.z); else animationSubGeometry.activateVertexBuffer(index, _particlePositionNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3); diff --git a/away3d/animators/states/ParticleRotateToPositionState.hx b/away3d/animators/states/ParticleRotateToPositionState.hx index a4ff461b..4f16cab2 100644 --- a/away3d/animators/states/ParticleRotateToPositionState.hx +++ b/away3d/animators/states/ParticleRotateToPositionState.hx @@ -55,7 +55,7 @@ class ParticleRotateToPositionState extends ParticleStateBase animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(_animationNode, ParticleRotateToPositionNode.MATRIX_INDEX), _matrix); } - if (_particleRotateToPositionNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleRotateToPositionNode.mode == GLOBAL) { _offset = renderable.inverseSceneTransform.transformVector(_position); animationRegisterCache.setVertexConst(index, _offset.x, _offset.y, _offset.z); } else diff --git a/away3d/animators/states/ParticleRotationalVelocityState.hx b/away3d/animators/states/ParticleRotationalVelocityState.hx index 7fde49ed..b40b236f 100644 --- a/away3d/animators/states/ParticleRotationalVelocityState.hx +++ b/away3d/animators/states/ParticleRotationalVelocityState.hx @@ -73,12 +73,12 @@ class ParticleRotationalVelocityState extends ParticleStateBase { // TODO: not used - if (_particleRotationalVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) + if (_particleRotationalVelocityNode.mode == LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) updateDynamicProperties(animationSubGeometry); var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX); - if (_particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) + if (_particleRotationalVelocityNode.mode == GLOBAL) animationRegisterCache.setVertexConst(index, _rotationalVelocityData.x, _rotationalVelocityData.y, _rotationalVelocityData.z, _rotationalVelocityData.w); else animationSubGeometry.activateVertexBuffer(index, _particleRotationalVelocityNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); @@ -86,7 +86,7 @@ class ParticleRotationalVelocityState extends ParticleStateBase private function updateRotationalVelocityData():Void { - if (_particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleRotationalVelocityNode.mode == GLOBAL) { if (_rotationalVelocity.w <= 0) throw(new Error("the cycle duration must greater than zero")); var rotation:Vector3D = _rotationalVelocity.clone(); diff --git a/away3d/animators/states/ParticleScaleState.hx b/away3d/animators/states/ParticleScaleState.hx index 9feb9222..f072cb29 100644 --- a/away3d/animators/states/ParticleScaleState.hx +++ b/away3d/animators/states/ParticleScaleState.hx @@ -115,7 +115,7 @@ class ParticleScaleState extends ParticleStateBase { var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleScaleNode.SCALE_INDEX); - if (_particleScaleNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleScaleNode.mode == LOCAL_STATIC) { if (_usesCycle) { if (_usesPhase) animationSubGeometry.activateVertexBuffer(index, _particleScaleNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_4); @@ -129,7 +129,7 @@ class ParticleScaleState extends ParticleStateBase private function updateScaleData():Void { - if (_particleScaleNode.mode == ParticlePropertiesMode.GLOBAL) { + if (_particleScaleNode.mode == GLOBAL) { if (_usesCycle) { if (_cycleDuration <= 0) throw(new Error("the cycle duration must be greater than zero")); diff --git a/away3d/animators/states/ParticleSpriteSheetState.hx b/away3d/animators/states/ParticleSpriteSheetState.hx index 6e0a5d89..78fcad49 100644 --- a/away3d/animators/states/ParticleSpriteSheetState.hx +++ b/away3d/animators/states/ParticleSpriteSheetState.hx @@ -86,7 +86,7 @@ class ParticleSpriteSheetState extends ParticleStateBase animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(_animationNode, ParticleSpriteSheetNode.UV_INDEX_0), _spriteSheetData[0], _spriteSheetData[1], _spriteSheetData[2], _spriteSheetData[3]); if (_usesCycle) { var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleSpriteSheetNode.UV_INDEX_1); - if (_particleSpriteSheetNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (_particleSpriteSheetNode.mode == LOCAL_STATIC) { if (_usesPhase) animationSubGeometry.activateVertexBuffer(index, _particleSpriteSheetNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3); else diff --git a/away3d/animators/states/ParticleVelocityState.hx b/away3d/animators/states/ParticleVelocityState.hx index dfd27722..8330f465 100644 --- a/away3d/animators/states/ParticleVelocityState.hx +++ b/away3d/animators/states/ParticleVelocityState.hx @@ -62,12 +62,12 @@ class ParticleVelocityState extends ParticleStateBase override public function setRenderState(stage3DProxy:Stage3DProxy, renderable:IRenderable, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera3D):Void { - if (_particleVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) + if (_particleVelocityNode.mode == LOCAL_DYNAMIC && !_dynamicPropertiesDirty.exists(animationSubGeometry)) updateDynamicProperties(animationSubGeometry); var index:Int = animationRegisterCache.getRegisterIndex(_animationNode, ParticleVelocityNode.VELOCITY_INDEX); - if (_particleVelocityNode.mode == ParticlePropertiesMode.GLOBAL) + if (_particleVelocityNode.mode == GLOBAL) animationRegisterCache.setVertexConst(index, _velocity.x, _velocity.y, _velocity.z); else animationSubGeometry.activateVertexBuffer(index, _particleVelocityNode.dataOffset, stage3DProxy, Context3DVertexBufferFormat.FLOAT_3);