mirror of
https://github.com/MapMakersAndProgrammers/alternativa3d-archive.git
synced 2025-10-27 18:29:07 -07:00
more versions added
This commit is contained in:
39
Alternativa3D7/7.3.3/.actionScriptProperties
Normal file
39
Alternativa3D7/7.3.3/.actionScriptProperties
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actionScriptProperties mainApplicationPath="Engine3DLibrary.as" version="3">
|
||||
<compiler additionalCompilerArguments="-compute-digest=false" copyDependentFiles="false" enableModuleDebug="false" flexSDK="Flex 4.0" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="10.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
|
||||
<compilerSourcePath/>
|
||||
<libraryPath defaultLinkType="1">
|
||||
<libraryPathEntry kind="4" path="">
|
||||
<excludedEntries>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_conversion.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/player/{targetPlayerMajorVersion}" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_importExport.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_edit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_edit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="2" path="${PROJECT_FRAMEWORKS}/libs/utilities.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework_textLayout.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_core.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_textField.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex4.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_model.swc" useDefaultLinkType="false"/>
|
||||
</excludedEntries>
|
||||
</libraryPathEntry>
|
||||
</libraryPath>
|
||||
<sourceAttachmentPath/>
|
||||
</compiler>
|
||||
<applications>
|
||||
<application path="Engine3DLibrary.as"/>
|
||||
</applications>
|
||||
<modules/>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
||||
88
Alternativa3D7/7.3.3/.flexLibProperties
Normal file
88
Alternativa3D7/7.3.3/.flexLibProperties
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flexLibProperties version="1">
|
||||
<includeClasses>
|
||||
<classEntry path="alternativa.Alternativa3D"/>
|
||||
<classEntry path="alternativa.engine3d.alternativa3d"/>
|
||||
<classEntry path="alternativa.engine3d.animation.Animation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationController"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationState"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationTimer"/>
|
||||
<classEntry path="alternativa.engine3d.animation.MatrixAnimation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.Track"/>
|
||||
<classEntry path="alternativa.engine3d.animation.TransformAnimation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.Key"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.MatrixKey"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.PointKey"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.ValueKey"/>
|
||||
<classEntry path="alternativa.engine3d.containers.ConflictContainer"/>
|
||||
<classEntry path="alternativa.engine3d.containers.KDTree"/>
|
||||
<classEntry path="alternativa.engine3d.containers.ZSortContainer"/>
|
||||
<classEntry path="alternativa.engine3d.controllers.SimpleObjectController"/>
|
||||
<classEntry path="alternativa.engine3d.core.Camera3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Canvas"/>
|
||||
<classEntry path="alternativa.engine3d.core.Clipping"/>
|
||||
<classEntry path="alternativa.engine3d.core.Debug"/>
|
||||
<classEntry path="alternativa.engine3d.core.Face"/>
|
||||
<classEntry path="alternativa.engine3d.core.Geometry"/>
|
||||
<classEntry path="alternativa.engine3d.core.KDNode"/>
|
||||
<classEntry path="alternativa.engine3d.core.MipMapping"/>
|
||||
<classEntry path="alternativa.engine3d.core.MouseEvent3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Object3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Object3DContainer"/>
|
||||
<classEntry path="alternativa.engine3d.core.Sorting"/>
|
||||
<classEntry path="alternativa.engine3d.core.Vertex"/>
|
||||
<classEntry path="alternativa.engine3d.core.View"/>
|
||||
<classEntry path="alternativa.engine3d.core.Wrapper"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.MaterialLoader"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.Parser3DS"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.ParserCollada"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeAlternativa3DObject"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeAnimatedObject"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeArray"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeCamera"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeChannel"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeController"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeDocument"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeEffect"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeEffectParam"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeElement"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeGeometry"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeImage"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInput"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInstanceController"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInstanceMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeLogger"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeNode"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeParam"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaePrimitive"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeSampler"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeSource"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeVertices"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeVisualScene"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.collada"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderErrorEvent"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderEvent"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderProgressEvent"/>
|
||||
<classEntry path="alternativa.engine3d.materials.FillMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.materials.Material"/>
|
||||
<classEntry path="alternativa.engine3d.materials.TextureMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.objects.AnimSprite"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Axes"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Bone"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Joint"/>
|
||||
<classEntry path="alternativa.engine3d.objects.LOD"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Mesh"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Occluder"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Reference"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Skin"/>
|
||||
<classEntry path="alternativa.engine3d.objects.SkyBox"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Sprite3D"/>
|
||||
<classEntry path="alternativa.engine3d.objects.VertexBinding"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.Box"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.GeoSphere"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.Plane"/>
|
||||
</includeClasses>
|
||||
<includeResources/>
|
||||
<namespaceManifests/>
|
||||
</flexLibProperties>
|
||||
21
Alternativa3D7/7.3.3/.project
Normal file
21
Alternativa3D7/7.3.3/.project
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Alternativa3D</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.adobe.flexbuilder.project.flexbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
29
Alternativa3D7/7.3.3/.settings/.svn/all-wcprops
Normal file
29
Alternativa3D7/7.3.3/.settings/.svn/all-wcprops
Normal file
@@ -0,0 +1,29 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 82
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings
|
||||
END
|
||||
com.powerflasher.fdt.core.prefs
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings/com.powerflasher.fdt.core.prefs
|
||||
END
|
||||
com.powerflasher.fdt.core.formatter.prefs
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 124
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings/com.powerflasher.fdt.core.formatter.prefs
|
||||
END
|
||||
org.eclipse.core.resources.prefs
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 115
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings/org.eclipse.core.resources.prefs
|
||||
END
|
||||
org.eclipse.ltk.core.refactoring.prefs
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 121
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings/org.eclipse.ltk.core.refactoring.prefs
|
||||
END
|
||||
76
Alternativa3D7/7.3.3/.settings/.svn/entries
Normal file
76
Alternativa3D7/7.3.3/.settings/.svn/entries
Normal file
@@ -0,0 +1,76 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.settings
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-03-01T13:54:50.227244Z
|
||||
29044
|
||||
int
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
com.powerflasher.fdt.core.prefs
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
d559c44f37dfdaf69e7dccba7d10b834
|
||||
2010-03-01T13:54:50.227244Z
|
||||
29044
|
||||
int
|
||||
|
||||
com.powerflasher.fdt.core.formatter.prefs
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
d729ae182414a84ebd06b4936bd8d5a8
|
||||
2010-03-01T13:54:50.227244Z
|
||||
29044
|
||||
int
|
||||
|
||||
org.eclipse.core.resources.prefs
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
63644c8a8f9fe441148cb750eb3dc2f3
|
||||
2008-08-25T13:44:47.077292Z
|
||||
176
|
||||
int
|
||||
|
||||
org.eclipse.ltk.core.refactoring.prefs
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
85719ffc1d818e46b40e2f90aad31e8c
|
||||
2008-08-25T13:44:47.077292Z
|
||||
176
|
||||
int
|
||||
|
||||
1
Alternativa3D7/7.3.3/.settings/.svn/format
Normal file
1
Alternativa3D7/7.3.3/.settings/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,83 @@
|
||||
#Fri Feb 12 14:04:16 YEKT 2010
|
||||
BlankLines.BeforeFirstMember=0
|
||||
BlankLines.BeforePackage=0
|
||||
BlankLines.BeforeTypeInPackage=1
|
||||
BlankLines.BeforeTypeOutsidePackage=1
|
||||
BlankLines.BetweenFields=0
|
||||
BlankLines.BetweenFunctions=1
|
||||
BlankLines.BetweenMembergrous=1
|
||||
BlankLines.EatBlankLines=false
|
||||
Braces.Catch=false
|
||||
Braces.DoWhile=false
|
||||
Braces.Else=false
|
||||
Braces.Finally=false
|
||||
Braces.For=false
|
||||
Braces.Function=false
|
||||
Braces.Getter=false
|
||||
Braces.If=false
|
||||
Braces.Method=false
|
||||
Braces.ObjectInitialiser=false
|
||||
Braces.Package=false
|
||||
Braces.Setter=false
|
||||
Braces.Switch=false
|
||||
Braces.Try=false
|
||||
Braces.Type=false
|
||||
Braces.While=false
|
||||
Braces.With=false
|
||||
Indentation.Case=true
|
||||
Indentation.Catch=true
|
||||
Indentation.DoWhile=true
|
||||
Indentation.Else=true
|
||||
Indentation.Finally=true
|
||||
Indentation.For=true
|
||||
Indentation.Functions=true
|
||||
Indentation.Getters=true
|
||||
Indentation.If=true
|
||||
Indentation.Methods=true
|
||||
Indentation.Package=true
|
||||
Indentation.Setters=true
|
||||
Indentation.SpacesPerTab=4
|
||||
Indentation.Switch=true
|
||||
Indentation.Try=true
|
||||
Indentation.Types=true
|
||||
Indentation.UseSpaces=false
|
||||
Indentation.UseTabs=true
|
||||
Indentation.While=true
|
||||
WhiteSpace.BlankAfterAdditiveOperator=true
|
||||
WhiteSpace.BlankAfterArgumentComma=true
|
||||
WhiteSpace.BlankAfterArgumentList=false
|
||||
WhiteSpace.BlankAfterArrayInitialiser=false
|
||||
WhiteSpace.BlankAfterAssign=true
|
||||
WhiteSpace.BlankAfterBinaryOperator=true
|
||||
WhiteSpace.BlankAfterCommaInArrayInit=true
|
||||
WhiteSpace.BlankAfterCommaInObjectInit=true
|
||||
WhiteSpace.BlankAfterConditionalColon=true
|
||||
WhiteSpace.BlankAfterConditionalHook=true
|
||||
WhiteSpace.BlankAfterConditionalOperator=true
|
||||
WhiteSpace.BlankAfterEquality=true
|
||||
WhiteSpace.BlankAfterFunctionName=false
|
||||
WhiteSpace.BlankAfterMultiplicativeOperator=true
|
||||
WhiteSpace.BlankAfterPrefixOperator=false
|
||||
WhiteSpace.BlankAfterRelationalOperator=true
|
||||
WhiteSpace.BlankAfterShiftOperator=true
|
||||
WhiteSpace.BlankAfterVaraiableTypeColon=true
|
||||
WhiteSpace.BlankAfterVariableInitialiser=true
|
||||
WhiteSpace.BlankBeforeAdditiveOperator=true
|
||||
WhiteSpace.BlankBeforeArgumentComma=false
|
||||
WhiteSpace.BlankBeforeArgumentList=false
|
||||
WhiteSpace.BlankBeforeArrayInitialiser=false
|
||||
WhiteSpace.BlankBeforeAssign=true
|
||||
WhiteSpace.BlankBeforeBinaryOperator=true
|
||||
WhiteSpace.BlankBeforeCommaInArrayInit=false
|
||||
WhiteSpace.BlankBeforeCommaInObjectInit=false
|
||||
WhiteSpace.BlankBeforeConditionalColon=true
|
||||
WhiteSpace.BlankBeforeConditionalHook=true
|
||||
WhiteSpace.BlankBeforeConditionalOperator=true
|
||||
WhiteSpace.BlankBeforeEquality=true
|
||||
WhiteSpace.BlankBeforeMultiplicativeOperator=true
|
||||
WhiteSpace.BlankBeforePostfixOperator=false
|
||||
WhiteSpace.BlankBeforeRelationalOperator=true
|
||||
WhiteSpace.BlankBeforeShiftOperator=true
|
||||
WhiteSpace.BlankBeforeVaraiableTypeColon=true
|
||||
WhiteSpace.BlankBeforeVariableInitialiser=true
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,7 @@
|
||||
#Tue Feb 16 17:42:22 YEKT 2010
|
||||
com.powerflasher.fdt.core.DefaultOutputFolder=bin
|
||||
com.powerflasher.fdt.core.Language=AS3
|
||||
com.powerflasher.fdt.core.LanguageType=Flex_3_SDK_0_for_FP_10
|
||||
com.powerflasher.fdt.core.useProjectFormatterSettings=false
|
||||
com.powerflasher.fdt.core.useProjectProblems=false
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,3 @@
|
||||
#Thu Feb 14 09:12:30 YEKT 2008
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,3 @@
|
||||
#Tue Nov 13 17:53:36 YEKT 2007
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
||||
@@ -0,0 +1,83 @@
|
||||
#Fri Feb 12 14:04:16 YEKT 2010
|
||||
BlankLines.BeforeFirstMember=0
|
||||
BlankLines.BeforePackage=0
|
||||
BlankLines.BeforeTypeInPackage=1
|
||||
BlankLines.BeforeTypeOutsidePackage=1
|
||||
BlankLines.BetweenFields=0
|
||||
BlankLines.BetweenFunctions=1
|
||||
BlankLines.BetweenMembergrous=1
|
||||
BlankLines.EatBlankLines=false
|
||||
Braces.Catch=false
|
||||
Braces.DoWhile=false
|
||||
Braces.Else=false
|
||||
Braces.Finally=false
|
||||
Braces.For=false
|
||||
Braces.Function=false
|
||||
Braces.Getter=false
|
||||
Braces.If=false
|
||||
Braces.Method=false
|
||||
Braces.ObjectInitialiser=false
|
||||
Braces.Package=false
|
||||
Braces.Setter=false
|
||||
Braces.Switch=false
|
||||
Braces.Try=false
|
||||
Braces.Type=false
|
||||
Braces.While=false
|
||||
Braces.With=false
|
||||
Indentation.Case=true
|
||||
Indentation.Catch=true
|
||||
Indentation.DoWhile=true
|
||||
Indentation.Else=true
|
||||
Indentation.Finally=true
|
||||
Indentation.For=true
|
||||
Indentation.Functions=true
|
||||
Indentation.Getters=true
|
||||
Indentation.If=true
|
||||
Indentation.Methods=true
|
||||
Indentation.Package=true
|
||||
Indentation.Setters=true
|
||||
Indentation.SpacesPerTab=4
|
||||
Indentation.Switch=true
|
||||
Indentation.Try=true
|
||||
Indentation.Types=true
|
||||
Indentation.UseSpaces=false
|
||||
Indentation.UseTabs=true
|
||||
Indentation.While=true
|
||||
WhiteSpace.BlankAfterAdditiveOperator=true
|
||||
WhiteSpace.BlankAfterArgumentComma=true
|
||||
WhiteSpace.BlankAfterArgumentList=false
|
||||
WhiteSpace.BlankAfterArrayInitialiser=false
|
||||
WhiteSpace.BlankAfterAssign=true
|
||||
WhiteSpace.BlankAfterBinaryOperator=true
|
||||
WhiteSpace.BlankAfterCommaInArrayInit=true
|
||||
WhiteSpace.BlankAfterCommaInObjectInit=true
|
||||
WhiteSpace.BlankAfterConditionalColon=true
|
||||
WhiteSpace.BlankAfterConditionalHook=true
|
||||
WhiteSpace.BlankAfterConditionalOperator=true
|
||||
WhiteSpace.BlankAfterEquality=true
|
||||
WhiteSpace.BlankAfterFunctionName=false
|
||||
WhiteSpace.BlankAfterMultiplicativeOperator=true
|
||||
WhiteSpace.BlankAfterPrefixOperator=false
|
||||
WhiteSpace.BlankAfterRelationalOperator=true
|
||||
WhiteSpace.BlankAfterShiftOperator=true
|
||||
WhiteSpace.BlankAfterVaraiableTypeColon=true
|
||||
WhiteSpace.BlankAfterVariableInitialiser=true
|
||||
WhiteSpace.BlankBeforeAdditiveOperator=true
|
||||
WhiteSpace.BlankBeforeArgumentComma=false
|
||||
WhiteSpace.BlankBeforeArgumentList=false
|
||||
WhiteSpace.BlankBeforeArrayInitialiser=false
|
||||
WhiteSpace.BlankBeforeAssign=true
|
||||
WhiteSpace.BlankBeforeBinaryOperator=true
|
||||
WhiteSpace.BlankBeforeCommaInArrayInit=false
|
||||
WhiteSpace.BlankBeforeCommaInObjectInit=false
|
||||
WhiteSpace.BlankBeforeConditionalColon=true
|
||||
WhiteSpace.BlankBeforeConditionalHook=true
|
||||
WhiteSpace.BlankBeforeConditionalOperator=true
|
||||
WhiteSpace.BlankBeforeEquality=true
|
||||
WhiteSpace.BlankBeforeMultiplicativeOperator=true
|
||||
WhiteSpace.BlankBeforePostfixOperator=false
|
||||
WhiteSpace.BlankBeforeRelationalOperator=true
|
||||
WhiteSpace.BlankBeforeShiftOperator=true
|
||||
WhiteSpace.BlankBeforeVaraiableTypeColon=true
|
||||
WhiteSpace.BlankBeforeVariableInitialiser=true
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,7 @@
|
||||
#Tue Feb 16 17:42:22 YEKT 2010
|
||||
com.powerflasher.fdt.core.DefaultOutputFolder=bin
|
||||
com.powerflasher.fdt.core.Language=AS3
|
||||
com.powerflasher.fdt.core.LanguageType=Flex_3_SDK_0_for_FP_10
|
||||
com.powerflasher.fdt.core.useProjectFormatterSettings=false
|
||||
com.powerflasher.fdt.core.useProjectProblems=false
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,3 @@
|
||||
#Thu Feb 14 09:12:30 YEKT 2008
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,3 @@
|
||||
#Tue Nov 13 17:53:36 YEKT 2007
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
||||
35
Alternativa3D7/7.3.3/.svn/all-wcprops
Normal file
35
Alternativa3D7/7.3.3/.svn/all-wcprops
Normal file
@@ -0,0 +1,35 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 72
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3
|
||||
END
|
||||
.flexLibProperties
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 91
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.flexLibProperties
|
||||
END
|
||||
Alternativa3D.iml
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 90
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/Alternativa3D.iml
|
||||
END
|
||||
.project
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 81
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.project
|
||||
END
|
||||
pom.xml
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 80
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/pom.xml
|
||||
END
|
||||
.actionScriptProperties
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 96
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/.actionScriptProperties
|
||||
END
|
||||
18
Alternativa3D7/7.3.3/.svn/dir-prop-base
Normal file
18
Alternativa3D7/7.3.3/.svn/dir-prop-base
Normal file
@@ -0,0 +1,18 @@
|
||||
K 10
|
||||
svn:ignore
|
||||
V 48
|
||||
help
|
||||
Alternativa3D API Documentation.launch
|
||||
bin
|
||||
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 574
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk:304-494,1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
97
Alternativa3D7/7.3.3/.svn/entries
Normal file
97
Alternativa3D7/7.3.3/.svn/entries
Normal file
@@ -0,0 +1,97 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-27T09:31:28.882837Z
|
||||
34871
|
||||
int
|
||||
has-props
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
META-INF
|
||||
dir
|
||||
|
||||
.flexLibProperties
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
a6322cfd1ad47a8b133b554b01dcfac1
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
Alternativa3D.iml
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
4e296d63ef5669f574fa2a35c17b863f
|
||||
2010-05-12T11:15:45.207653Z
|
||||
34220
|
||||
mike
|
||||
|
||||
.project
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
8cbcea651617654095d5a5cbf2f30c5b
|
||||
2010-03-25T10:19:33.395258Z
|
||||
30346
|
||||
int
|
||||
|
||||
src
|
||||
dir
|
||||
|
||||
pom.xml
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
8fe51578cdaf5265bf6a1b203edd95bd
|
||||
2010-05-12T11:18:15.538273Z
|
||||
34228
|
||||
mike
|
||||
|
||||
.actionScriptProperties
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
2efe5bc6856279ba6321b1680ae68453
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
.settings
|
||||
dir
|
||||
|
||||
1
Alternativa3D7/7.3.3/.svn/format
Normal file
1
Alternativa3D7/7.3.3/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actionScriptProperties mainApplicationPath="Engine3DLibrary.as" version="3">
|
||||
<compiler additionalCompilerArguments="-compute-digest=false" copyDependentFiles="false" enableModuleDebug="false" flexSDK="Flex 4.0" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="10.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
|
||||
<compilerSourcePath/>
|
||||
<libraryPath defaultLinkType="1">
|
||||
<libraryPathEntry kind="4" path="">
|
||||
<excludedEntries>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_conversion.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/player/{targetPlayerMajorVersion}" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_importExport.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_edit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_edit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="2" path="${PROJECT_FRAMEWORKS}/libs/utilities.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework_textLayout.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_core.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/textLayout_textField.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex4.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/text_model.swc" useDefaultLinkType="false"/>
|
||||
</excludedEntries>
|
||||
</libraryPathEntry>
|
||||
</libraryPath>
|
||||
<sourceAttachmentPath/>
|
||||
</compiler>
|
||||
<applications>
|
||||
<application path="Engine3DLibrary.as"/>
|
||||
</applications>
|
||||
<modules/>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flexLibProperties version="1">
|
||||
<includeClasses>
|
||||
<classEntry path="alternativa.Alternativa3D"/>
|
||||
<classEntry path="alternativa.engine3d.alternativa3d"/>
|
||||
<classEntry path="alternativa.engine3d.animation.Animation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationController"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationState"/>
|
||||
<classEntry path="alternativa.engine3d.animation.AnimationTimer"/>
|
||||
<classEntry path="alternativa.engine3d.animation.MatrixAnimation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.Track"/>
|
||||
<classEntry path="alternativa.engine3d.animation.TransformAnimation"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.Key"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.MatrixKey"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.PointKey"/>
|
||||
<classEntry path="alternativa.engine3d.animation.keys.ValueKey"/>
|
||||
<classEntry path="alternativa.engine3d.containers.ConflictContainer"/>
|
||||
<classEntry path="alternativa.engine3d.containers.KDTree"/>
|
||||
<classEntry path="alternativa.engine3d.containers.ZSortContainer"/>
|
||||
<classEntry path="alternativa.engine3d.controllers.SimpleObjectController"/>
|
||||
<classEntry path="alternativa.engine3d.core.Camera3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Canvas"/>
|
||||
<classEntry path="alternativa.engine3d.core.Clipping"/>
|
||||
<classEntry path="alternativa.engine3d.core.Debug"/>
|
||||
<classEntry path="alternativa.engine3d.core.Face"/>
|
||||
<classEntry path="alternativa.engine3d.core.Geometry"/>
|
||||
<classEntry path="alternativa.engine3d.core.KDNode"/>
|
||||
<classEntry path="alternativa.engine3d.core.MipMapping"/>
|
||||
<classEntry path="alternativa.engine3d.core.MouseEvent3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Object3D"/>
|
||||
<classEntry path="alternativa.engine3d.core.Object3DContainer"/>
|
||||
<classEntry path="alternativa.engine3d.core.Sorting"/>
|
||||
<classEntry path="alternativa.engine3d.core.Vertex"/>
|
||||
<classEntry path="alternativa.engine3d.core.View"/>
|
||||
<classEntry path="alternativa.engine3d.core.Wrapper"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.MaterialLoader"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.Parser3DS"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.ParserCollada"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeAlternativa3DObject"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeAnimatedObject"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeArray"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeCamera"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeChannel"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeController"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeDocument"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeEffect"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeEffectParam"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeElement"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeGeometry"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeImage"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInput"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInstanceController"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeInstanceMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeLogger"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeNode"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeParam"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaePrimitive"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeSampler"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeSource"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeVertices"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.DaeVisualScene"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.collada.collada"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderErrorEvent"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderEvent"/>
|
||||
<classEntry path="alternativa.engine3d.loaders.events.LoaderProgressEvent"/>
|
||||
<classEntry path="alternativa.engine3d.materials.FillMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.materials.Material"/>
|
||||
<classEntry path="alternativa.engine3d.materials.TextureMaterial"/>
|
||||
<classEntry path="alternativa.engine3d.objects.AnimSprite"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Axes"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Bone"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Joint"/>
|
||||
<classEntry path="alternativa.engine3d.objects.LOD"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Mesh"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Occluder"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Reference"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Skin"/>
|
||||
<classEntry path="alternativa.engine3d.objects.SkyBox"/>
|
||||
<classEntry path="alternativa.engine3d.objects.Sprite3D"/>
|
||||
<classEntry path="alternativa.engine3d.objects.VertexBinding"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.Box"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.GeoSphere"/>
|
||||
<classEntry path="alternativa.engine3d.primitives.Plane"/>
|
||||
</includeClasses>
|
||||
<includeResources/>
|
||||
<namespaceManifests/>
|
||||
</flexLibProperties>
|
||||
21
Alternativa3D7/7.3.3/.svn/text-base/.project.svn-base
Normal file
21
Alternativa3D7/7.3.3/.svn/text-base/.project.svn-base
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Alternativa3D</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.adobe.flexbuilder.project.flexbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
103
Alternativa3D7/7.3.3/.svn/text-base/Alternativa3D.iml.svn-base
Normal file
103
Alternativa3D7/7.3.3/.svn/text-base/Alternativa3D.iml.svn-base
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="flex" name="Flex">
|
||||
<configuration flex_sdk="flex_sdk_4 (player 10)">
|
||||
<option name="DO_BUILD" value="true" />
|
||||
<option name="OUTPUT_TYPE" value="Library" />
|
||||
<option name="USE_DEFAULT_SDK_CONFIG_FILE" value="true" />
|
||||
<option name="USE_CUSTOM_CONFIG_FILE" value="false" />
|
||||
<option name="CUSTOM_CONFIG_FILE" value="" />
|
||||
<option name="USE_CUSTOM_CONFIG_FILE_FOR_TESTS" value="false" />
|
||||
<option name="CUSTOM_CONFIG_FILE_FOR_TESTS" value="" />
|
||||
<option name="APPLICATION_ENTRY_POINT" value="" />
|
||||
<option name="MAIN_CLASS" value="" />
|
||||
<option name="OUTPUT_FILE_NAME" value="Alternativa3D-2.7.3.0-SNAPSHOT.swc" />
|
||||
<option name="USE_FACET_COMPILE_OUTPUT_PATH" value="true" />
|
||||
<option name="FACET_COMPILE_OUTPUT_PATH" value="$MODULE_DIR$/target" />
|
||||
<option name="INCLUDE_RESOURCE_FILES_IN_SWC" value="false" />
|
||||
<option name="TARGET_PLAYER_VERSION" value="10.0.0" />
|
||||
<option name="STATIC_LINK_RUNTIME_SHARED_LIBRARIES" value="false" />
|
||||
<option name="USE_LOCALE_SETTINGS" value="false" />
|
||||
<option name="LOCALE" value="en_US" />
|
||||
<option name="ADDITIONAL_COMPILER_OPTIONS" value="" />
|
||||
<option name="VERSION" value="3" />
|
||||
<option name="PATH_TO_SERVICES_CONFIG_XML" value="" />
|
||||
<option name="CONTEXT_ROOT" value="" />
|
||||
<NAMESPACE_AND_MANIFEST_FILE_INFO_LIST />
|
||||
<CONDITIONAL_COMPILATION_DEFINITION_LIST />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/platform" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="flex_sdk_4 (player 10)" jdkType="Flex SDK Type" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="AUTOGENERATED library equal to Flex SDK flex_sdk_4 (player 10)">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/player/10/playerglobal.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_core.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_edit.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_conversion.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/framework_textLayout.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/flex4.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/flex.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_textField.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/rpc.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/utilities.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/framework.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/rpc_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/flex4_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/framework_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/airframework_rb.swc!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/air/ServiceMonitor/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/air/ApplicationUpdater/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/utilities/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/airframework/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/wireframe/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/flex4/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/framework_textLayout/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/haloclassic/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/framework/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/rpc/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/flex/src" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: platform.clients.fp10.libraries:AlternativaOSGi:swc:2.0.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:playerglobal:swc:10-4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_conversion:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_core:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:flex4:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:framework:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:applicationupdater:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:applicationupdater_ui:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_edit:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:flex:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:utilities:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:rpc:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:rpc:rb.swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:framework:rb.swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.wagon:wagon-webdav:1.0-beta-2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: slide:slide-webdavlib:2.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-httpclient:commons-httpclient:2.0.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: jdom:jdom:1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: de.zeigermann.xml:xml-im-exporter:1.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.codehaus.plexus:plexus-utils:1.0.4" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
33
Alternativa3D7/7.3.3/.svn/text-base/pom.xml.svn-base
Normal file
33
Alternativa3D7/7.3.3/.svn/text-base/pom.xml.svn-base
Normal file
@@ -0,0 +1,33 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>Alternativa3D</artifactId>
|
||||
<packaging>swc</packaging>
|
||||
<version>2.7.3.1-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>platform.clients.fp10.tools.maven</groupId>
|
||||
<artifactId>BasePom</artifactId>
|
||||
<version>2.0.6.0</version>
|
||||
</parent>
|
||||
<scm>
|
||||
<connection>scm:svn:http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/trunk</connection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>AlternativaOSGi</artifactId>
|
||||
<type>swc</type>
|
||||
<scope>external</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>AlternativaOSGi</artifactId>
|
||||
<type>swc</type>
|
||||
<version>2.0.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
103
Alternativa3D7/7.3.3/Alternativa3D.iml
Normal file
103
Alternativa3D7/7.3.3/Alternativa3D.iml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="flex" name="Flex">
|
||||
<configuration flex_sdk="flex_sdk_4 (player 10)">
|
||||
<option name="DO_BUILD" value="true" />
|
||||
<option name="OUTPUT_TYPE" value="Library" />
|
||||
<option name="USE_DEFAULT_SDK_CONFIG_FILE" value="true" />
|
||||
<option name="USE_CUSTOM_CONFIG_FILE" value="false" />
|
||||
<option name="CUSTOM_CONFIG_FILE" value="" />
|
||||
<option name="USE_CUSTOM_CONFIG_FILE_FOR_TESTS" value="false" />
|
||||
<option name="CUSTOM_CONFIG_FILE_FOR_TESTS" value="" />
|
||||
<option name="APPLICATION_ENTRY_POINT" value="" />
|
||||
<option name="MAIN_CLASS" value="" />
|
||||
<option name="OUTPUT_FILE_NAME" value="Alternativa3D-2.7.3.0-SNAPSHOT.swc" />
|
||||
<option name="USE_FACET_COMPILE_OUTPUT_PATH" value="true" />
|
||||
<option name="FACET_COMPILE_OUTPUT_PATH" value="$MODULE_DIR$/target" />
|
||||
<option name="INCLUDE_RESOURCE_FILES_IN_SWC" value="false" />
|
||||
<option name="TARGET_PLAYER_VERSION" value="10.0.0" />
|
||||
<option name="STATIC_LINK_RUNTIME_SHARED_LIBRARIES" value="false" />
|
||||
<option name="USE_LOCALE_SETTINGS" value="false" />
|
||||
<option name="LOCALE" value="en_US" />
|
||||
<option name="ADDITIONAL_COMPILER_OPTIONS" value="" />
|
||||
<option name="VERSION" value="3" />
|
||||
<option name="PATH_TO_SERVICES_CONFIG_XML" value="" />
|
||||
<option name="CONTEXT_ROOT" value="" />
|
||||
<NAMESPACE_AND_MANIFEST_FILE_INFO_LIST />
|
||||
<CONDITIONAL_COMPILATION_DEFINITION_LIST />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/platform" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="flex_sdk_4 (player 10)" jdkType="Flex SDK Type" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="AUTOGENERATED library equal to Flex SDK flex_sdk_4 (player 10)">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/player/10/playerglobal.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_core.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_edit.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_conversion.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/framework_textLayout.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/flex4.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/flex.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/textLayout_textField.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/rpc.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/utilities.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/libs/framework.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/rpc_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/flex4_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/framework_rb.swc!/" />
|
||||
<root url="jar://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/locale/en_US/airframework_rb.swc!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/air/ServiceMonitor/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/air/ApplicationUpdater/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/utilities/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/airframework/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/wireframe/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/flex4/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/framework_textLayout/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/haloclassic/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/framework/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/rpc/src" />
|
||||
<root url="file://$MODULE_DIR$/../../../opt/flex_sdk_4/frameworks/projects/flex/src" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: platform.clients.fp10.libraries:AlternativaOSGi:swc:2.0.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:playerglobal:swc:10-4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_conversion:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_core:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:flex4:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:framework:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:applicationupdater:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:applicationupdater_ui:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:textLayout_edit:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:flex:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:utilities:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:rpc:swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:rpc:rb.swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" exported="" name="Maven: com.adobe.flex.framework:framework:rb.swc:4.0.0.4021" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.wagon:wagon-webdav:1.0-beta-2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: slide:slide-webdavlib:2.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-httpclient:commons-httpclient:2.0.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: jdom:jdom:1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: de.zeigermann.xml:xml-im-exporter:1.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.codehaus.plexus:plexus-utils:1.0.4" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
11
Alternativa3D7/7.3.3/META-INF/.svn/all-wcprops
Normal file
11
Alternativa3D7/7.3.3/META-INF/.svn/all-wcprops
Normal file
@@ -0,0 +1,11 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 81
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/META-INF
|
||||
END
|
||||
MANIFEST.MF
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 93
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/META-INF/MANIFEST.MF
|
||||
END
|
||||
40
Alternativa3D7/7.3.3/META-INF/.svn/entries
Normal file
40
Alternativa3D7/7.3.3/META-INF/.svn/entries
Normal file
@@ -0,0 +1,40 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/META-INF
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2009-03-04T09:09:17.957056Z
|
||||
8649
|
||||
mike
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
MANIFEST.MF
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
0069b2b9a3b474d1d94113e9d6731290
|
||||
2009-03-04T09:09:17.957056Z
|
||||
8649
|
||||
mike
|
||||
|
||||
1
Alternativa3D7/7.3.3/META-INF/.svn/format
Normal file
1
Alternativa3D7/7.3.3/META-INF/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1 @@
|
||||
Bundle-Name: platform.clients.fp10.libraries.Alternativa3D
|
||||
1
Alternativa3D7/7.3.3/META-INF/MANIFEST.MF
Normal file
1
Alternativa3D7/7.3.3/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1 @@
|
||||
Bundle-Name: platform.clients.fp10.libraries.Alternativa3D
|
||||
33
Alternativa3D7/7.3.3/pom.xml
Normal file
33
Alternativa3D7/7.3.3/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>Alternativa3D</artifactId>
|
||||
<packaging>swc</packaging>
|
||||
<version>2.7.3.1-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>platform.clients.fp10.tools.maven</groupId>
|
||||
<artifactId>BasePom</artifactId>
|
||||
<version>2.0.6.0</version>
|
||||
</parent>
|
||||
<scm>
|
||||
<connection>scm:svn:http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/trunk</connection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>AlternativaOSGi</artifactId>
|
||||
<type>swc</type>
|
||||
<scope>external</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>platform.clients.fp10.libraries</groupId>
|
||||
<artifactId>AlternativaOSGi</artifactId>
|
||||
<type>swc</type>
|
||||
<version>2.0.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
11
Alternativa3D7/7.3.3/src/.svn/all-wcprops
Normal file
11
Alternativa3D7/7.3.3/src/.svn/all-wcprops
Normal file
@@ -0,0 +1,11 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 76
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src
|
||||
END
|
||||
manifest.xml
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 89
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/manifest.xml
|
||||
END
|
||||
43
Alternativa3D7/7.3.3/src/.svn/entries
Normal file
43
Alternativa3D7/7.3.3/src/.svn/entries
Normal file
@@ -0,0 +1,43 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
manifest.xml
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
2e2b1aa9d128d192e5f544209f610433
|
||||
2009-06-25T13:27:32.420515Z
|
||||
15144
|
||||
int
|
||||
|
||||
alternativa
|
||||
dir
|
||||
|
||||
1
Alternativa3D7/7.3.3/src/.svn/format
Normal file
1
Alternativa3D7/7.3.3/src/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<componentPackage>
|
||||
<component id="Alternativa3D" class="alternativa.Alternativa3D"/>
|
||||
</componentPackage>
|
||||
11
Alternativa3D7/7.3.3/src/alternativa/.svn/all-wcprops
Normal file
11
Alternativa3D7/7.3.3/src/alternativa/.svn/all-wcprops
Normal file
@@ -0,0 +1,11 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 88
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa
|
||||
END
|
||||
Alternativa3D.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 105
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/Alternativa3D.as
|
||||
END
|
||||
12
Alternativa3D7/7.3.3/src/alternativa/.svn/dir-prop-base
Normal file
12
Alternativa3D7/7.3.3/src/alternativa/.svn/dir-prop-base
Normal file
@@ -0,0 +1,12 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 746
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0/src/alternativa:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
43
Alternativa3D7/7.3.3/src/alternativa/.svn/entries
Normal file
43
Alternativa3D7/7.3.3/src/alternativa/.svn/entries
Normal file
@@ -0,0 +1,43 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
has-props
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
Alternativa3D.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
6a2abbb94ec9598a872d84e344ff0f78
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
engine3d
|
||||
dir
|
||||
|
||||
1
Alternativa3D7/7.3.3/src/alternativa/.svn/format
Normal file
1
Alternativa3D7/7.3.3/src/alternativa/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,14 @@
|
||||
package alternativa {
|
||||
|
||||
/**
|
||||
* Класс содержит информацию о версии библиотеки.
|
||||
* Также используется для интеграции библиотеки в среду разработки Adobe Flash.
|
||||
*/
|
||||
public class Alternativa3D {
|
||||
|
||||
/**
|
||||
* Версия библиотеки в формате: поколение.feature-версия.fix-версия
|
||||
*/
|
||||
public static const version:String = "7.0.0";
|
||||
}
|
||||
}
|
||||
14
Alternativa3D7/7.3.3/src/alternativa/Alternativa3D.as
Normal file
14
Alternativa3D7/7.3.3/src/alternativa/Alternativa3D.as
Normal file
@@ -0,0 +1,14 @@
|
||||
package alternativa {
|
||||
|
||||
/**
|
||||
* Класс содержит информацию о версии библиотеки.
|
||||
* Также используется для интеграции библиотеки в среду разработки Adobe Flash.
|
||||
*/
|
||||
public class Alternativa3D {
|
||||
|
||||
/**
|
||||
* Версия библиотеки в формате: поколение.feature-версия.fix-версия
|
||||
*/
|
||||
public static const version:String = "7.0.0";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 97
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d
|
||||
END
|
||||
alternativa3d.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/alternativa3d.as
|
||||
END
|
||||
64
Alternativa3D7/7.3.3/src/alternativa/engine3d/.svn/entries
Normal file
64
Alternativa3D7/7.3.3/src/alternativa/engine3d/.svn/entries
Normal file
@@ -0,0 +1,64 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
animation
|
||||
dir
|
||||
|
||||
materials
|
||||
dir
|
||||
|
||||
alternativa3d.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
64183f832985e252cc4bc98977484bc9
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
containers
|
||||
dir
|
||||
|
||||
controllers
|
||||
dir
|
||||
|
||||
core
|
||||
dir
|
||||
|
||||
loaders
|
||||
dir
|
||||
|
||||
objects
|
||||
dir
|
||||
|
||||
primitives
|
||||
dir
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,3 @@
|
||||
package alternativa.engine3d {
|
||||
public namespace alternativa3d = "http://alternativaplatform.com/en/alternativa3d";
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package alternativa.engine3d {
|
||||
public namespace alternativa3d = "http://alternativaplatform.com/en/alternativa3d";
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 107
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation
|
||||
END
|
||||
Animation.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 120
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/Animation.as
|
||||
END
|
||||
AnimationState.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 125
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/AnimationState.as
|
||||
END
|
||||
AnimationTimer.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 125
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/AnimationTimer.as
|
||||
END
|
||||
AnimationController.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 130
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/AnimationController.as
|
||||
END
|
||||
MatrixAnimation.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 126
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/MatrixAnimation.as
|
||||
END
|
||||
Track.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 116
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/Track.as
|
||||
END
|
||||
TransformAnimation.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 129
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/TransformAnimation.as
|
||||
END
|
||||
@@ -0,0 +1,115 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
Animation.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
274e4dab7f981bc6ef9554e66fa998d9
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
AnimationState.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
bda123a2b35e76c121a2f99258ded258
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
AnimationTimer.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
c8b4d7463fa96ce8a12f5b5ade14f1a2
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
AnimationController.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
e52ac28d8cd9a403a82155bb255f837e
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
MatrixAnimation.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
5aac991c5140023bb42af216843c175c
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
Track.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
5c787f6044bd3627fb2e89ba1a3167bf
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
keys
|
||||
dir
|
||||
|
||||
TransformAnimation.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
9a534829ef535a61a981d759a07f4f48
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,230 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import __AS3__.vec.Vector;
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
/**
|
||||
* Анимация объекта
|
||||
*/
|
||||
public class Animation {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
protected static const WEIGHTS_X:uint = 0;
|
||||
protected static const WEIGHTS_Y:uint = 1;
|
||||
protected static const WEIGHTS_Z:uint = 2;
|
||||
protected static const WEIGHTS_ROT_X:uint = 3;
|
||||
protected static const WEIGHTS_ROT_Y:uint = 4;
|
||||
protected static const WEIGHTS_ROT_Z:uint = 5;
|
||||
protected static const WEIGHTS_SCALE_X:uint = 6;
|
||||
protected static const WEIGHTS_SCALE_Y:uint = 7;
|
||||
protected static const WEIGHTS_SCALE_Z:uint = 8;
|
||||
|
||||
/**
|
||||
* Анимируемый объект.
|
||||
*/
|
||||
public var object:Object3D = null;
|
||||
|
||||
/**
|
||||
* Вес анимации по отношению к другим анимациям этого параметра.
|
||||
* Анимация с более высоким весом оказывает большее влияние на конечное значение параметра.
|
||||
* Вес наследуется на дочерние анимации.
|
||||
*/
|
||||
public var weight:Number = 1.0;
|
||||
|
||||
/**
|
||||
* Скорость проигрывания анимации. Скорость наследуется на дочерние анимации.
|
||||
*/
|
||||
public var speed:Number = 1.0;
|
||||
|
||||
/**
|
||||
* Длина анимации, включая дочерние анимации.
|
||||
* После изменения длины треков и длины дочерних анимаций необходимо вызвать updateLength().
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public var length:Number = 0.0;
|
||||
|
||||
/**
|
||||
* Создает анимацию
|
||||
*
|
||||
* @param object анимируемый объект
|
||||
* @param weight вес анимации
|
||||
* @param speed скорость проигрывания анимации
|
||||
*/
|
||||
public function Animation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
this.object = object;
|
||||
this.weight = weight;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Пересчитывает длину анимации.
|
||||
*/
|
||||
public function updateLength():void {
|
||||
var maxLen:Number = 0;
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
var animation:Animation = _animations[i];
|
||||
animation.updateLength();
|
||||
var len:Number = animation.length;
|
||||
if (len > maxLen) {
|
||||
maxLen = len;
|
||||
}
|
||||
}
|
||||
length = maxLen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Подготавливает объект к выполнению смешения анимаций.
|
||||
* Для смешения нескольких анимаций, необходимо на каждой из них вызвать prepareBlending() и затем blend().
|
||||
*
|
||||
* @see #blend()
|
||||
*/
|
||||
public function prepareBlending():void {
|
||||
if (object != null) {
|
||||
if (object.weightsSum != null) {
|
||||
object.weightsSum[0] = 0; object.weightsSum[1] = 0; object.weightsSum[2] = 0;
|
||||
object.weightsSum[3] = 0; object.weightsSum[4] = 0; object.weightsSum[5] = 0;
|
||||
object.weightsSum[6] = 0; object.weightsSum[7] = 0; object.weightsSum[8] = 0;
|
||||
} else {
|
||||
object.weightsSum = new Vector.<Number>(9);
|
||||
}
|
||||
}
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
_animations[i].prepareBlending();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Выполняет смешение анимации с другими анимациями этого параметра.
|
||||
* Перед вызовом этого метода, на всех анимациях которые требуется смешать, нужно вызвать метод prepareBlending().
|
||||
*
|
||||
* @param position время анимации
|
||||
* @param weight вес анимации
|
||||
*
|
||||
* @see #prepareBlending()
|
||||
*/
|
||||
public function blend(position:Number, weight:Number):void {
|
||||
position = (position < 0) ? 0 : (position > length) ? length : position;
|
||||
control(position, weight);
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
var animation:Animation = _animations[i];
|
||||
if (animation.weight != 0) {
|
||||
animation.blend(position*animation.speed, weight*animation.weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function calculateBlendInterpolation(param:int, weight:Number):Number {
|
||||
var sum:Number = object.weightsSum[param];
|
||||
/*
|
||||
if (sum > 0 && weight < 0) {
|
||||
// Предыдущая анимация была на переднем слое, а текущая на нижнем
|
||||
if (sum > 1) {
|
||||
return 0;
|
||||
} else {
|
||||
// Смешиваем на оставшееся значение
|
||||
sum = weight;
|
||||
}
|
||||
}
|
||||
if (sum == 0) {
|
||||
// Текущая анимация первая
|
||||
sum = weight;
|
||||
weight = 1;
|
||||
} else if (sum > 0) {
|
||||
// Предыдущая анимация на верхнем слое, текущая тоже на верхнем, потому что остальные варианты уже отмели
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
} else {
|
||||
// Предыдущая анимация на нижнем слое
|
||||
if (weight > 0) {
|
||||
// Текущая анимация на верхнем слое
|
||||
sum = weight;
|
||||
weight = 1;
|
||||
} else {
|
||||
// Текущая анимация на нижнем слое тоже
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
}
|
||||
}
|
||||
*/
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
|
||||
object.weightsSum[param] = sum;
|
||||
return weight;
|
||||
}
|
||||
|
||||
protected function control(position:Number, weight:Number):void {
|
||||
}
|
||||
|
||||
private var _numAnimations:int;
|
||||
private var _animations:Vector.<Animation>;
|
||||
|
||||
/**
|
||||
* Добавляет дочернюю анимацию.
|
||||
* Для пересчета длины вызовите updateLength().
|
||||
*
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public function addAnimation(animation:Animation):Animation {
|
||||
if (animation == null) {
|
||||
throw new Error("Animation cannot be null");
|
||||
}
|
||||
if (_animations == null) {
|
||||
_animations = new Vector.<Animation>();
|
||||
}
|
||||
_animations[_numAnimations++] = animation;
|
||||
return animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает дочернюю анимацию.
|
||||
* Для пересчета длины вызовите updateLength().
|
||||
*
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public function removeAnimation(animation:Animation):Animation {
|
||||
var index:int = (_animations != null) ? _animations.indexOf(animation) : -1;
|
||||
if (index < 0) throw new ArgumentError("Animation not found");
|
||||
_numAnimations--;
|
||||
var j:int = index + 1;
|
||||
while (index < _numAnimations) {
|
||||
_animations[index] = _animations[j];
|
||||
index++;
|
||||
j++;
|
||||
}
|
||||
if (_numAnimations <= 0) {
|
||||
_animations = null;
|
||||
} else {
|
||||
_animations.length = _numAnimations;
|
||||
}
|
||||
return animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Количество дочерних анимаций.
|
||||
*/
|
||||
public function get numAnimations():int {
|
||||
return _numAnimations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает анимацию по индексу.
|
||||
*/
|
||||
public function getAnimationAt(index:int):Animation {
|
||||
return (_animations != null) ? _animations[index] : null;
|
||||
}
|
||||
|
||||
protected function interpolateAngle(angle1:Number, angle2:Number, weight1:Number):Number {
|
||||
const PI2:Number = 2*Math.PI;
|
||||
angle1 = (angle1 > Math.PI) ? angle1%PI2 - PI2 : (angle1 <= -Math.PI) ? (angle1%PI2) + PI2 : angle1;
|
||||
angle2 = (angle2 > Math.PI) ? angle2%PI2 - PI2 : (angle2 <= -Math.PI) ? (angle2%PI2) + PI2 : angle2;
|
||||
var delta:Number = angle2 - angle1;
|
||||
delta = (delta > Math.PI) ? delta - PI2 : (delta < -Math.PI) ? delta + PI2 : delta;
|
||||
return angle1 + weight1 * delta;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
/**
|
||||
* Управляет проигрыванием и смешением анимаций.
|
||||
*/
|
||||
public class AnimationController {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Включение/выключение контроллера.
|
||||
*/
|
||||
public var enabled:Boolean = true;
|
||||
|
||||
private var _animations:Object = new Object();
|
||||
|
||||
/**
|
||||
* Создает экземпляр контроллера.
|
||||
*/
|
||||
public function AnimationController() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимацию сначала.
|
||||
*
|
||||
* @param name имя анимации для проигрывания
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replay(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.replay(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание анимации с текущей позиции.
|
||||
*
|
||||
* @param name имя анимации для проигрывания
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function play(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.play(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить анимацию.
|
||||
*
|
||||
* @param name имя анимации для останова
|
||||
* @param fade время в течение которого вес анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stop(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.stop(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть все анимации сначала.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replayAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.replay(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание всех анимаций с текущей позиции.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function playAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.play(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить все анимации.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stopAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.stop(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимации за прошедшее время и выполнить их смешение.
|
||||
* Для автоматического ежекадрового обновления можно использовать класс AnimationTimer.
|
||||
*
|
||||
* @param interval прошедшее время.
|
||||
*
|
||||
* @see AnimationTimer
|
||||
*/
|
||||
public function update(interval:Number):void {
|
||||
var state:AnimationState;
|
||||
for each (state in _animations) {
|
||||
state.prepareBlending();
|
||||
}
|
||||
for each (state in _animations) {
|
||||
state.update(interval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавляет анимацию в контроллер и возвращает объект состояния проигрывания анимации.
|
||||
*
|
||||
* @param name имя анимации
|
||||
* @param animation добавляемая анимация
|
||||
* @param loop проиграть анимацию сначала после достижения конца
|
||||
* @return экземляр класса AnimationState через который выполняется управление проигрыванием анимации.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function addAnimation(name:String, animation:Animation, loop:Boolean = true):AnimationState {
|
||||
var state:AnimationState = new AnimationState(this, animation, name, loop);
|
||||
_animations[name] = state;
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает анимацию из контроллера.
|
||||
*
|
||||
* @param name имя анимации для удаления.
|
||||
*/
|
||||
public function removeAnimation(name:String):void {
|
||||
delete _animations[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает объект состояния проигрывания анимации по имени.
|
||||
*
|
||||
* @param name имя анимации.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function getAnimation(name:String):AnimationState {
|
||||
return _animations[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает словарь со всеми анимациями. Свойство - имя анимации, значение - экземпляр класса AnimationState.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function get animations():Object {
|
||||
var result:Object = new Object();
|
||||
for (var name:String in _animations) {
|
||||
result[name] = _animations[name];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
/**
|
||||
* Cостояние проигрывания анимации в контроллере.
|
||||
*/
|
||||
public final class AnimationState {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Зацикленность анимации. Зацикленная анимация будет проигрываться сначала после достижения конца.
|
||||
*/
|
||||
public var loop:Boolean;
|
||||
|
||||
/**
|
||||
* Для незацикленной анимации задает время с отсчетом от конца анимации после которого начнется затухание анимации.
|
||||
* 0 - без затухания, 1 - затухание с начала анимации.
|
||||
*/
|
||||
public var endingFadeOut:Number = 0;
|
||||
|
||||
private var fadeInTime:Number;
|
||||
private var fadedIn:Boolean;
|
||||
private var fadeInPosition:Number;
|
||||
private var fadeOutTime:Number;
|
||||
private var fadedOut:Boolean;
|
||||
private var fadeOutPosition:Number;
|
||||
|
||||
private var manualControl:Boolean = false;
|
||||
|
||||
private var _controller:AnimationController;
|
||||
private var _animation:Animation;
|
||||
private var _name:String;
|
||||
private var _played:Boolean = false;
|
||||
private var _position:Number = 0;
|
||||
|
||||
/**
|
||||
* Конструктор состояния анимации, вызывается в AnimationController.
|
||||
*
|
||||
* @see AnimationController
|
||||
*/
|
||||
public function AnimationState(controller:AnimationController, animation:Animation, name:String, loop:Boolean) {
|
||||
this._controller = controller;
|
||||
this._animation = animation;
|
||||
this._name = name;
|
||||
this.loop = loop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимацию сначала.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replay(fade:Number = 0):void {
|
||||
if (!_played) {
|
||||
play(fade);
|
||||
_position = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание анимации с текущей позиции.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function play(fade:Number = 0):void {
|
||||
if (!_played) {
|
||||
_played = true;
|
||||
fadeInTime = fade;
|
||||
fadedIn = true;
|
||||
if (fadedOut) {
|
||||
fadeInPosition = fadeInTime*(1 - fadeOutPosition/fadeOutTime);
|
||||
fadedOut = false;
|
||||
} else {
|
||||
fadeInPosition = 0;
|
||||
}
|
||||
manualControl = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить проигрывание анимации.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stop(fade:Number = 0):void {
|
||||
if (_played) {
|
||||
_played = false;
|
||||
fadeOutTime = fade;
|
||||
if (fadedIn) {
|
||||
fadeOutPosition = fadeOutTime*(1 - fadeInPosition/fadeInTime);
|
||||
fadedIn = false;
|
||||
fadedOut = true;
|
||||
} else {
|
||||
if (!fadedOut) {
|
||||
fadeOutPosition = 0;
|
||||
fadedOut = true;
|
||||
}
|
||||
}
|
||||
manualControl = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function prepareBlending():void {
|
||||
_animation.prepareBlending();
|
||||
}
|
||||
|
||||
private function loopPosition():void {
|
||||
if (_position < 0) {
|
||||
// _position = (length <= 0) ? 0 : _position % length;
|
||||
_position = 0;
|
||||
} else {
|
||||
if (_position >= _animation.length) {
|
||||
_position = (_animation.length <= 0) ? 0 : _position % _animation.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function fading(position:Number):Number {
|
||||
if (position > 1) {
|
||||
return 1;
|
||||
}
|
||||
if (position < 0) {
|
||||
return 0;
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function update(interval:Number):void {
|
||||
var weight:Number = _animation.weight;
|
||||
if (_played) {
|
||||
_position += interval*_animation.speed;
|
||||
if (loop) {
|
||||
loopPosition();
|
||||
if (fadedIn) {
|
||||
fadeInPosition += interval;
|
||||
if (fadeInPosition < fadeInTime) {
|
||||
weight *= fading(fadeInPosition/fadeInTime);
|
||||
} else {
|
||||
fadedIn = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_position < 0) {
|
||||
_position = 0;
|
||||
if (interval < 0) {
|
||||
_played = false;
|
||||
}
|
||||
weight = 0;
|
||||
} else {
|
||||
if (_position > _animation.length) {
|
||||
if (interval > 0) {
|
||||
_position = 0;
|
||||
_played = false;
|
||||
} else {
|
||||
_position = _animation.length;
|
||||
}
|
||||
weight = 0;
|
||||
} else {
|
||||
if ((_position/_animation.length + endingFadeOut) > 1) {
|
||||
fadedOut = true;
|
||||
fadeOutTime = endingFadeOut;
|
||||
fadeOutPosition = _position/_animation.length + endingFadeOut - 1;
|
||||
} else {
|
||||
fadedOut = false;
|
||||
}
|
||||
if (fadedIn) {
|
||||
fadeInPosition += interval;
|
||||
}
|
||||
if ((fadedIn && (fadeInPosition < fadeInTime)) && fadedOut) {
|
||||
var w1:Number = fading(fadeInPosition/fadeInTime);
|
||||
var w2:Number = fading(1 - fadeOutPosition/fadeOutTime);
|
||||
if (w1 < w2) {
|
||||
weight *= w1;
|
||||
} else {
|
||||
weight *= w2;
|
||||
fadedIn = false;
|
||||
}
|
||||
} else {
|
||||
if (fadedIn) {
|
||||
if (fadeInPosition < fadeInTime) {
|
||||
weight *= fading(fadeInPosition/fadeInTime);
|
||||
} else {
|
||||
fadedIn = false;
|
||||
}
|
||||
} else if (fadedOut) {
|
||||
weight *= fading(1 - fadeOutPosition/fadeOutTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!manualControl) {
|
||||
if (fadedOut) {
|
||||
_position += interval*_animation.speed;
|
||||
if (loop) {
|
||||
loopPosition();
|
||||
} else {
|
||||
if (_position < 0) {
|
||||
_position = 0;
|
||||
} else {
|
||||
if (_position >= _animation.length) {
|
||||
_position = _animation.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
fadeOutPosition += interval;
|
||||
if (fadeOutPosition < fadeOutTime) {
|
||||
weight *= fading(1 - fadeOutPosition/fadeOutTime);
|
||||
} else {
|
||||
fadedOut = false;
|
||||
weight = 0;
|
||||
}
|
||||
} else {
|
||||
weight = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (weight != 0) {
|
||||
_animation.blend(_position, weight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Контроллер, управляющий воспроизведением анимации.
|
||||
*/
|
||||
public function get controller():AnimationController {
|
||||
return _controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проигрываемая анимация.
|
||||
*/
|
||||
public function get animation():Animation {
|
||||
return _animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Имя анимации в контроллере.
|
||||
*/
|
||||
public function get name():String {
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проигрывается анимация в данный момент или нет.
|
||||
*/
|
||||
public function get played():Boolean {
|
||||
return _played;
|
||||
}
|
||||
|
||||
/**
|
||||
* Позиция проигрывания анимации.
|
||||
*/
|
||||
public function get position():Number {
|
||||
return _position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public function set position(value:Number):void {
|
||||
_position = value;
|
||||
manualControl = true;
|
||||
_played = false;
|
||||
fadedIn = false;
|
||||
fadedOut = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import flash.utils.getTimer;
|
||||
|
||||
/**
|
||||
* Выполняет ежекадровое обновление контроллеров.
|
||||
*/
|
||||
public class AnimationTimer {
|
||||
|
||||
/**
|
||||
* Соотношение виртуального времени реальному
|
||||
*/
|
||||
public var timeScale:Number = 1.0;
|
||||
|
||||
private var _numControllers:int;
|
||||
private var _controllers:Vector.<AnimationController> = new Vector.<AnimationController>();
|
||||
|
||||
private var lastTime:int = -1;
|
||||
|
||||
/**
|
||||
* Создает экземпляр контроллера.
|
||||
*/
|
||||
public function AnimationTimer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Начинает отсчет времени.
|
||||
*/
|
||||
public function start():void {
|
||||
lastTime = getTimer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляет контроллеры с времени последнего вызова start() или update().
|
||||
*
|
||||
* @see #start()
|
||||
*/
|
||||
public function update():void {
|
||||
if (lastTime >= 0) {
|
||||
var time:int = getTimer();
|
||||
var interval:Number = 0.001*timeScale*(time - lastTime);
|
||||
for (var i:int = 0; i < _numControllers; i++) {
|
||||
var controller:AnimationController = _controllers[i];
|
||||
if (controller.enabled) {
|
||||
controller.update(interval);
|
||||
}
|
||||
}
|
||||
lastTime = time;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Приостанавливает отсчет времени.
|
||||
*/
|
||||
public function stop():void {
|
||||
lastTime = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает <code>true</code> если таймер в данный момент остановлен.
|
||||
*/
|
||||
public function get stoped():Boolean {
|
||||
return lastTime == -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавляет контроллер.
|
||||
*/
|
||||
public function addController(controller:AnimationController):AnimationController {
|
||||
if (controller == null) {
|
||||
throw new Error("Controller cannot be null");
|
||||
}
|
||||
_controllers[_numControllers++] = controller;
|
||||
return controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает контроллер.
|
||||
*/
|
||||
public function removeController(controller:AnimationController):AnimationController {
|
||||
var index:int = _controllers.indexOf(controller);
|
||||
if (index < 0) throw new ArgumentError("Controller not found");
|
||||
_numControllers--;
|
||||
var j:int = index + 1;
|
||||
while (index < _numControllers) {
|
||||
_controllers[index] = _controllers[j];
|
||||
index++;
|
||||
j++;
|
||||
}
|
||||
_controllers.length = _numControllers;
|
||||
return controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает количество контроллеров.
|
||||
*/
|
||||
public function get numControllers():int {
|
||||
return _numControllers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает контроллер по индексу.
|
||||
*
|
||||
* @param index индекс контроллера.
|
||||
*/
|
||||
public function getControllerAt(index:int):AnimationController {
|
||||
return _controllers[index];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import __AS3__.vec.Vector;
|
||||
|
||||
import alternativa.engine3d.animation.keys.MatrixKey;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Vector3D;
|
||||
|
||||
/**
|
||||
* Анимация матрицы объекта.
|
||||
*/
|
||||
public class MatrixAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами анимации матрицы.
|
||||
*/
|
||||
public var matrix:Track;
|
||||
|
||||
private var matrixKey:MatrixKey = new MatrixKey(0, null);
|
||||
|
||||
/**
|
||||
* Создает новый экземпляр объекта.
|
||||
*
|
||||
* @param object объект, матрица которого анимируется.
|
||||
* @param weight вес анимации.
|
||||
* @param speed скорость проигрывания анимации.
|
||||
*/
|
||||
public function MatrixAnimation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
super(object, weight, speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override protected function control(position:Number, weight:Number):void {
|
||||
if (matrix != null) {
|
||||
matrix.getKey(position, matrixKey);
|
||||
var mat:Matrix3D = matrixKey.matrix;
|
||||
var components:Vector.<Vector3D> = mat.decompose();
|
||||
var t:Vector3D = components[0];
|
||||
var r:Vector3D = components[1];
|
||||
var s:Vector3D = components[2];
|
||||
var c:Number;
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*t.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*t.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*t.z;
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, r.x, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, r.y, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, r.z, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*s.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*s.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*s.z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override public function updateLength():void {
|
||||
super.updateLength();
|
||||
if (matrix != null) {
|
||||
var len:Number = matrix.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.animation.keys.Key;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами.
|
||||
*/
|
||||
public class Track {
|
||||
|
||||
/**
|
||||
* Ключевые кадры.
|
||||
*/
|
||||
public var keyList:Key;
|
||||
|
||||
/**
|
||||
* Добавляет ключевой кадр.
|
||||
*/
|
||||
public function addKey(key:Key):void {
|
||||
key.next = keyList;
|
||||
keyList = key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Сортирует ключевые кадры по времени.
|
||||
*/
|
||||
public function sortKeys():void {
|
||||
keyList = sortKeysByTime(keyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает кадр соответствующий заданному времени.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param key если не <code>null</code>, результат будет записан в этот объект.
|
||||
*/
|
||||
public function getKey(time:Number, key:Key = null):Key {
|
||||
var prev:Key;
|
||||
var next:Key = keyList;
|
||||
while (next != null && next.time < time) {
|
||||
prev = next;
|
||||
next = next.next;
|
||||
}
|
||||
if (prev != null) return prev.interpolate(time, next, key);
|
||||
if (next != null) return next.interpolate(time, null, key);
|
||||
return null;
|
||||
}
|
||||
|
||||
private function sortKeysByTime(list:Key):Key {
|
||||
var left:Key = list;
|
||||
var right:Key = list.next;
|
||||
while (right != null && right.next != null) {
|
||||
list = list.next;
|
||||
right = right.next.next;
|
||||
}
|
||||
right = list.next;
|
||||
list.next = null;
|
||||
if (left.next != null) {
|
||||
left = sortKeysByTime(left);
|
||||
}
|
||||
if (right.next != null) {
|
||||
right = sortKeysByTime(right);
|
||||
}
|
||||
var flag:Boolean = left.time < right.time;
|
||||
if (flag) {
|
||||
list = left;
|
||||
left = left.next;
|
||||
} else {
|
||||
list = right;
|
||||
right = right.next;
|
||||
}
|
||||
var last:Key = list;
|
||||
while (true) {
|
||||
if (left == null) {
|
||||
last.next = right;
|
||||
return list;
|
||||
} else if (right == null) {
|
||||
last.next = left;
|
||||
return list;
|
||||
}
|
||||
if (flag) {
|
||||
if (left.time < right.time) {
|
||||
last = left;
|
||||
left = left.next;
|
||||
} else {
|
||||
last.next = right;
|
||||
last = right;
|
||||
right = right.next;
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
if (right.time < left.time) {
|
||||
last = right;
|
||||
right = right.next;
|
||||
} else {
|
||||
last.next = left;
|
||||
last = left;
|
||||
left = left.next;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает время последнего ключевого кадра.
|
||||
*/
|
||||
public function get length():Number {
|
||||
if (keyList != null) {
|
||||
var key:Key = keyList;
|
||||
while (key.next != null) {
|
||||
key = key.next;
|
||||
}
|
||||
return key.time;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.animation.keys.PointKey;
|
||||
import alternativa.engine3d.animation.keys.ValueKey;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
/**
|
||||
* Анимация компонентов положения и ориентации объекта.
|
||||
*/
|
||||
public class TransformAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами положения объекта.
|
||||
*/
|
||||
public var translation:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта.
|
||||
*/
|
||||
public var rotation:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта.
|
||||
*/
|
||||
public var scale:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси X.
|
||||
*/
|
||||
public var x:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси Y.
|
||||
*/
|
||||
public var y:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси Z.
|
||||
*/
|
||||
public var z:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси X.
|
||||
*/
|
||||
public var rotationX:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси Y.
|
||||
*/
|
||||
public var rotationY:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси Z.
|
||||
*/
|
||||
public var rotationZ:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси X.
|
||||
*/
|
||||
public var scaleX:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси Y.
|
||||
*/
|
||||
public var scaleY:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси Z.
|
||||
*/
|
||||
public var scaleZ:Track;
|
||||
|
||||
private var valueKey:ValueKey = new ValueKey(0, 0);
|
||||
private var pointKey:PointKey = new PointKey(0, 0, 0, 0);
|
||||
|
||||
/**
|
||||
* Конструктор анимации.
|
||||
*
|
||||
* @param object анимируемый объект.
|
||||
* @param weight вес анимации.
|
||||
* @param speed скорость проигрывания анимации.
|
||||
*/
|
||||
public function TransformAnimation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
super(object, weight, speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override protected function control(position:Number, weight:Number):void {
|
||||
var c:Number;
|
||||
if (translation != null) {
|
||||
translation.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*pointKey.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*pointKey.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*pointKey.z;
|
||||
} else {
|
||||
if (x != null) {
|
||||
x.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*valueKey.value;
|
||||
}
|
||||
if (y != null) {
|
||||
y.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*valueKey.value;
|
||||
}
|
||||
if (z != null) {
|
||||
z.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*valueKey.value;
|
||||
}
|
||||
}
|
||||
if (rotation != null) {
|
||||
rotation.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, pointKey.x, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, pointKey.y, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, pointKey.z, c);
|
||||
} else {
|
||||
if (rotationX != null) {
|
||||
rotationX.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, valueKey.value, c);
|
||||
}
|
||||
if (rotationY != null) {
|
||||
rotationY.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, valueKey.value, c);
|
||||
}
|
||||
if (rotationZ != null) {
|
||||
rotationZ.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, valueKey.value, c);
|
||||
}
|
||||
}
|
||||
if (scale != null) {
|
||||
scale.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*pointKey.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*pointKey.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*pointKey.z;
|
||||
} else {
|
||||
if (scaleX != null) {
|
||||
scaleX.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*valueKey.value;
|
||||
}
|
||||
if (scaleY != null) {
|
||||
scaleY.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*valueKey.value;
|
||||
}
|
||||
if (scaleZ != null) {
|
||||
scaleZ.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*valueKey.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override public function updateLength():void {
|
||||
super.updateLength();
|
||||
var len:Number;
|
||||
if (translation != null) {
|
||||
len = translation.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotation != null) {
|
||||
len = rotation.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scale != null) {
|
||||
len = scale.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (x != null) {
|
||||
len = x.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (y != null) {
|
||||
len = y.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (z != null) {
|
||||
len = z.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationX != null) {
|
||||
len = rotationX.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationY != null) {
|
||||
len = rotationY.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationZ != null) {
|
||||
len = rotationZ.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleX != null) {
|
||||
len = scaleX.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleY != null) {
|
||||
len = scaleY.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleZ != null) {
|
||||
len = scaleZ.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import __AS3__.vec.Vector;
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
/**
|
||||
* Анимация объекта
|
||||
*/
|
||||
public class Animation {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
protected static const WEIGHTS_X:uint = 0;
|
||||
protected static const WEIGHTS_Y:uint = 1;
|
||||
protected static const WEIGHTS_Z:uint = 2;
|
||||
protected static const WEIGHTS_ROT_X:uint = 3;
|
||||
protected static const WEIGHTS_ROT_Y:uint = 4;
|
||||
protected static const WEIGHTS_ROT_Z:uint = 5;
|
||||
protected static const WEIGHTS_SCALE_X:uint = 6;
|
||||
protected static const WEIGHTS_SCALE_Y:uint = 7;
|
||||
protected static const WEIGHTS_SCALE_Z:uint = 8;
|
||||
|
||||
/**
|
||||
* Анимируемый объект.
|
||||
*/
|
||||
public var object:Object3D = null;
|
||||
|
||||
/**
|
||||
* Вес анимации по отношению к другим анимациям этого параметра.
|
||||
* Анимация с более высоким весом оказывает большее влияние на конечное значение параметра.
|
||||
* Вес наследуется на дочерние анимации.
|
||||
*/
|
||||
public var weight:Number = 1.0;
|
||||
|
||||
/**
|
||||
* Скорость проигрывания анимации. Скорость наследуется на дочерние анимации.
|
||||
*/
|
||||
public var speed:Number = 1.0;
|
||||
|
||||
/**
|
||||
* Длина анимации, включая дочерние анимации.
|
||||
* После изменения длины треков и длины дочерних анимаций необходимо вызвать updateLength().
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public var length:Number = 0.0;
|
||||
|
||||
/**
|
||||
* Создает анимацию
|
||||
*
|
||||
* @param object анимируемый объект
|
||||
* @param weight вес анимации
|
||||
* @param speed скорость проигрывания анимации
|
||||
*/
|
||||
public function Animation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
this.object = object;
|
||||
this.weight = weight;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Пересчитывает длину анимации.
|
||||
*/
|
||||
public function updateLength():void {
|
||||
var maxLen:Number = 0;
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
var animation:Animation = _animations[i];
|
||||
animation.updateLength();
|
||||
var len:Number = animation.length;
|
||||
if (len > maxLen) {
|
||||
maxLen = len;
|
||||
}
|
||||
}
|
||||
length = maxLen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Подготавливает объект к выполнению смешения анимаций.
|
||||
* Для смешения нескольких анимаций, необходимо на каждой из них вызвать prepareBlending() и затем blend().
|
||||
*
|
||||
* @see #blend()
|
||||
*/
|
||||
public function prepareBlending():void {
|
||||
if (object != null) {
|
||||
if (object.weightsSum != null) {
|
||||
object.weightsSum[0] = 0; object.weightsSum[1] = 0; object.weightsSum[2] = 0;
|
||||
object.weightsSum[3] = 0; object.weightsSum[4] = 0; object.weightsSum[5] = 0;
|
||||
object.weightsSum[6] = 0; object.weightsSum[7] = 0; object.weightsSum[8] = 0;
|
||||
} else {
|
||||
object.weightsSum = new Vector.<Number>(9);
|
||||
}
|
||||
}
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
_animations[i].prepareBlending();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Выполняет смешение анимации с другими анимациями этого параметра.
|
||||
* Перед вызовом этого метода, на всех анимациях которые требуется смешать, нужно вызвать метод prepareBlending().
|
||||
*
|
||||
* @param position время анимации
|
||||
* @param weight вес анимации
|
||||
*
|
||||
* @see #prepareBlending()
|
||||
*/
|
||||
public function blend(position:Number, weight:Number):void {
|
||||
position = (position < 0) ? 0 : (position > length) ? length : position;
|
||||
control(position, weight);
|
||||
for (var i:int = 0; i < _numAnimations; i++) {
|
||||
var animation:Animation = _animations[i];
|
||||
if (animation.weight != 0) {
|
||||
animation.blend(position*animation.speed, weight*animation.weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function calculateBlendInterpolation(param:int, weight:Number):Number {
|
||||
var sum:Number = object.weightsSum[param];
|
||||
/*
|
||||
if (sum > 0 && weight < 0) {
|
||||
// Предыдущая анимация была на переднем слое, а текущая на нижнем
|
||||
if (sum > 1) {
|
||||
return 0;
|
||||
} else {
|
||||
// Смешиваем на оставшееся значение
|
||||
sum = weight;
|
||||
}
|
||||
}
|
||||
if (sum == 0) {
|
||||
// Текущая анимация первая
|
||||
sum = weight;
|
||||
weight = 1;
|
||||
} else if (sum > 0) {
|
||||
// Предыдущая анимация на верхнем слое, текущая тоже на верхнем, потому что остальные варианты уже отмели
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
} else {
|
||||
// Предыдущая анимация на нижнем слое
|
||||
if (weight > 0) {
|
||||
// Текущая анимация на верхнем слое
|
||||
sum = weight;
|
||||
weight = 1;
|
||||
} else {
|
||||
// Текущая анимация на нижнем слое тоже
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
}
|
||||
}
|
||||
*/
|
||||
sum += weight;
|
||||
weight /= sum;
|
||||
|
||||
object.weightsSum[param] = sum;
|
||||
return weight;
|
||||
}
|
||||
|
||||
protected function control(position:Number, weight:Number):void {
|
||||
}
|
||||
|
||||
private var _numAnimations:int;
|
||||
private var _animations:Vector.<Animation>;
|
||||
|
||||
/**
|
||||
* Добавляет дочернюю анимацию.
|
||||
* Для пересчета длины вызовите updateLength().
|
||||
*
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public function addAnimation(animation:Animation):Animation {
|
||||
if (animation == null) {
|
||||
throw new Error("Animation cannot be null");
|
||||
}
|
||||
if (_animations == null) {
|
||||
_animations = new Vector.<Animation>();
|
||||
}
|
||||
_animations[_numAnimations++] = animation;
|
||||
return animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает дочернюю анимацию.
|
||||
* Для пересчета длины вызовите updateLength().
|
||||
*
|
||||
* @see #updateLength()
|
||||
*/
|
||||
public function removeAnimation(animation:Animation):Animation {
|
||||
var index:int = (_animations != null) ? _animations.indexOf(animation) : -1;
|
||||
if (index < 0) throw new ArgumentError("Animation not found");
|
||||
_numAnimations--;
|
||||
var j:int = index + 1;
|
||||
while (index < _numAnimations) {
|
||||
_animations[index] = _animations[j];
|
||||
index++;
|
||||
j++;
|
||||
}
|
||||
if (_numAnimations <= 0) {
|
||||
_animations = null;
|
||||
} else {
|
||||
_animations.length = _numAnimations;
|
||||
}
|
||||
return animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Количество дочерних анимаций.
|
||||
*/
|
||||
public function get numAnimations():int {
|
||||
return _numAnimations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает анимацию по индексу.
|
||||
*/
|
||||
public function getAnimationAt(index:int):Animation {
|
||||
return (_animations != null) ? _animations[index] : null;
|
||||
}
|
||||
|
||||
protected function interpolateAngle(angle1:Number, angle2:Number, weight1:Number):Number {
|
||||
const PI2:Number = 2*Math.PI;
|
||||
angle1 = (angle1 > Math.PI) ? angle1%PI2 - PI2 : (angle1 <= -Math.PI) ? (angle1%PI2) + PI2 : angle1;
|
||||
angle2 = (angle2 > Math.PI) ? angle2%PI2 - PI2 : (angle2 <= -Math.PI) ? (angle2%PI2) + PI2 : angle2;
|
||||
var delta:Number = angle2 - angle1;
|
||||
delta = (delta > Math.PI) ? delta - PI2 : (delta < -Math.PI) ? delta + PI2 : delta;
|
||||
return angle1 + weight1 * delta;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
/**
|
||||
* Управляет проигрыванием и смешением анимаций.
|
||||
*/
|
||||
public class AnimationController {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Включение/выключение контроллера.
|
||||
*/
|
||||
public var enabled:Boolean = true;
|
||||
|
||||
private var _animations:Object = new Object();
|
||||
|
||||
/**
|
||||
* Создает экземпляр контроллера.
|
||||
*/
|
||||
public function AnimationController() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимацию сначала.
|
||||
*
|
||||
* @param name имя анимации для проигрывания
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replay(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.replay(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание анимации с текущей позиции.
|
||||
*
|
||||
* @param name имя анимации для проигрывания
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function play(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.play(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить анимацию.
|
||||
*
|
||||
* @param name имя анимации для останова
|
||||
* @param fade время в течение которого вес анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stop(name:String, fade:Number = 0):void {
|
||||
var state:AnimationState = _animations[name];
|
||||
if (state == null) {
|
||||
throw new ArgumentError('Animation with name "' + name + '" not found');
|
||||
}
|
||||
state.stop(fade);
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть все анимации сначала.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replayAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.replay(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание всех анимаций с текущей позиции.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function playAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.play(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить все анимации.
|
||||
*
|
||||
* @param fade время в течение которого вес каждой анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stopAll(fade:Number = 0):void {
|
||||
for each (var state:AnimationState in _animations) {
|
||||
state.stop(fade);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимации за прошедшее время и выполнить их смешение.
|
||||
* Для автоматического ежекадрового обновления можно использовать класс AnimationTimer.
|
||||
*
|
||||
* @param interval прошедшее время.
|
||||
*
|
||||
* @see AnimationTimer
|
||||
*/
|
||||
public function update(interval:Number):void {
|
||||
var state:AnimationState;
|
||||
for each (state in _animations) {
|
||||
state.prepareBlending();
|
||||
}
|
||||
for each (state in _animations) {
|
||||
state.update(interval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавляет анимацию в контроллер и возвращает объект состояния проигрывания анимации.
|
||||
*
|
||||
* @param name имя анимации
|
||||
* @param animation добавляемая анимация
|
||||
* @param loop проиграть анимацию сначала после достижения конца
|
||||
* @return экземляр класса AnimationState через который выполняется управление проигрыванием анимации.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function addAnimation(name:String, animation:Animation, loop:Boolean = true):AnimationState {
|
||||
var state:AnimationState = new AnimationState(this, animation, name, loop);
|
||||
_animations[name] = state;
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает анимацию из контроллера.
|
||||
*
|
||||
* @param name имя анимации для удаления.
|
||||
*/
|
||||
public function removeAnimation(name:String):void {
|
||||
delete _animations[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает объект состояния проигрывания анимации по имени.
|
||||
*
|
||||
* @param name имя анимации.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function getAnimation(name:String):AnimationState {
|
||||
return _animations[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает словарь со всеми анимациями. Свойство - имя анимации, значение - экземпляр класса AnimationState.
|
||||
*
|
||||
* @see AnimationState
|
||||
*/
|
||||
public function get animations():Object {
|
||||
var result:Object = new Object();
|
||||
for (var name:String in _animations) {
|
||||
result[name] = _animations[name];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
/**
|
||||
* Cостояние проигрывания анимации в контроллере.
|
||||
*/
|
||||
public final class AnimationState {
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Зацикленность анимации. Зацикленная анимация будет проигрываться сначала после достижения конца.
|
||||
*/
|
||||
public var loop:Boolean;
|
||||
|
||||
/**
|
||||
* Для незацикленной анимации задает время с отсчетом от конца анимации после которого начнется затухание анимации.
|
||||
* 0 - без затухания, 1 - затухание с начала анимации.
|
||||
*/
|
||||
public var endingFadeOut:Number = 0;
|
||||
|
||||
private var fadeInTime:Number;
|
||||
private var fadedIn:Boolean;
|
||||
private var fadeInPosition:Number;
|
||||
private var fadeOutTime:Number;
|
||||
private var fadedOut:Boolean;
|
||||
private var fadeOutPosition:Number;
|
||||
|
||||
private var manualControl:Boolean = false;
|
||||
|
||||
private var _controller:AnimationController;
|
||||
private var _animation:Animation;
|
||||
private var _name:String;
|
||||
private var _played:Boolean = false;
|
||||
private var _position:Number = 0;
|
||||
|
||||
/**
|
||||
* Конструктор состояния анимации, вызывается в AnimationController.
|
||||
*
|
||||
* @see AnimationController
|
||||
*/
|
||||
public function AnimationState(controller:AnimationController, animation:Animation, name:String, loop:Boolean) {
|
||||
this._controller = controller;
|
||||
this._animation = animation;
|
||||
this._name = name;
|
||||
this.loop = loop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проиграть анимацию сначала.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function replay(fade:Number = 0):void {
|
||||
if (!_played) {
|
||||
play(fade);
|
||||
_position = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Продолжить проигрывание анимации с текущей позиции.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен увеличиться с нуля до максимального значения.
|
||||
*/
|
||||
public function play(fade:Number = 0):void {
|
||||
if (!_played) {
|
||||
_played = true;
|
||||
fadeInTime = fade;
|
||||
fadedIn = true;
|
||||
if (fadedOut) {
|
||||
fadeInPosition = fadeInTime*(1 - fadeOutPosition/fadeOutTime);
|
||||
fadedOut = false;
|
||||
} else {
|
||||
fadeInPosition = 0;
|
||||
}
|
||||
manualControl = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Остановить проигрывание анимации.
|
||||
*
|
||||
* @param fade время в течение которого вес анимации должен уменьшиться с максимального значения до 0.
|
||||
*/
|
||||
public function stop(fade:Number = 0):void {
|
||||
if (_played) {
|
||||
_played = false;
|
||||
fadeOutTime = fade;
|
||||
if (fadedIn) {
|
||||
fadeOutPosition = fadeOutTime*(1 - fadeInPosition/fadeInTime);
|
||||
fadedIn = false;
|
||||
fadedOut = true;
|
||||
} else {
|
||||
if (!fadedOut) {
|
||||
fadeOutPosition = 0;
|
||||
fadedOut = true;
|
||||
}
|
||||
}
|
||||
manualControl = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function prepareBlending():void {
|
||||
_animation.prepareBlending();
|
||||
}
|
||||
|
||||
private function loopPosition():void {
|
||||
if (_position < 0) {
|
||||
// _position = (length <= 0) ? 0 : _position % length;
|
||||
_position = 0;
|
||||
} else {
|
||||
if (_position >= _animation.length) {
|
||||
_position = (_animation.length <= 0) ? 0 : _position % _animation.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function fading(position:Number):Number {
|
||||
if (position > 1) {
|
||||
return 1;
|
||||
}
|
||||
if (position < 0) {
|
||||
return 0;
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function update(interval:Number):void {
|
||||
var weight:Number = _animation.weight;
|
||||
if (_played) {
|
||||
_position += interval*_animation.speed;
|
||||
if (loop) {
|
||||
loopPosition();
|
||||
if (fadedIn) {
|
||||
fadeInPosition += interval;
|
||||
if (fadeInPosition < fadeInTime) {
|
||||
weight *= fading(fadeInPosition/fadeInTime);
|
||||
} else {
|
||||
fadedIn = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_position < 0) {
|
||||
_position = 0;
|
||||
if (interval < 0) {
|
||||
_played = false;
|
||||
}
|
||||
weight = 0;
|
||||
} else {
|
||||
if (_position > _animation.length) {
|
||||
if (interval > 0) {
|
||||
_position = 0;
|
||||
_played = false;
|
||||
} else {
|
||||
_position = _animation.length;
|
||||
}
|
||||
weight = 0;
|
||||
} else {
|
||||
if ((_position/_animation.length + endingFadeOut) > 1) {
|
||||
fadedOut = true;
|
||||
fadeOutTime = endingFadeOut;
|
||||
fadeOutPosition = _position/_animation.length + endingFadeOut - 1;
|
||||
} else {
|
||||
fadedOut = false;
|
||||
}
|
||||
if (fadedIn) {
|
||||
fadeInPosition += interval;
|
||||
}
|
||||
if ((fadedIn && (fadeInPosition < fadeInTime)) && fadedOut) {
|
||||
var w1:Number = fading(fadeInPosition/fadeInTime);
|
||||
var w2:Number = fading(1 - fadeOutPosition/fadeOutTime);
|
||||
if (w1 < w2) {
|
||||
weight *= w1;
|
||||
} else {
|
||||
weight *= w2;
|
||||
fadedIn = false;
|
||||
}
|
||||
} else {
|
||||
if (fadedIn) {
|
||||
if (fadeInPosition < fadeInTime) {
|
||||
weight *= fading(fadeInPosition/fadeInTime);
|
||||
} else {
|
||||
fadedIn = false;
|
||||
}
|
||||
} else if (fadedOut) {
|
||||
weight *= fading(1 - fadeOutPosition/fadeOutTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!manualControl) {
|
||||
if (fadedOut) {
|
||||
_position += interval*_animation.speed;
|
||||
if (loop) {
|
||||
loopPosition();
|
||||
} else {
|
||||
if (_position < 0) {
|
||||
_position = 0;
|
||||
} else {
|
||||
if (_position >= _animation.length) {
|
||||
_position = _animation.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
fadeOutPosition += interval;
|
||||
if (fadeOutPosition < fadeOutTime) {
|
||||
weight *= fading(1 - fadeOutPosition/fadeOutTime);
|
||||
} else {
|
||||
fadedOut = false;
|
||||
weight = 0;
|
||||
}
|
||||
} else {
|
||||
weight = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (weight != 0) {
|
||||
_animation.blend(_position, weight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Контроллер, управляющий воспроизведением анимации.
|
||||
*/
|
||||
public function get controller():AnimationController {
|
||||
return _controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проигрываемая анимация.
|
||||
*/
|
||||
public function get animation():Animation {
|
||||
return _animation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Имя анимации в контроллере.
|
||||
*/
|
||||
public function get name():String {
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Проигрывается анимация в данный момент или нет.
|
||||
*/
|
||||
public function get played():Boolean {
|
||||
return _played;
|
||||
}
|
||||
|
||||
/**
|
||||
* Позиция проигрывания анимации.
|
||||
*/
|
||||
public function get position():Number {
|
||||
return _position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public function set position(value:Number):void {
|
||||
_position = value;
|
||||
manualControl = true;
|
||||
_played = false;
|
||||
fadedIn = false;
|
||||
fadedOut = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import flash.utils.getTimer;
|
||||
|
||||
/**
|
||||
* Выполняет ежекадровое обновление контроллеров.
|
||||
*/
|
||||
public class AnimationTimer {
|
||||
|
||||
/**
|
||||
* Соотношение виртуального времени реальному
|
||||
*/
|
||||
public var timeScale:Number = 1.0;
|
||||
|
||||
private var _numControllers:int;
|
||||
private var _controllers:Vector.<AnimationController> = new Vector.<AnimationController>();
|
||||
|
||||
private var lastTime:int = -1;
|
||||
|
||||
/**
|
||||
* Создает экземпляр контроллера.
|
||||
*/
|
||||
public function AnimationTimer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Начинает отсчет времени.
|
||||
*/
|
||||
public function start():void {
|
||||
lastTime = getTimer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляет контроллеры с времени последнего вызова start() или update().
|
||||
*
|
||||
* @see #start()
|
||||
*/
|
||||
public function update():void {
|
||||
if (lastTime >= 0) {
|
||||
var time:int = getTimer();
|
||||
var interval:Number = 0.001*timeScale*(time - lastTime);
|
||||
for (var i:int = 0; i < _numControllers; i++) {
|
||||
var controller:AnimationController = _controllers[i];
|
||||
if (controller.enabled) {
|
||||
controller.update(interval);
|
||||
}
|
||||
}
|
||||
lastTime = time;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Приостанавливает отсчет времени.
|
||||
*/
|
||||
public function stop():void {
|
||||
lastTime = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает <code>true</code> если таймер в данный момент остановлен.
|
||||
*/
|
||||
public function get stoped():Boolean {
|
||||
return lastTime == -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавляет контроллер.
|
||||
*/
|
||||
public function addController(controller:AnimationController):AnimationController {
|
||||
if (controller == null) {
|
||||
throw new Error("Controller cannot be null");
|
||||
}
|
||||
_controllers[_numControllers++] = controller;
|
||||
return controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Убирает контроллер.
|
||||
*/
|
||||
public function removeController(controller:AnimationController):AnimationController {
|
||||
var index:int = _controllers.indexOf(controller);
|
||||
if (index < 0) throw new ArgumentError("Controller not found");
|
||||
_numControllers--;
|
||||
var j:int = index + 1;
|
||||
while (index < _numControllers) {
|
||||
_controllers[index] = _controllers[j];
|
||||
index++;
|
||||
j++;
|
||||
}
|
||||
_controllers.length = _numControllers;
|
||||
return controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает количество контроллеров.
|
||||
*/
|
||||
public function get numControllers():int {
|
||||
return _numControllers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает контроллер по индексу.
|
||||
*
|
||||
* @param index индекс контроллера.
|
||||
*/
|
||||
public function getControllerAt(index:int):AnimationController {
|
||||
return _controllers[index];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import __AS3__.vec.Vector;
|
||||
|
||||
import alternativa.engine3d.animation.keys.MatrixKey;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Vector3D;
|
||||
|
||||
/**
|
||||
* Анимация матрицы объекта.
|
||||
*/
|
||||
public class MatrixAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами анимации матрицы.
|
||||
*/
|
||||
public var matrix:Track;
|
||||
|
||||
private var matrixKey:MatrixKey = new MatrixKey(0, null);
|
||||
|
||||
/**
|
||||
* Создает новый экземпляр объекта.
|
||||
*
|
||||
* @param object объект, матрица которого анимируется.
|
||||
* @param weight вес анимации.
|
||||
* @param speed скорость проигрывания анимации.
|
||||
*/
|
||||
public function MatrixAnimation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
super(object, weight, speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override protected function control(position:Number, weight:Number):void {
|
||||
if (matrix != null) {
|
||||
matrix.getKey(position, matrixKey);
|
||||
var mat:Matrix3D = matrixKey.matrix;
|
||||
var components:Vector.<Vector3D> = mat.decompose();
|
||||
var t:Vector3D = components[0];
|
||||
var r:Vector3D = components[1];
|
||||
var s:Vector3D = components[2];
|
||||
var c:Number;
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*t.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*t.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*t.z;
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, r.x, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, r.y, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, r.z, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*s.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*s.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*s.z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override public function updateLength():void {
|
||||
super.updateLength();
|
||||
if (matrix != null) {
|
||||
var len:Number = matrix.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
124
Alternativa3D7/7.3.3/src/alternativa/engine3d/animation/Track.as
Normal file
124
Alternativa3D7/7.3.3/src/alternativa/engine3d/animation/Track.as
Normal file
@@ -0,0 +1,124 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.animation.keys.Key;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами.
|
||||
*/
|
||||
public class Track {
|
||||
|
||||
/**
|
||||
* Ключевые кадры.
|
||||
*/
|
||||
public var keyList:Key;
|
||||
|
||||
/**
|
||||
* Добавляет ключевой кадр.
|
||||
*/
|
||||
public function addKey(key:Key):void {
|
||||
key.next = keyList;
|
||||
keyList = key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Сортирует ключевые кадры по времени.
|
||||
*/
|
||||
public function sortKeys():void {
|
||||
keyList = sortKeysByTime(keyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает кадр соответствующий заданному времени.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param key если не <code>null</code>, результат будет записан в этот объект.
|
||||
*/
|
||||
public function getKey(time:Number, key:Key = null):Key {
|
||||
var prev:Key;
|
||||
var next:Key = keyList;
|
||||
while (next != null && next.time < time) {
|
||||
prev = next;
|
||||
next = next.next;
|
||||
}
|
||||
if (prev != null) return prev.interpolate(time, next, key);
|
||||
if (next != null) return next.interpolate(time, null, key);
|
||||
return null;
|
||||
}
|
||||
|
||||
private function sortKeysByTime(list:Key):Key {
|
||||
var left:Key = list;
|
||||
var right:Key = list.next;
|
||||
while (right != null && right.next != null) {
|
||||
list = list.next;
|
||||
right = right.next.next;
|
||||
}
|
||||
right = list.next;
|
||||
list.next = null;
|
||||
if (left.next != null) {
|
||||
left = sortKeysByTime(left);
|
||||
}
|
||||
if (right.next != null) {
|
||||
right = sortKeysByTime(right);
|
||||
}
|
||||
var flag:Boolean = left.time < right.time;
|
||||
if (flag) {
|
||||
list = left;
|
||||
left = left.next;
|
||||
} else {
|
||||
list = right;
|
||||
right = right.next;
|
||||
}
|
||||
var last:Key = list;
|
||||
while (true) {
|
||||
if (left == null) {
|
||||
last.next = right;
|
||||
return list;
|
||||
} else if (right == null) {
|
||||
last.next = left;
|
||||
return list;
|
||||
}
|
||||
if (flag) {
|
||||
if (left.time < right.time) {
|
||||
last = left;
|
||||
left = left.next;
|
||||
} else {
|
||||
last.next = right;
|
||||
last = right;
|
||||
right = right.next;
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
if (right.time < left.time) {
|
||||
last = right;
|
||||
right = right.next;
|
||||
} else {
|
||||
last.next = left;
|
||||
last = left;
|
||||
left = left.next;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает время последнего ключевого кадра.
|
||||
*/
|
||||
public function get length():Number {
|
||||
if (keyList != null) {
|
||||
var key:Key = keyList;
|
||||
while (key.next != null) {
|
||||
key = key.next;
|
||||
}
|
||||
return key.time;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package alternativa.engine3d.animation {
|
||||
|
||||
import alternativa.engine3d.animation.keys.PointKey;
|
||||
import alternativa.engine3d.animation.keys.ValueKey;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
/**
|
||||
* Анимация компонентов положения и ориентации объекта.
|
||||
*/
|
||||
public class TransformAnimation extends Animation {
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами положения объекта.
|
||||
*/
|
||||
public var translation:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта.
|
||||
*/
|
||||
public var rotation:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта.
|
||||
*/
|
||||
public var scale:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси X.
|
||||
*/
|
||||
public var x:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси Y.
|
||||
*/
|
||||
public var y:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами перемещения объекта по оси Z.
|
||||
*/
|
||||
public var z:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси X.
|
||||
*/
|
||||
public var rotationX:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси Y.
|
||||
*/
|
||||
public var rotationY:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами вращения объекта по оси Z.
|
||||
*/
|
||||
public var rotationZ:Track;
|
||||
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси X.
|
||||
*/
|
||||
public var scaleX:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси Y.
|
||||
*/
|
||||
public var scaleY:Track;
|
||||
/**
|
||||
* Временная шкала с ключевыми кадрами масштаба объекта по оси Z.
|
||||
*/
|
||||
public var scaleZ:Track;
|
||||
|
||||
private var valueKey:ValueKey = new ValueKey(0, 0);
|
||||
private var pointKey:PointKey = new PointKey(0, 0, 0, 0);
|
||||
|
||||
/**
|
||||
* Конструктор анимации.
|
||||
*
|
||||
* @param object анимируемый объект.
|
||||
* @param weight вес анимации.
|
||||
* @param speed скорость проигрывания анимации.
|
||||
*/
|
||||
public function TransformAnimation(object:Object3D = null, weight:Number = 1.0, speed:Number = 1.0) {
|
||||
super(object, weight, speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override protected function control(position:Number, weight:Number):void {
|
||||
var c:Number;
|
||||
if (translation != null) {
|
||||
translation.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*pointKey.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*pointKey.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*pointKey.z;
|
||||
} else {
|
||||
if (x != null) {
|
||||
x.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_X, weight);
|
||||
object.x = (1 - c)*object.x + c*valueKey.value;
|
||||
}
|
||||
if (y != null) {
|
||||
y.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_Y, weight);
|
||||
object.y = (1 - c)*object.y + c*valueKey.value;
|
||||
}
|
||||
if (z != null) {
|
||||
z.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_Z, weight);
|
||||
object.z = (1 - c)*object.z + c*valueKey.value;
|
||||
}
|
||||
}
|
||||
if (rotation != null) {
|
||||
rotation.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, pointKey.x, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, pointKey.y, c);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, pointKey.z, c);
|
||||
} else {
|
||||
if (rotationX != null) {
|
||||
rotationX.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_X, weight);
|
||||
object.rotationX = interpolateAngle(object.rotationX, valueKey.value, c);
|
||||
}
|
||||
if (rotationY != null) {
|
||||
rotationY.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Y, weight);
|
||||
object.rotationY = interpolateAngle(object.rotationY, valueKey.value, c);
|
||||
}
|
||||
if (rotationZ != null) {
|
||||
rotationZ.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_ROT_Z, weight);
|
||||
object.rotationZ = interpolateAngle(object.rotationZ, valueKey.value, c);
|
||||
}
|
||||
}
|
||||
if (scale != null) {
|
||||
scale.getKey(position, pointKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*pointKey.x;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*pointKey.y;
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*pointKey.z;
|
||||
} else {
|
||||
if (scaleX != null) {
|
||||
scaleX.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_X, weight);
|
||||
object.scaleX = (1 - c)*object.scaleX + c*valueKey.value;
|
||||
}
|
||||
if (scaleY != null) {
|
||||
scaleY.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Y, weight);
|
||||
object.scaleY = (1 - c)*object.scaleY + c*valueKey.value;
|
||||
}
|
||||
if (scaleZ != null) {
|
||||
scaleZ.getKey(position, valueKey);
|
||||
c = calculateBlendInterpolation(WEIGHTS_SCALE_Z, weight);
|
||||
object.scaleZ = (1 - c)*object.scaleZ + c*valueKey.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
override public function updateLength():void {
|
||||
super.updateLength();
|
||||
var len:Number;
|
||||
if (translation != null) {
|
||||
len = translation.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotation != null) {
|
||||
len = rotation.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scale != null) {
|
||||
len = scale.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (x != null) {
|
||||
len = x.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (y != null) {
|
||||
len = y.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (z != null) {
|
||||
len = z.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationX != null) {
|
||||
len = rotationX.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationY != null) {
|
||||
len = rotationY.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (rotationZ != null) {
|
||||
len = rotationZ.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleX != null) {
|
||||
len = scaleX.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleY != null) {
|
||||
len = scaleY.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
if (scaleZ != null) {
|
||||
len = scaleZ.length;
|
||||
length = (len > length) ? len : length;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 112
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys
|
||||
END
|
||||
MatrixKey.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 125
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys/MatrixKey.as
|
||||
END
|
||||
PointKey.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 124
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys/PointKey.as
|
||||
END
|
||||
ValueKey.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 124
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys/ValueKey.as
|
||||
END
|
||||
Key.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 119
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys/Key.as
|
||||
END
|
||||
@@ -0,0 +1,80 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/animation/keys
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
MatrixKey.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
cc2536e9e35e64a528851a5d1e6cf9bd
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
has-props
|
||||
|
||||
PointKey.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
42c52d4ec09ada3ba69a2412bfca8d0e
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
has-props
|
||||
|
||||
ValueKey.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
60a17c8fd871989feed5646ac4ed0e98
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
has-props
|
||||
|
||||
Key.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
553285159808a04b934a6ec2a15240af
|
||||
2010-05-22T11:30:49.999590Z
|
||||
34748
|
||||
andrei
|
||||
has-props
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,12 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 954
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0/src/alternativa/engine3d/animation/Key.as:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/animation/Key.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/animation/Key.as:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa/engine3d/animation/Key.as:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa/engine3d/animation/Key.as:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa/engine3d/animation/Key.as:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa/engine3d/animation/Key.as:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa/engine3d/animation/Key.as:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
@@ -0,0 +1,12 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 1002
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0/src/alternativa/engine3d/animation/MatrixKey.as:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/animation/MatrixKey.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/animation/MatrixKey.as:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa/engine3d/animation/MatrixKey.as:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa/engine3d/animation/MatrixKey.as:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa/engine3d/animation/MatrixKey.as:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa/engine3d/animation/MatrixKey.as:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa/engine3d/animation/MatrixKey.as:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
@@ -0,0 +1,12 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 994
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0/src/alternativa/engine3d/animation/PointKey.as:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/animation/PointKey.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/animation/PointKey.as:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa/engine3d/animation/PointKey.as:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa/engine3d/animation/PointKey.as:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa/engine3d/animation/PointKey.as:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa/engine3d/animation/PointKey.as:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa/engine3d/animation/PointKey.as:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
@@ -0,0 +1,12 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 994
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0/src/alternativa/engine3d/animation/ValueKey.as:5796-7235
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/animation/ValueKey.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/animation/ValueKey.as:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa/engine3d/animation/ValueKey.as:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa/engine3d/animation/ValueKey.as:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa/engine3d/animation/ValueKey.as:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa/engine3d/animation/ValueKey.as:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa/engine3d/animation/ValueKey.as:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
@@ -0,0 +1,40 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр.
|
||||
*/
|
||||
public class Key {
|
||||
|
||||
/**
|
||||
* Время кадра.
|
||||
*/
|
||||
public var time:Number;
|
||||
/**
|
||||
* Ссылка на следующий ключевой кадр на верменной шкале.
|
||||
*
|
||||
* @see alternativa.engine3d.animation.Track
|
||||
*/
|
||||
public var next:Key;
|
||||
|
||||
/**
|
||||
* Создает экземпляр ключевого кадра.
|
||||
*
|
||||
* @param time время кадра.
|
||||
*/
|
||||
public function Key(time:Number) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
return key;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
import flash.geom.Matrix3D;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр матричного типа.
|
||||
*/
|
||||
public class MatrixKey extends Key {
|
||||
|
||||
private static const tempMatrix:Matrix3D = new Matrix3D();
|
||||
|
||||
/**
|
||||
* Значение ключа.
|
||||
*/
|
||||
public var matrix:Matrix3D;
|
||||
|
||||
/**
|
||||
* Создает ключевой кадр матричного типа.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param matrix значение кадра.
|
||||
*/
|
||||
public function MatrixKey(time:Number, matrix:Matrix3D) {
|
||||
super(time);
|
||||
this.matrix = matrix;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var mat:Matrix3D;
|
||||
if (next != null) {
|
||||
mat = tempMatrix;
|
||||
mat.identity();
|
||||
mat.append(matrix);
|
||||
mat.interpolateTo((next as MatrixKey).matrix, (time - this.time)/(next.time - this.time));
|
||||
} else {
|
||||
mat = matrix;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
MatrixKey(key).matrix = mat;
|
||||
return key;
|
||||
} else {
|
||||
return new MatrixKey(time, mat);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[MatrixKey " + time + ":" + matrix.rawData + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр точечного типа.
|
||||
*/
|
||||
public class PointKey extends Key {
|
||||
|
||||
/**
|
||||
* Координата по оси X.
|
||||
*/
|
||||
public var x:Number;
|
||||
/**
|
||||
* Координата по оси Y.
|
||||
*/
|
||||
public var y:Number;
|
||||
/**
|
||||
* Координата по оси Z.
|
||||
*/
|
||||
public var z:Number;
|
||||
|
||||
/**
|
||||
* Создает экземпляр ключевого кадра.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param x координата по оси X
|
||||
* @param y координата по оси Y
|
||||
* @param z координата по оси Z
|
||||
*/
|
||||
public function PointKey(time:Number, x:Number, y:Number, z:Number) {
|
||||
super(time);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var x:Number;
|
||||
var y:Number;
|
||||
var z:Number;
|
||||
if (next != null) {
|
||||
var t:Number = (time - this.time)/(next.time - this.time);
|
||||
x = this.x + (PointKey(next).x - this.x)*t;
|
||||
y = this.y + (PointKey(next).y - this.y)*t;
|
||||
z = this.z + (PointKey(next).z - this.z)*t;
|
||||
} else {
|
||||
x = this.x;
|
||||
y = this.y;
|
||||
z = this.z;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
PointKey(key).x = x;
|
||||
PointKey(key).y = y;
|
||||
PointKey(key).z = z;
|
||||
return key;
|
||||
} else {
|
||||
return new PointKey(time, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[PointKey " + time.toFixed(3) + ":" + x + "," + y + "," + z + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр вещественного типа.
|
||||
*/
|
||||
public class ValueKey extends Key {
|
||||
|
||||
/**
|
||||
* Значение ключевого кадра.
|
||||
*/
|
||||
public var value:Number;
|
||||
|
||||
/**
|
||||
* Создает ключевой кадр.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param value значение кадра.
|
||||
*/
|
||||
public function ValueKey(time:Number, value:Number) {
|
||||
super(time);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var value:Number;
|
||||
if (next != null) {
|
||||
value = this.value + (ValueKey(next).value - this.value)*(time - this.time)/(next.time - this.time);
|
||||
} else {
|
||||
value = this.value;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
ValueKey(key).value = value;
|
||||
return key;
|
||||
} else {
|
||||
return new ValueKey(time, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[ValueKey " + time + ":" + value + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр.
|
||||
*/
|
||||
public class Key {
|
||||
|
||||
/**
|
||||
* Время кадра.
|
||||
*/
|
||||
public var time:Number;
|
||||
/**
|
||||
* Ссылка на следующий ключевой кадр на верменной шкале.
|
||||
*
|
||||
* @see alternativa.engine3d.animation.Track
|
||||
*/
|
||||
public var next:Key;
|
||||
|
||||
/**
|
||||
* Создает экземпляр ключевого кадра.
|
||||
*
|
||||
* @param time время кадра.
|
||||
*/
|
||||
public function Key(time:Number) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
return key;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
import flash.geom.Matrix3D;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр матричного типа.
|
||||
*/
|
||||
public class MatrixKey extends Key {
|
||||
|
||||
private static const tempMatrix:Matrix3D = new Matrix3D();
|
||||
|
||||
/**
|
||||
* Значение ключа.
|
||||
*/
|
||||
public var matrix:Matrix3D;
|
||||
|
||||
/**
|
||||
* Создает ключевой кадр матричного типа.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param matrix значение кадра.
|
||||
*/
|
||||
public function MatrixKey(time:Number, matrix:Matrix3D) {
|
||||
super(time);
|
||||
this.matrix = matrix;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var mat:Matrix3D;
|
||||
if (next != null) {
|
||||
mat = tempMatrix;
|
||||
mat.identity();
|
||||
mat.append(matrix);
|
||||
mat.interpolateTo((next as MatrixKey).matrix, (time - this.time)/(next.time - this.time));
|
||||
} else {
|
||||
mat = matrix;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
MatrixKey(key).matrix = mat;
|
||||
return key;
|
||||
} else {
|
||||
return new MatrixKey(time, mat);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[MatrixKey " + time + ":" + matrix.rawData + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр точечного типа.
|
||||
*/
|
||||
public class PointKey extends Key {
|
||||
|
||||
/**
|
||||
* Координата по оси X.
|
||||
*/
|
||||
public var x:Number;
|
||||
/**
|
||||
* Координата по оси Y.
|
||||
*/
|
||||
public var y:Number;
|
||||
/**
|
||||
* Координата по оси Z.
|
||||
*/
|
||||
public var z:Number;
|
||||
|
||||
/**
|
||||
* Создает экземпляр ключевого кадра.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param x координата по оси X
|
||||
* @param y координата по оси Y
|
||||
* @param z координата по оси Z
|
||||
*/
|
||||
public function PointKey(time:Number, x:Number, y:Number, z:Number) {
|
||||
super(time);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var x:Number;
|
||||
var y:Number;
|
||||
var z:Number;
|
||||
if (next != null) {
|
||||
var t:Number = (time - this.time)/(next.time - this.time);
|
||||
x = this.x + (PointKey(next).x - this.x)*t;
|
||||
y = this.y + (PointKey(next).y - this.y)*t;
|
||||
z = this.z + (PointKey(next).z - this.z)*t;
|
||||
} else {
|
||||
x = this.x;
|
||||
y = this.y;
|
||||
z = this.z;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
PointKey(key).x = x;
|
||||
PointKey(key).y = y;
|
||||
PointKey(key).z = z;
|
||||
return key;
|
||||
} else {
|
||||
return new PointKey(time, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[PointKey " + time.toFixed(3) + ":" + x + "," + y + "," + z + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package alternativa.engine3d.animation.keys {
|
||||
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Ключевой кадр вещественного типа.
|
||||
*/
|
||||
public class ValueKey extends Key {
|
||||
|
||||
/**
|
||||
* Значение ключевого кадра.
|
||||
*/
|
||||
public var value:Number;
|
||||
|
||||
/**
|
||||
* Создает ключевой кадр.
|
||||
*
|
||||
* @param time время кадра.
|
||||
* @param value значение кадра.
|
||||
*/
|
||||
public function ValueKey(time:Number, value:Number) {
|
||||
super(time);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
override alternativa3d function interpolate(time:Number, next:Key, key:Key = null):Key {
|
||||
var value:Number;
|
||||
if (next != null) {
|
||||
value = this.value + (ValueKey(next).value - this.value)*(time - this.time)/(next.time - this.time);
|
||||
} else {
|
||||
value = this.value;
|
||||
}
|
||||
if (key != null) {
|
||||
key.time = time;
|
||||
ValueKey(key).value = value;
|
||||
return key;
|
||||
} else {
|
||||
return new ValueKey(time, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Строковое представление объекта.
|
||||
*/
|
||||
public function toString():String {
|
||||
return "[ValueKey " + time + ":" + value + "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 108
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/containers
|
||||
END
|
||||
KDTree.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 118
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/containers/KDTree.as
|
||||
END
|
||||
ConflictContainer.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 129
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/containers/ConflictContainer.as
|
||||
END
|
||||
ZSortContainer.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 126
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/containers/ZSortContainer.as
|
||||
END
|
||||
@@ -0,0 +1,65 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/containers
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-20T19:44:52.764604Z
|
||||
34680
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
KDTree.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
a06eaa5f3c1d823bd7ef45a4738af3ee
|
||||
2010-05-13T14:33:21.248432Z
|
||||
34417
|
||||
int
|
||||
|
||||
ConflictContainer.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
590d147fe1d76c4e2bfbada2eedee927
|
||||
2010-05-20T19:44:52.764604Z
|
||||
34680
|
||||
andrei
|
||||
has-props
|
||||
|
||||
ZSortContainer.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
f05946e9a20ee329ee93c08d56e49921
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,5 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 138
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/containers/ConflictContainer.as:33901-34679
|
||||
END
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
package alternativa.engine3d.containers {
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.core.Camera3D;
|
||||
import alternativa.engine3d.core.Canvas;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
import alternativa.engine3d.core.Object3DContainer;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Контейнер, дочерние объекты которого отрисовываются по удалённости от камеры
|
||||
*/
|
||||
public class ZSortContainer extends Object3DContainer {
|
||||
|
||||
static private const sortingStack:Vector.<int> = new Vector.<int>();
|
||||
|
||||
override protected function drawVisibleChildren(camera:Camera3D, object:Object3D, canvas:Canvas):void {
|
||||
var i:int;
|
||||
var j:int;
|
||||
var l:int = 0;
|
||||
var r:int = numVisibleChildren - 1;
|
||||
var child:Object3D;
|
||||
var stackIndex:int;
|
||||
var left:Number;
|
||||
var median:Number;
|
||||
var right:Number;
|
||||
sortingStack[0] = l;
|
||||
sortingStack[1] = r;
|
||||
stackIndex = 2;
|
||||
while (stackIndex > 0) {
|
||||
r = sortingStack[--stackIndex];
|
||||
l = sortingStack[--stackIndex];
|
||||
j = r;
|
||||
i = l;
|
||||
child = visibleChildren[(r + l) >> 1];
|
||||
median = child.ml;
|
||||
do {
|
||||
while ((left = (visibleChildren[i] as Object3D).ml) > median) i++;
|
||||
while ((right = (visibleChildren[j] as Object3D).ml) < median) j--;
|
||||
if (i <= j) {
|
||||
child = visibleChildren[i];
|
||||
visibleChildren[i++] = visibleChildren[j];
|
||||
visibleChildren[j--] = child;
|
||||
}
|
||||
} while (i <= j);
|
||||
if (l < j) {
|
||||
sortingStack[stackIndex++] = l;
|
||||
sortingStack[stackIndex++] = j;
|
||||
}
|
||||
if (i < r) {
|
||||
sortingStack[stackIndex++] = i;
|
||||
sortingStack[stackIndex++] = r;
|
||||
}
|
||||
}
|
||||
// Отрисовка
|
||||
for (i = numVisibleChildren - 1; i >= 0; i--) {
|
||||
child = visibleChildren[i];
|
||||
child.draw(camera, child, canvas);
|
||||
visibleChildren[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1165
Alternativa3D7/7.3.3/src/alternativa/engine3d/containers/KDTree.as
Normal file
1165
Alternativa3D7/7.3.3/src/alternativa/engine3d/containers/KDTree.as
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
package alternativa.engine3d.containers {
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.core.Camera3D;
|
||||
import alternativa.engine3d.core.Canvas;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
import alternativa.engine3d.core.Object3DContainer;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
/**
|
||||
* Контейнер, дочерние объекты которого отрисовываются по удалённости от камеры
|
||||
*/
|
||||
public class ZSortContainer extends Object3DContainer {
|
||||
|
||||
static private const sortingStack:Vector.<int> = new Vector.<int>();
|
||||
|
||||
override protected function drawVisibleChildren(camera:Camera3D, object:Object3D, canvas:Canvas):void {
|
||||
var i:int;
|
||||
var j:int;
|
||||
var l:int = 0;
|
||||
var r:int = numVisibleChildren - 1;
|
||||
var child:Object3D;
|
||||
var stackIndex:int;
|
||||
var left:Number;
|
||||
var median:Number;
|
||||
var right:Number;
|
||||
sortingStack[0] = l;
|
||||
sortingStack[1] = r;
|
||||
stackIndex = 2;
|
||||
while (stackIndex > 0) {
|
||||
r = sortingStack[--stackIndex];
|
||||
l = sortingStack[--stackIndex];
|
||||
j = r;
|
||||
i = l;
|
||||
child = visibleChildren[(r + l) >> 1];
|
||||
median = child.ml;
|
||||
do {
|
||||
while ((left = (visibleChildren[i] as Object3D).ml) > median) i++;
|
||||
while ((right = (visibleChildren[j] as Object3D).ml) < median) j--;
|
||||
if (i <= j) {
|
||||
child = visibleChildren[i];
|
||||
visibleChildren[i++] = visibleChildren[j];
|
||||
visibleChildren[j--] = child;
|
||||
}
|
||||
} while (i <= j);
|
||||
if (l < j) {
|
||||
sortingStack[stackIndex++] = l;
|
||||
sortingStack[stackIndex++] = j;
|
||||
}
|
||||
if (i < r) {
|
||||
sortingStack[stackIndex++] = i;
|
||||
sortingStack[stackIndex++] = r;
|
||||
}
|
||||
}
|
||||
// Отрисовка
|
||||
for (i = numVisibleChildren - 1; i >= 0; i--) {
|
||||
child = visibleChildren[i];
|
||||
child.draw(camera, child, canvas);
|
||||
visibleChildren[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 109
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/controllers
|
||||
END
|
||||
SimpleObjectController.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 135
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/controllers/SimpleObjectController.as
|
||||
END
|
||||
@@ -0,0 +1,40 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/controllers
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
SimpleObjectController.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
9b963056639e653a4c8af83541515acc
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,461 @@
|
||||
package alternativa.engine3d.controllers {
|
||||
import alternativa.engine3d.core.Camera3D;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
import flash.display.InteractiveObject;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Vector3D;
|
||||
import flash.ui.Keyboard;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SimpleObjectController {
|
||||
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вперёд.
|
||||
*/
|
||||
public static const ACTION_FORWARD:String = "ACTION_FORWARD";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения назад.
|
||||
*/
|
||||
public static const ACTION_BACK:String = "ACTION_BACK";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения влево.
|
||||
*/
|
||||
public static const ACTION_LEFT:String = "ACTION_LEFT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вправо.
|
||||
*/
|
||||
public static const ACTION_RIGHT:String = "ACTION_RIGHT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вверх.
|
||||
*/
|
||||
public static const ACTION_UP:String = "ACTION_UP";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вниз.
|
||||
*/
|
||||
public static const ACTION_DOWN:String = "ACTION_DOWN";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота вверх.
|
||||
*/
|
||||
public static const ACTION_PITCH_UP:String = "ACTION_PITCH_UP";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота вниз.
|
||||
*/
|
||||
public static const ACTION_PITCH_DOWN:String = "ACTION_PITCH_DOWN";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота налево.
|
||||
*/
|
||||
public static const ACTION_YAW_LEFT:String = "ACTION_YAW_LEFT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота направо.
|
||||
*/
|
||||
public static const ACTION_YAW_RIGHT:String = "ACTION_YAW_RIGHT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш увеличения скорости.
|
||||
*/
|
||||
public static const ACTION_ACCELERATE:String = "ACTION_ACCELERATE";
|
||||
/**
|
||||
* Имя действия для привязки клавиш активации обзора мышью.
|
||||
*/
|
||||
public static const ACTION_MOUSE_LOOK:String = "ACTION_MOUSE_LOOK";
|
||||
|
||||
|
||||
public var speed:Number;
|
||||
public var speedMultiplier:Number;
|
||||
public var mouseSensitivity:Number;
|
||||
public var maxPitch:Number = Number.MAX_VALUE;
|
||||
public var minPitch:Number = -Number.MAX_VALUE;
|
||||
|
||||
private var eventSource:InteractiveObject;
|
||||
private var _object:Object3D;
|
||||
|
||||
private var _up:Boolean;
|
||||
private var _down:Boolean;
|
||||
private var _forward:Boolean;
|
||||
private var _back:Boolean;
|
||||
private var _left:Boolean;
|
||||
private var _right:Boolean;
|
||||
private var _accelerate:Boolean;
|
||||
|
||||
private var displacement:Vector3D = new Vector3D();
|
||||
private var mousePoint:Point = new Point();
|
||||
private var mouseLook:Boolean;
|
||||
private var objectTransform:Vector.<Vector3D>;
|
||||
|
||||
private var time:int;
|
||||
|
||||
/**
|
||||
* Ассоциативный массив, связывающий имена команд с реализующими их функциями. Функции должны иметь вид
|
||||
* function(value:Boolean):void. Значение параметра <code>value</code> указывает, нажата или отпущена соответствующая команде
|
||||
* клавиша.
|
||||
*/
|
||||
private var actionBindings:Object = {};
|
||||
/**
|
||||
* Ассоциативный массив, связывающий коды клавиатурных клавиш с именами команд.
|
||||
*/
|
||||
protected var keyBindings:Object = {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param eventSource источник событий для контроллера
|
||||
* @param speed скорость поступательного перемещения объекта
|
||||
* @param mouseSensitivity чувствительность мыши - количество градусов поворота на один пиксель перемещения мыши
|
||||
*/
|
||||
public function SimpleObjectController(eventSource:InteractiveObject, object:Object3D, speed:Number, speedMultiplier:Number = 3, mouseSensitivity:Number = 1) {
|
||||
this.eventSource = eventSource;
|
||||
this.object = object;
|
||||
this.speed = speed;
|
||||
this.speedMultiplier = speedMultiplier;
|
||||
this.mouseSensitivity = mouseSensitivity;
|
||||
|
||||
actionBindings[ACTION_FORWARD] = moveForward;
|
||||
actionBindings[ACTION_BACK] = moveBack;
|
||||
actionBindings[ACTION_LEFT] = moveLeft;
|
||||
actionBindings[ACTION_RIGHT] = moveRight;
|
||||
actionBindings[ACTION_UP] = moveUp;
|
||||
actionBindings[ACTION_DOWN] = moveDown;
|
||||
actionBindings[ACTION_ACCELERATE] = accelerate;
|
||||
|
||||
setDefaultBindings();
|
||||
|
||||
enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Активирует контроллер.
|
||||
*/
|
||||
public function enable():void {
|
||||
eventSource.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
|
||||
eventSource.addEventListener(KeyboardEvent.KEY_UP, onKey);
|
||||
eventSource.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||
eventSource.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Деактивирует контроллер.
|
||||
*/
|
||||
public function disable():void {
|
||||
eventSource.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
|
||||
eventSource.removeEventListener(KeyboardEvent.KEY_UP, onKey);
|
||||
eventSource.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||
eventSource.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||
stopMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onMouseDown(e:MouseEvent):void {
|
||||
startMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onMouseUp(e:MouseEvent):void {
|
||||
stopMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
* Включает режим взгляда мышью.
|
||||
*/
|
||||
public function startMouseLook():void {
|
||||
mousePoint.x = eventSource.mouseX;
|
||||
mousePoint.y = eventSource.mouseY;
|
||||
mouseLook = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Отключает режим взгляда мышью.
|
||||
*/
|
||||
public function stopMouseLook():void {
|
||||
mouseLook = false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onKey(e:KeyboardEvent):void {
|
||||
var method:Function = keyBindings[e.keyCode];
|
||||
if (method != null) method.call(this, e.type == KeyboardEvent.KEY_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Управляемый объект.
|
||||
*/
|
||||
public function set object(value:Object3D):void {
|
||||
_object = value;
|
||||
updateObjectTransform();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function get object():Object3D {
|
||||
return _object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляет инофрмацию о трансформации объекта. Метод следует вызывать после изменения матрицы объекта вне контролллера.
|
||||
*/
|
||||
public function updateObjectTransform():void {
|
||||
if (_object != null) objectTransform = _object.getMatrix().decompose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Вычисляет новое положение объекта, используя внутренний счётчик времени.
|
||||
*/
|
||||
public function update():void {
|
||||
if (_object == null) return;
|
||||
|
||||
var frameTime:Number = time;
|
||||
time = getTimer();
|
||||
frameTime = 0.001*(time - frameTime);
|
||||
if (frameTime > 0.1) frameTime = 0.1;
|
||||
|
||||
var moved:Boolean = false;
|
||||
|
||||
if (mouseLook) {
|
||||
var dx:Number = eventSource.mouseX - mousePoint.x;
|
||||
var dy:Number = eventSource.mouseY - mousePoint.y;
|
||||
mousePoint.x = eventSource.mouseX;
|
||||
mousePoint.y = eventSource.mouseY;
|
||||
var v:Vector3D = objectTransform[1];
|
||||
v.x -= dy*Math.PI/180*mouseSensitivity;
|
||||
if (v.x > maxPitch) v.x = maxPitch;
|
||||
if (v.x < minPitch) v.x = minPitch;
|
||||
v.z -= dx*Math.PI/180*mouseSensitivity;
|
||||
moved = true;
|
||||
}
|
||||
|
||||
displacement.x = _right ? 1 : (_left ? -1 : 0);
|
||||
displacement.y = _forward ? 1 : (_back ? -1 : 0);
|
||||
displacement.z = _up ? 1 : (_down ? -1 : 0);
|
||||
if (displacement.lengthSquared > 0) {
|
||||
if (_object is Camera3D) {
|
||||
var tmp:Number = displacement.z;
|
||||
displacement.z = displacement.y;
|
||||
displacement.y = -tmp;
|
||||
}
|
||||
deltaTransformVector(displacement);
|
||||
if (_accelerate) displacement.scaleBy(speedMultiplier*speed*frameTime/displacement.length);
|
||||
else displacement.scaleBy(speed*frameTime/displacement.length);
|
||||
(objectTransform[0] as Vector3D).incrementBy(displacement);
|
||||
moved = true;
|
||||
}
|
||||
|
||||
if (moved) {
|
||||
var m:Matrix3D = new Matrix3D();
|
||||
m.recompose(objectTransform);
|
||||
_object.setMatrix(m);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pos
|
||||
*/
|
||||
public function setObjectPos(pos:Vector3D):void {
|
||||
if (_object != null) {
|
||||
var v:Vector3D = objectTransform[0];
|
||||
v.x = pos.x;
|
||||
v.y = pos.y;
|
||||
v.z = pos.z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public function setObjectPosXYZ(x:Number, y:Number, z:Number):void {
|
||||
if (_object != null) {
|
||||
var v:Vector3D = objectTransform[0];
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
v.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
public function lookAt(point:Vector3D):void {
|
||||
lookAtXYZ(point.x, point.y, point.z);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public function lookAtXYZ(x:Number, y:Number, z:Number):void {
|
||||
if (_object == null) return;
|
||||
var v:Vector3D = objectTransform[0];
|
||||
var dx:Number = x - v.x;
|
||||
var dy:Number = y - v.y;
|
||||
var dz:Number = z - v.z;
|
||||
v = objectTransform[1];
|
||||
v.x = Math.atan2(dz, Math.sqrt(dx*dx + dy*dy));
|
||||
if (_object is Camera3D) v.x -= 0.5*Math.PI;
|
||||
v.y = 0;
|
||||
v.z = -Math.atan2(dx, dy);
|
||||
var m:Matrix3D = _object.getMatrix();
|
||||
m.recompose(objectTransform);
|
||||
_object.setMatrix(m);
|
||||
}
|
||||
|
||||
private var _vin:Vector.<Number> = new Vector.<Number>(3);
|
||||
private var _vout:Vector.<Number> = new Vector.<Number>(3);
|
||||
|
||||
private function deltaTransformVector(v:Vector3D):void {
|
||||
_vin[0] = v.x;
|
||||
_vin[1] = v.y;
|
||||
_vin[2] = v.z;
|
||||
_object.getMatrix().transformVectors(_vin, _vout);
|
||||
var c:Vector3D = objectTransform[0];
|
||||
v.x = _vout[0] - c.x;
|
||||
v.y = _vout[1] - c.y;
|
||||
v.z = _vout[2] - c.z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вперёд.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveForward(value:Boolean):void {
|
||||
_forward = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения назад.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveBack(value:Boolean):void {
|
||||
_back = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения влево.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveLeft(value:Boolean):void {
|
||||
_left = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вправо.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveRight(value:Boolean):void {
|
||||
_right = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вверх.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveUp(value:Boolean):void {
|
||||
_up = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вниз.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveDown(value:Boolean):void {
|
||||
_down = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация режима увеличенной скорости.
|
||||
*
|
||||
* @param value <code>true</code> для включения ускорения, <code>false</code> для выключения
|
||||
*/
|
||||
public function accelerate(value:Boolean):void {
|
||||
_accelerate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод выполняет привязку клавиши к действию. Одной клавише может быть назначено только одно действие.
|
||||
*
|
||||
* @param keyCode код клавиши
|
||||
* @param action наименование действия
|
||||
*
|
||||
* @see #unbindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function bindKey(keyCode:uint, action:String):void {
|
||||
var method:Function = actionBindings[action];
|
||||
if (method != null) keyBindings[keyCode] = method;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function bindKeys(bindings:Array):void {
|
||||
for (var i:int = 0; i < bindings.length; i += 2) bindKey(bindings[i], bindings[i + 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка привязки клавиши.
|
||||
*
|
||||
* @param keyCode код клавиши
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function unbindKey(keyCode:uint):void {
|
||||
delete keyBindings[keyCode];
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка привязки всех клавиш.
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindKey()
|
||||
*/
|
||||
public function unbindAll():void {
|
||||
for (var key:String in keyBindings) delete keyBindings[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод устанавливает привязки клавиш по умолчанию. Реализация по умолчанию не делает ничего.
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function setDefaultBindings():void {
|
||||
bindKey(87, ACTION_FORWARD);
|
||||
bindKey(83, ACTION_BACK);
|
||||
bindKey(65, ACTION_LEFT);
|
||||
bindKey(68, ACTION_RIGHT);
|
||||
bindKey(69, ACTION_UP);
|
||||
bindKey(67, ACTION_DOWN);
|
||||
bindKey(Keyboard.SHIFT, ACTION_ACCELERATE);
|
||||
|
||||
bindKey(Keyboard.UP, ACTION_FORWARD);
|
||||
bindKey(Keyboard.DOWN, ACTION_BACK);
|
||||
bindKey(Keyboard.LEFT, ACTION_LEFT);
|
||||
bindKey(Keyboard.RIGHT, ACTION_RIGHT);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,461 @@
|
||||
package alternativa.engine3d.controllers {
|
||||
import alternativa.engine3d.core.Camera3D;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
|
||||
import flash.display.InteractiveObject;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Vector3D;
|
||||
import flash.ui.Keyboard;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SimpleObjectController {
|
||||
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вперёд.
|
||||
*/
|
||||
public static const ACTION_FORWARD:String = "ACTION_FORWARD";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения назад.
|
||||
*/
|
||||
public static const ACTION_BACK:String = "ACTION_BACK";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения влево.
|
||||
*/
|
||||
public static const ACTION_LEFT:String = "ACTION_LEFT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вправо.
|
||||
*/
|
||||
public static const ACTION_RIGHT:String = "ACTION_RIGHT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вверх.
|
||||
*/
|
||||
public static const ACTION_UP:String = "ACTION_UP";
|
||||
/**
|
||||
* Имя действия для привязки клавиш движения вниз.
|
||||
*/
|
||||
public static const ACTION_DOWN:String = "ACTION_DOWN";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота вверх.
|
||||
*/
|
||||
public static const ACTION_PITCH_UP:String = "ACTION_PITCH_UP";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота вниз.
|
||||
*/
|
||||
public static const ACTION_PITCH_DOWN:String = "ACTION_PITCH_DOWN";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота налево.
|
||||
*/
|
||||
public static const ACTION_YAW_LEFT:String = "ACTION_YAW_LEFT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш поворота направо.
|
||||
*/
|
||||
public static const ACTION_YAW_RIGHT:String = "ACTION_YAW_RIGHT";
|
||||
/**
|
||||
* Имя действия для привязки клавиш увеличения скорости.
|
||||
*/
|
||||
public static const ACTION_ACCELERATE:String = "ACTION_ACCELERATE";
|
||||
/**
|
||||
* Имя действия для привязки клавиш активации обзора мышью.
|
||||
*/
|
||||
public static const ACTION_MOUSE_LOOK:String = "ACTION_MOUSE_LOOK";
|
||||
|
||||
|
||||
public var speed:Number;
|
||||
public var speedMultiplier:Number;
|
||||
public var mouseSensitivity:Number;
|
||||
public var maxPitch:Number = Number.MAX_VALUE;
|
||||
public var minPitch:Number = -Number.MAX_VALUE;
|
||||
|
||||
private var eventSource:InteractiveObject;
|
||||
private var _object:Object3D;
|
||||
|
||||
private var _up:Boolean;
|
||||
private var _down:Boolean;
|
||||
private var _forward:Boolean;
|
||||
private var _back:Boolean;
|
||||
private var _left:Boolean;
|
||||
private var _right:Boolean;
|
||||
private var _accelerate:Boolean;
|
||||
|
||||
private var displacement:Vector3D = new Vector3D();
|
||||
private var mousePoint:Point = new Point();
|
||||
private var mouseLook:Boolean;
|
||||
private var objectTransform:Vector.<Vector3D>;
|
||||
|
||||
private var time:int;
|
||||
|
||||
/**
|
||||
* Ассоциативный массив, связывающий имена команд с реализующими их функциями. Функции должны иметь вид
|
||||
* function(value:Boolean):void. Значение параметра <code>value</code> указывает, нажата или отпущена соответствующая команде
|
||||
* клавиша.
|
||||
*/
|
||||
private var actionBindings:Object = {};
|
||||
/**
|
||||
* Ассоциативный массив, связывающий коды клавиатурных клавиш с именами команд.
|
||||
*/
|
||||
protected var keyBindings:Object = {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param eventSource источник событий для контроллера
|
||||
* @param speed скорость поступательного перемещения объекта
|
||||
* @param mouseSensitivity чувствительность мыши - количество градусов поворота на один пиксель перемещения мыши
|
||||
*/
|
||||
public function SimpleObjectController(eventSource:InteractiveObject, object:Object3D, speed:Number, speedMultiplier:Number = 3, mouseSensitivity:Number = 1) {
|
||||
this.eventSource = eventSource;
|
||||
this.object = object;
|
||||
this.speed = speed;
|
||||
this.speedMultiplier = speedMultiplier;
|
||||
this.mouseSensitivity = mouseSensitivity;
|
||||
|
||||
actionBindings[ACTION_FORWARD] = moveForward;
|
||||
actionBindings[ACTION_BACK] = moveBack;
|
||||
actionBindings[ACTION_LEFT] = moveLeft;
|
||||
actionBindings[ACTION_RIGHT] = moveRight;
|
||||
actionBindings[ACTION_UP] = moveUp;
|
||||
actionBindings[ACTION_DOWN] = moveDown;
|
||||
actionBindings[ACTION_ACCELERATE] = accelerate;
|
||||
|
||||
setDefaultBindings();
|
||||
|
||||
enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Активирует контроллер.
|
||||
*/
|
||||
public function enable():void {
|
||||
eventSource.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
|
||||
eventSource.addEventListener(KeyboardEvent.KEY_UP, onKey);
|
||||
eventSource.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||
eventSource.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Деактивирует контроллер.
|
||||
*/
|
||||
public function disable():void {
|
||||
eventSource.removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
|
||||
eventSource.removeEventListener(KeyboardEvent.KEY_UP, onKey);
|
||||
eventSource.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||
eventSource.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||
stopMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onMouseDown(e:MouseEvent):void {
|
||||
startMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onMouseUp(e:MouseEvent):void {
|
||||
stopMouseLook();
|
||||
}
|
||||
|
||||
/**
|
||||
* Включает режим взгляда мышью.
|
||||
*/
|
||||
public function startMouseLook():void {
|
||||
mousePoint.x = eventSource.mouseX;
|
||||
mousePoint.y = eventSource.mouseY;
|
||||
mouseLook = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Отключает режим взгляда мышью.
|
||||
*/
|
||||
public function stopMouseLook():void {
|
||||
mouseLook = false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function onKey(e:KeyboardEvent):void {
|
||||
var method:Function = keyBindings[e.keyCode];
|
||||
if (method != null) method.call(this, e.type == KeyboardEvent.KEY_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Управляемый объект.
|
||||
*/
|
||||
public function set object(value:Object3D):void {
|
||||
_object = value;
|
||||
updateObjectTransform();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function get object():Object3D {
|
||||
return _object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляет инофрмацию о трансформации объекта. Метод следует вызывать после изменения матрицы объекта вне контролллера.
|
||||
*/
|
||||
public function updateObjectTransform():void {
|
||||
if (_object != null) objectTransform = _object.getMatrix().decompose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Вычисляет новое положение объекта, используя внутренний счётчик времени.
|
||||
*/
|
||||
public function update():void {
|
||||
if (_object == null) return;
|
||||
|
||||
var frameTime:Number = time;
|
||||
time = getTimer();
|
||||
frameTime = 0.001*(time - frameTime);
|
||||
if (frameTime > 0.1) frameTime = 0.1;
|
||||
|
||||
var moved:Boolean = false;
|
||||
|
||||
if (mouseLook) {
|
||||
var dx:Number = eventSource.mouseX - mousePoint.x;
|
||||
var dy:Number = eventSource.mouseY - mousePoint.y;
|
||||
mousePoint.x = eventSource.mouseX;
|
||||
mousePoint.y = eventSource.mouseY;
|
||||
var v:Vector3D = objectTransform[1];
|
||||
v.x -= dy*Math.PI/180*mouseSensitivity;
|
||||
if (v.x > maxPitch) v.x = maxPitch;
|
||||
if (v.x < minPitch) v.x = minPitch;
|
||||
v.z -= dx*Math.PI/180*mouseSensitivity;
|
||||
moved = true;
|
||||
}
|
||||
|
||||
displacement.x = _right ? 1 : (_left ? -1 : 0);
|
||||
displacement.y = _forward ? 1 : (_back ? -1 : 0);
|
||||
displacement.z = _up ? 1 : (_down ? -1 : 0);
|
||||
if (displacement.lengthSquared > 0) {
|
||||
if (_object is Camera3D) {
|
||||
var tmp:Number = displacement.z;
|
||||
displacement.z = displacement.y;
|
||||
displacement.y = -tmp;
|
||||
}
|
||||
deltaTransformVector(displacement);
|
||||
if (_accelerate) displacement.scaleBy(speedMultiplier*speed*frameTime/displacement.length);
|
||||
else displacement.scaleBy(speed*frameTime/displacement.length);
|
||||
(objectTransform[0] as Vector3D).incrementBy(displacement);
|
||||
moved = true;
|
||||
}
|
||||
|
||||
if (moved) {
|
||||
var m:Matrix3D = new Matrix3D();
|
||||
m.recompose(objectTransform);
|
||||
_object.setMatrix(m);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pos
|
||||
*/
|
||||
public function setObjectPos(pos:Vector3D):void {
|
||||
if (_object != null) {
|
||||
var v:Vector3D = objectTransform[0];
|
||||
v.x = pos.x;
|
||||
v.y = pos.y;
|
||||
v.z = pos.z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public function setObjectPosXYZ(x:Number, y:Number, z:Number):void {
|
||||
if (_object != null) {
|
||||
var v:Vector3D = objectTransform[0];
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
v.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
public function lookAt(point:Vector3D):void {
|
||||
lookAtXYZ(point.x, point.y, point.z);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public function lookAtXYZ(x:Number, y:Number, z:Number):void {
|
||||
if (_object == null) return;
|
||||
var v:Vector3D = objectTransform[0];
|
||||
var dx:Number = x - v.x;
|
||||
var dy:Number = y - v.y;
|
||||
var dz:Number = z - v.z;
|
||||
v = objectTransform[1];
|
||||
v.x = Math.atan2(dz, Math.sqrt(dx*dx + dy*dy));
|
||||
if (_object is Camera3D) v.x -= 0.5*Math.PI;
|
||||
v.y = 0;
|
||||
v.z = -Math.atan2(dx, dy);
|
||||
var m:Matrix3D = _object.getMatrix();
|
||||
m.recompose(objectTransform);
|
||||
_object.setMatrix(m);
|
||||
}
|
||||
|
||||
private var _vin:Vector.<Number> = new Vector.<Number>(3);
|
||||
private var _vout:Vector.<Number> = new Vector.<Number>(3);
|
||||
|
||||
private function deltaTransformVector(v:Vector3D):void {
|
||||
_vin[0] = v.x;
|
||||
_vin[1] = v.y;
|
||||
_vin[2] = v.z;
|
||||
_object.getMatrix().transformVectors(_vin, _vout);
|
||||
var c:Vector3D = objectTransform[0];
|
||||
v.x = _vout[0] - c.x;
|
||||
v.y = _vout[1] - c.y;
|
||||
v.z = _vout[2] - c.z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вперёд.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveForward(value:Boolean):void {
|
||||
_forward = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения назад.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveBack(value:Boolean):void {
|
||||
_back = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения влево.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveLeft(value:Boolean):void {
|
||||
_left = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вправо.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveRight(value:Boolean):void {
|
||||
_right = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вверх.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveUp(value:Boolean):void {
|
||||
_up = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация движения вниз.
|
||||
*
|
||||
* @param value <code>true</code> для начала движения, <code>false</code> для окончания
|
||||
*/
|
||||
public function moveDown(value:Boolean):void {
|
||||
_down = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Активация режима увеличенной скорости.
|
||||
*
|
||||
* @param value <code>true</code> для включения ускорения, <code>false</code> для выключения
|
||||
*/
|
||||
public function accelerate(value:Boolean):void {
|
||||
_accelerate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод выполняет привязку клавиши к действию. Одной клавише может быть назначено только одно действие.
|
||||
*
|
||||
* @param keyCode код клавиши
|
||||
* @param action наименование действия
|
||||
*
|
||||
* @see #unbindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function bindKey(keyCode:uint, action:String):void {
|
||||
var method:Function = actionBindings[action];
|
||||
if (method != null) keyBindings[keyCode] = method;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function bindKeys(bindings:Array):void {
|
||||
for (var i:int = 0; i < bindings.length; i += 2) bindKey(bindings[i], bindings[i + 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка привязки клавиши.
|
||||
*
|
||||
* @param keyCode код клавиши
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function unbindKey(keyCode:uint):void {
|
||||
delete keyBindings[keyCode];
|
||||
}
|
||||
|
||||
/**
|
||||
* Очистка привязки всех клавиш.
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindKey()
|
||||
*/
|
||||
public function unbindAll():void {
|
||||
for (var key:String in keyBindings) delete keyBindings[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Метод устанавливает привязки клавиш по умолчанию. Реализация по умолчанию не делает ничего.
|
||||
*
|
||||
* @see #bindKey()
|
||||
* @see #unbindKey()
|
||||
* @see #unbindAll()
|
||||
*/
|
||||
public function setDefaultBindings():void {
|
||||
bindKey(87, ACTION_FORWARD);
|
||||
bindKey(83, ACTION_BACK);
|
||||
bindKey(65, ACTION_LEFT);
|
||||
bindKey(68, ACTION_RIGHT);
|
||||
bindKey(69, ACTION_UP);
|
||||
bindKey(67, ACTION_DOWN);
|
||||
bindKey(Keyboard.SHIFT, ACTION_ACCELERATE);
|
||||
|
||||
bindKey(Keyboard.UP, ACTION_FORWARD);
|
||||
bindKey(Keyboard.DOWN, ACTION_BACK);
|
||||
bindKey(Keyboard.LEFT, ACTION_LEFT);
|
||||
bindKey(Keyboard.RIGHT, ACTION_RIGHT);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 102
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core
|
||||
END
|
||||
Vertex.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 112
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Vertex.as
|
||||
END
|
||||
Camera3D.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Camera3D.as
|
||||
END
|
||||
Wrapper.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 113
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Wrapper.as
|
||||
END
|
||||
MouseEvent3D.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 118
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/MouseEvent3D.as
|
||||
END
|
||||
Sorting.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 113
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Sorting.as
|
||||
END
|
||||
Debug.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 111
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Debug.as
|
||||
END
|
||||
Geometry.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Geometry.as
|
||||
END
|
||||
Object3D.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Object3D.as
|
||||
END
|
||||
Face.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 110
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Face.as
|
||||
END
|
||||
Object3DContainer.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 123
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Object3DContainer.as
|
||||
END
|
||||
MipMapping.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 116
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/MipMapping.as
|
||||
END
|
||||
KDNode.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 112
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/KDNode.as
|
||||
END
|
||||
Clipping.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 114
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Clipping.as
|
||||
END
|
||||
View.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 110
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/View.as
|
||||
END
|
||||
Canvas.as
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 112
|
||||
/!svn/ver/34871/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core/Canvas.as
|
||||
END
|
||||
210
Alternativa3D7/7.3.3/src/alternativa/engine3d/core/.svn/entries
Normal file
210
Alternativa3D7/7.3.3/src/alternativa/engine3d/core/.svn/entries
Normal file
@@ -0,0 +1,210 @@
|
||||
8
|
||||
|
||||
dir
|
||||
46043
|
||||
http://svndev.alternativaplatform.com/platform/clients/fp10/libraries/Alternativa3D/tags/7.3.3/src/alternativa/engine3d/core
|
||||
http://svndev.alternativaplatform.com
|
||||
|
||||
|
||||
|
||||
2010-05-20T19:44:52.764604Z
|
||||
34680
|
||||
andrei
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d9e2387a-1f3e-40e2-b57f-9df5970a2fa5
|
||||
|
||||
Vertex.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
e7d6bc37ceb1a054bc23a2dcd6e97e29
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
Camera3D.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
a644f0f04901f2c92ba675f0e3efef5f
|
||||
2010-05-11T09:30:45.669662Z
|
||||
34050
|
||||
mike
|
||||
|
||||
Wrapper.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
513941c492ab086771467da714b7b0fc
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
MouseEvent3D.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
12c76be4ba88acd1233efd8c581ed50c
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
Sorting.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
3c7dcaaaba92b034f5d0f412dc65ad24
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
Debug.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
9e31ff185211a6b3fc24e3b7baa67fbd
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
Geometry.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
7b70975ffedbf4ae2c585b9004e4ca84
|
||||
2010-05-10T08:11:08.511870Z
|
||||
33876
|
||||
int
|
||||
|
||||
Object3D.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
bd837dec30a6ce71b7e1074f19ed9aa2
|
||||
2010-05-20T19:44:52.764604Z
|
||||
34680
|
||||
andrei
|
||||
has-props
|
||||
|
||||
Face.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
8526fe9b569cdcc7ac94de3e28aa717a
|
||||
2010-05-06T08:17:52.262888Z
|
||||
33368
|
||||
int
|
||||
|
||||
Object3DContainer.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
88a676aba896f89af0f93fc9361fb70e
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
MipMapping.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
9e7a47ccc6eee25477bb0e690961f15e
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
KDNode.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
d219d3397d5bdd05ba7c0e0e590ba72b
|
||||
2010-05-13T14:33:21.248432Z
|
||||
34417
|
||||
int
|
||||
|
||||
Clipping.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
06490fb112aadc5c23187f3c7c13ae47
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
View.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
90d101b09f71c36f3eb5c49c6c2a2f57
|
||||
2010-03-22T12:49:02.467799Z
|
||||
30189
|
||||
int
|
||||
|
||||
Canvas.as
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-28T04:31:22.000000Z
|
||||
8deae7c644fffe69c504fa2eeee9fa97
|
||||
2010-05-20T19:44:52.764604Z
|
||||
34680
|
||||
andrei
|
||||
has-props
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
8
|
||||
@@ -0,0 +1,6 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 241
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/core/Canvas.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/core/Canvas.as:33901-34679
|
||||
END
|
||||
@@ -0,0 +1,11 @@
|
||||
K 13
|
||||
svn:mergeinfo
|
||||
V 842
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.0.2/src/alternativa/engine3d/core/Object3D.as:17447,17456-18883
|
||||
/platform/clients/fp10/libraries/Alternativa3D/branches/7.3.Animation/src/alternativa/engine3d/core/Object3D.as:33901-34679
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4/alternativa/engine3d/core/Object3D.as:304-463
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.MouseEvents/src/alternativa/engine3d/core/Object3D.as:1556-1900
|
||||
/platform/clients/fp9/libraries/Alternativa3D/branches/5.4.SingularMapping/src/alternativa/engine3d/core/Object3D.as:2042-2060
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/alternativa/engine3d/core/Object3D.as:304-494
|
||||
/platform/clients/fp9/libraries/Alternativa3D/trunk/src/alternativa/engine3d/core/Object3D.as:1465-2616,2621-2676,2680-2696,2710-2743,2778-2783
|
||||
END
|
||||
@@ -0,0 +1,608 @@
|
||||
package alternativa.engine3d.core {
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.Sprite;
|
||||
import flash.display.StageAlign;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.geom.Vector3D;
|
||||
import flash.system.System;
|
||||
import flash.text.TextField;
|
||||
import flash.text.TextFieldAutoSize;
|
||||
import flash.text.TextFormat;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getDefinitionByName;
|
||||
import flash.utils.getQualifiedClassName;
|
||||
import flash.utils.getQualifiedSuperclassName;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class Camera3D extends Object3D {
|
||||
|
||||
/**
|
||||
* Вьюпорт
|
||||
*/
|
||||
public var view:View;
|
||||
/**
|
||||
* Поле зрения в радианах.
|
||||
*/
|
||||
public var fov:Number = Math.PI/2;
|
||||
|
||||
public var nearClipping:Number = 0;
|
||||
public var farClipping:Number = 5000;
|
||||
|
||||
// Параметры перспективы
|
||||
alternativa3d var viewSizeX:Number;
|
||||
alternativa3d var viewSizeY:Number;
|
||||
alternativa3d var focalLength:Number;
|
||||
|
||||
// Перекрытия
|
||||
alternativa3d var occluders:Vector.<Vertex> = new Vector.<Vertex>();
|
||||
alternativa3d var numOccluders:int;
|
||||
alternativa3d var occludedAll:Boolean;
|
||||
|
||||
alternativa3d var numDraws:int;
|
||||
alternativa3d var numPolygons:int;
|
||||
alternativa3d var numTriangles:int;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fov
|
||||
* @param nearClipping
|
||||
* @param farClipping
|
||||
*/
|
||||
public function Camera3D(fov:Number = 1.5707963267948966, nearClipping:Number = 0, farClipping:Number = 5000) {
|
||||
this.fov = fov;
|
||||
this.nearClipping = nearClipping;
|
||||
this.farClipping = farClipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Отрисовка иерархии объектов, в которой находится камера.
|
||||
* Перед render(), если менялись параметры камеры, нужно вызвать updateProjection().
|
||||
*/
|
||||
public function render():void {
|
||||
if (view != null) {
|
||||
// Расчёт параметров проецирования
|
||||
viewSizeX = view._width*0.5;
|
||||
viewSizeY = view._height*0.5;
|
||||
focalLength = Math.sqrt(viewSizeX*viewSizeX + viewSizeY*viewSizeY)/Math.tan(fov*0.5);
|
||||
// Расчёт матрицы перевода из глобального пространства в камеру
|
||||
composeMatrix();
|
||||
var root:Object3D = this;
|
||||
while (root._parent != null) {
|
||||
root = root._parent;
|
||||
root.composeMatrix();
|
||||
appendMatrix(root);
|
||||
}
|
||||
invertMatrix();
|
||||
// Сброс окклюдеров
|
||||
numOccluders = 0;
|
||||
occludedAll = false;
|
||||
// Сброс счётчиков
|
||||
numDraws = 0;
|
||||
numPolygons = 0;
|
||||
numTriangles = 0;
|
||||
// Сброс отрисовок
|
||||
view.numDraws = 0;
|
||||
// Отрисовка
|
||||
if (root != this && root.visible) {
|
||||
root.appendMatrix(this);
|
||||
if (root.cullingInCamera(this, root, 63) >= 0) {
|
||||
root.draw(this, root, view);
|
||||
// Отложенное удаление вершин и граней в коллектор
|
||||
deferredDestroy();
|
||||
// Зачистка окклюдеров
|
||||
clearOccluders();
|
||||
}
|
||||
}
|
||||
// Зачистка ненужных канвасов
|
||||
view.removeChildren(view.numDraws);
|
||||
// Обработка интерактивности после рендера
|
||||
if (view._interactive) {
|
||||
view.onMouseMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override alternativa3d function composeMatrix():void {
|
||||
var cosX:Number = Math.cos(rotationX);
|
||||
var sinX:Number = Math.sin(rotationX);
|
||||
var cosY:Number = Math.cos(rotationY);
|
||||
var sinY:Number = Math.sin(rotationY);
|
||||
var cosZ:Number = Math.cos(rotationZ);
|
||||
var sinZ:Number = Math.sin(rotationZ);
|
||||
var cosZsinY:Number = cosZ*sinY;
|
||||
var sinZsinY:Number = sinZ*sinY;
|
||||
var cosYscaleX:Number = cosY*scaleX*viewSizeX/focalLength;
|
||||
var sinXscaleY:Number = sinX*scaleY*viewSizeY/focalLength;
|
||||
var cosXscaleY:Number = cosX*scaleY*viewSizeY/focalLength;
|
||||
var cosXscaleZ:Number = cosX*scaleZ;
|
||||
var sinXscaleZ:Number = sinX*scaleZ;
|
||||
ma = cosZ*cosYscaleX;
|
||||
mb = cosZsinY*sinXscaleY - sinZ*cosXscaleY;
|
||||
mc = cosZsinY*cosXscaleZ + sinZ*sinXscaleZ;
|
||||
md = x;
|
||||
me = sinZ*cosYscaleX;
|
||||
mf = sinZsinY*sinXscaleY + cosZ*cosXscaleY;
|
||||
mg = sinZsinY*cosXscaleZ - cosZ*sinXscaleZ;
|
||||
mh = y;
|
||||
mi = -sinY*scaleX;
|
||||
mj = cosY*sinXscaleY;
|
||||
mk = cosY*cosXscaleZ;
|
||||
ml = z;
|
||||
}
|
||||
|
||||
private function invertMatrix():void {
|
||||
var a:Number = ma;
|
||||
var b:Number = mb;
|
||||
var c:Number = mc;
|
||||
var d:Number = md;
|
||||
var e:Number = me;
|
||||
var f:Number = mf;
|
||||
var g:Number = mg;
|
||||
var h:Number = mh;
|
||||
var i:Number = mi;
|
||||
var j:Number = mj;
|
||||
var k:Number = mk;
|
||||
var l:Number = ml;
|
||||
var det:Number = 1/(-c*f*i + b*g*i + c*e*j - a*g*j - b*e*k + a*f*k);
|
||||
ma = (-g*j + f*k)*det;
|
||||
mb = (c*j - b*k)*det;
|
||||
mc = (-c*f + b*g)*det;
|
||||
md = (d*g*j - c*h*j - d*f*k + b*h*k + c*f*l - b*g*l)*det;
|
||||
me = (g*i - e*k)*det;
|
||||
mf = (-c*i + a*k)*det;
|
||||
mg = (c*e - a*g)*det;
|
||||
mh = (c*h*i - d*g*i + d*e*k - a*h*k - c*e*l + a*g*l)*det;
|
||||
mi = (-f*i + e*j)*det;
|
||||
mj = (b*i - a*j)*det;
|
||||
mk = (-b*e + a*f)*det;
|
||||
ml = (d*f*i - b*h*i - d*e*j + a*h*j + b*e*l - a*f*l)*det;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param v
|
||||
* @param result
|
||||
*/
|
||||
public function projectGlobal(v:Vector3D, result:Vector3D):void {
|
||||
composeMatrix();
|
||||
var root:Object3D = this;
|
||||
while (root._parent != null) {
|
||||
root = root._parent;
|
||||
root.composeMatrix();
|
||||
appendMatrix(root);
|
||||
}
|
||||
invertMatrix();
|
||||
var x:Number = ma*v.x + mb*v.y + mc*v.z + md;
|
||||
var y:Number = me*v.x + mf*v.y + mg*v.z + mh;
|
||||
var z:Number = mi*v.x + mj*v.y + mk*v.z + ml;
|
||||
result.x = x*viewSizeX/z + view._width/2;
|
||||
result.y = y*viewSizeY/z + view._height/2;
|
||||
result.z = z;
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
// Режим отладки
|
||||
public var debug:Boolean = false;
|
||||
|
||||
// Список объектов дебага
|
||||
private var debugSet:Object = new Object();
|
||||
|
||||
// Добавить в дебаг
|
||||
public function addToDebug(debug:int, ... rest):void {
|
||||
if (!debugSet[debug]) debugSet[debug] = new Dictionary();
|
||||
for (var i:int = 0; i < rest.length;) debugSet[debug][rest[i++]] = true;
|
||||
}
|
||||
|
||||
// Убрать из дебага
|
||||
public function removeFromDebug(debug:int, ... rest):void {
|
||||
if (debugSet[debug]) {
|
||||
for (var i:int = 0; i < rest.length;) delete debugSet[debug][rest[i++]];
|
||||
var key:*;
|
||||
for (key in debugSet[debug]) break;
|
||||
if (!key) delete debugSet[debug];
|
||||
}
|
||||
}
|
||||
|
||||
// Проверка, находится ли объект или один из классов, от которых он нследован, в дебаге
|
||||
alternativa3d function checkInDebug(object:Object3D):int {
|
||||
var res:int = 0;
|
||||
for (var debug:int = 1; debug <= 512; debug <<= 1) {
|
||||
if (debugSet[debug]) {
|
||||
if (debugSet[debug][Object3D] || debugSet[debug][object]) {
|
||||
res |= debug;
|
||||
} else {
|
||||
var objectClass:Class = getDefinitionByName(getQualifiedClassName(object)) as Class;
|
||||
while (objectClass != Object3D) {
|
||||
if (debugSet[debug][objectClass]) {
|
||||
res |= debug;
|
||||
break;
|
||||
}
|
||||
objectClass = Class(getDefinitionByName(getQualifiedSuperclassName(objectClass)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public var diagram:Sprite = createDiagram();
|
||||
|
||||
private var fpsTextField:TextField;
|
||||
private var memoryTextField:TextField;
|
||||
private var drawsTextField:TextField;
|
||||
private var polygonsTextField:TextField;
|
||||
private var trianglesTextField:TextField;
|
||||
private var timerTextField:TextField;
|
||||
private var graph:Bitmap;
|
||||
private var rect:Rectangle;
|
||||
|
||||
private var _diagramAlign:String = "TR";
|
||||
private var _diagramHorizontalMargin:Number = 2;
|
||||
private var _diagramVerticalMargin:Number = 2;
|
||||
|
||||
public var fpsUpdatePeriod:int = 10;
|
||||
private var fpsUpdateCounter:int;
|
||||
private var previousFrameTime:int;
|
||||
private var previousPeriodTime:int;
|
||||
|
||||
private var maxMemory:int;
|
||||
|
||||
public var timerUpdatePeriod:int = 10;
|
||||
private var timerUpdateCounter:int;
|
||||
private var timeSum:int;
|
||||
private var timeCount:int;
|
||||
private var timer:int;
|
||||
|
||||
private function createDiagram():Sprite {
|
||||
var diagram:Sprite = new Sprite();
|
||||
diagram.mouseEnabled = false;
|
||||
diagram.mouseChildren = false;
|
||||
// Инициализация диаграммы
|
||||
diagram.addEventListener(Event.ADDED_TO_STAGE, function():void {
|
||||
// FPS
|
||||
fpsTextField = new TextField();
|
||||
fpsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCCCC);
|
||||
fpsTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
fpsTextField.text = "FPS:";
|
||||
fpsTextField.selectable = false;
|
||||
fpsTextField.x = -3;
|
||||
fpsTextField.y = -5;
|
||||
diagram.addChild(fpsTextField);
|
||||
fpsTextField = new TextField();
|
||||
fpsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCCCC);
|
||||
fpsTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
fpsTextField.text = Number(diagram.stage.frameRate).toFixed(2);
|
||||
fpsTextField.selectable = false;
|
||||
fpsTextField.x = -3;
|
||||
fpsTextField.y = -5;
|
||||
fpsTextField.width = 65;
|
||||
diagram.addChild(fpsTextField);
|
||||
// Время выполнения метода
|
||||
timerTextField = new TextField();
|
||||
timerTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0x0066FF);
|
||||
timerTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
timerTextField.text = "MS:";
|
||||
timerTextField.selectable = false;
|
||||
timerTextField.x = -3;
|
||||
timerTextField.y = 4;
|
||||
diagram.addChild(timerTextField);
|
||||
timerTextField = new TextField();
|
||||
timerTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0x0066FF);
|
||||
timerTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
timerTextField.text = "";
|
||||
timerTextField.selectable = false;
|
||||
timerTextField.x = -3;
|
||||
timerTextField.y = 4;
|
||||
timerTextField.width = 65;
|
||||
diagram.addChild(timerTextField);
|
||||
// Память
|
||||
memoryTextField = new TextField();
|
||||
memoryTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCC00);
|
||||
memoryTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
memoryTextField.text = "MEM:";
|
||||
memoryTextField.selectable = false;
|
||||
memoryTextField.x = -3;
|
||||
memoryTextField.y = 13;
|
||||
diagram.addChild(memoryTextField);
|
||||
memoryTextField = new TextField();
|
||||
memoryTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCC00);
|
||||
memoryTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
memoryTextField.text = bytesToString(System.totalMemory);
|
||||
memoryTextField.selectable = false;
|
||||
memoryTextField.x = -3;
|
||||
memoryTextField.y = 13;
|
||||
memoryTextField.width = 65;
|
||||
diagram.addChild(memoryTextField);
|
||||
// Отрисовочные вызовы
|
||||
drawsTextField = new TextField();
|
||||
drawsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0x00CC00);
|
||||
drawsTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
drawsTextField.text = "DRW:";
|
||||
drawsTextField.selectable = false;
|
||||
drawsTextField.x = -3;
|
||||
drawsTextField.y = 22;
|
||||
diagram.addChild(drawsTextField);
|
||||
drawsTextField = new TextField();
|
||||
drawsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0x00CC00);
|
||||
drawsTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
drawsTextField.text = "0";
|
||||
drawsTextField.selectable = false;
|
||||
drawsTextField.x = -3;
|
||||
drawsTextField.y = 22;
|
||||
drawsTextField.width = 52;
|
||||
diagram.addChild(drawsTextField);
|
||||
// Полигоны
|
||||
polygonsTextField = new TextField();
|
||||
polygonsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF0033);
|
||||
polygonsTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
polygonsTextField.text = "PLG:";
|
||||
polygonsTextField.selectable = false;
|
||||
polygonsTextField.x = -3;
|
||||
polygonsTextField.y = 31;
|
||||
diagram.addChild(polygonsTextField);
|
||||
polygonsTextField = new TextField();
|
||||
polygonsTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF0033);
|
||||
polygonsTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
polygonsTextField.text = "0";
|
||||
polygonsTextField.selectable = false;
|
||||
polygonsTextField.x = -3;
|
||||
polygonsTextField.y = 31;
|
||||
polygonsTextField.width = 52;
|
||||
diagram.addChild(polygonsTextField);
|
||||
// Треугольники
|
||||
trianglesTextField = new TextField();
|
||||
trianglesTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF6600);
|
||||
trianglesTextField.autoSize = TextFieldAutoSize.LEFT;
|
||||
trianglesTextField.text = "TRI:";
|
||||
trianglesTextField.selectable = false;
|
||||
trianglesTextField.x = -3;
|
||||
trianglesTextField.y = 40;
|
||||
diagram.addChild(trianglesTextField);
|
||||
trianglesTextField = new TextField();
|
||||
trianglesTextField.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF6600);
|
||||
trianglesTextField.autoSize = TextFieldAutoSize.RIGHT;
|
||||
trianglesTextField.text = "0";
|
||||
trianglesTextField.selectable = false;
|
||||
trianglesTextField.x = -3;
|
||||
trianglesTextField.y = 40;
|
||||
trianglesTextField.width = 52;
|
||||
diagram.addChild(trianglesTextField);
|
||||
// График
|
||||
graph = new Bitmap(new BitmapData(60, 40, true, 0x20FFFFFF));
|
||||
rect = new Rectangle(0, 0, 1, 40);
|
||||
graph.x = 0;
|
||||
graph.y = 54;
|
||||
diagram.addChild(graph);
|
||||
// Сброс параметров
|
||||
previousPeriodTime = getTimer();
|
||||
previousFrameTime = previousPeriodTime;
|
||||
fpsUpdateCounter = 0;
|
||||
maxMemory = 0;
|
||||
timerUpdateCounter = 0;
|
||||
timeSum = 0;
|
||||
timeCount = 0;
|
||||
// Подписка
|
||||
diagram.stage.addEventListener(Event.ENTER_FRAME, updateDiagram, false, -1000);
|
||||
diagram.stage.addEventListener(Event.RESIZE, resizeDiagram, false, -1000);
|
||||
resizeDiagram();
|
||||
});
|
||||
// Деинициализация диаграммы
|
||||
diagram.addEventListener(Event.REMOVED_FROM_STAGE, function():void {
|
||||
// Обнуление
|
||||
diagram.removeChild(fpsTextField);
|
||||
diagram.removeChild(memoryTextField);
|
||||
diagram.removeChild(drawsTextField);
|
||||
diagram.removeChild(polygonsTextField);
|
||||
diagram.removeChild(trianglesTextField);
|
||||
diagram.removeChild(timerTextField);
|
||||
diagram.removeChild(graph);
|
||||
fpsTextField = null;
|
||||
memoryTextField = null;
|
||||
drawsTextField = null;
|
||||
polygonsTextField = null;
|
||||
trianglesTextField = null;
|
||||
timerTextField = null;
|
||||
graph.bitmapData.dispose();
|
||||
graph = null;
|
||||
rect = null;
|
||||
// Отписка
|
||||
diagram.stage.removeEventListener(Event.ENTER_FRAME, updateDiagram);
|
||||
diagram.stage.removeEventListener(Event.RESIZE, resizeDiagram);
|
||||
});
|
||||
return diagram;
|
||||
}
|
||||
|
||||
private function resizeDiagram(e:Event = null):void {
|
||||
if (diagram.stage != null) {
|
||||
var coord:Point = diagram.parent.globalToLocal(new Point());
|
||||
if (_diagramAlign == StageAlign.TOP_LEFT || _diagramAlign == StageAlign.LEFT || _diagramAlign == StageAlign.BOTTOM_LEFT) {
|
||||
diagram.x = Math.round(coord.x + _diagramHorizontalMargin);
|
||||
}
|
||||
if (_diagramAlign == StageAlign.TOP || _diagramAlign == StageAlign.BOTTOM) {
|
||||
diagram.x = Math.round(coord.x + diagram.stage.stageWidth/2 - graph.width/2);
|
||||
}
|
||||
if (_diagramAlign == StageAlign.TOP_RIGHT || _diagramAlign == StageAlign.RIGHT || _diagramAlign == StageAlign.BOTTOM_RIGHT) {
|
||||
diagram.x = Math.round(coord.x + diagram.stage.stageWidth - _diagramHorizontalMargin - graph.width);
|
||||
}
|
||||
if (_diagramAlign == StageAlign.TOP_LEFT || _diagramAlign == StageAlign.TOP || _diagramAlign == StageAlign.TOP_RIGHT) {
|
||||
diagram.y = Math.round(coord.y + _diagramVerticalMargin);
|
||||
}
|
||||
if (_diagramAlign == StageAlign.LEFT || _diagramAlign == StageAlign.RIGHT) {
|
||||
diagram.y = Math.round(coord.y + diagram.stage.stageHeight/2 - (graph.y + graph.height)/2);
|
||||
}
|
||||
if (_diagramAlign == StageAlign.BOTTOM_LEFT || _diagramAlign == StageAlign.BOTTOM || _diagramAlign == StageAlign.BOTTOM_RIGHT) {
|
||||
diagram.y = Math.round(coord.y + diagram.stage.stageHeight - _diagramVerticalMargin - graph.y - graph.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function updateDiagram(e:Event):void {
|
||||
var value:Number;
|
||||
var mod:int;
|
||||
var time:int = getTimer();
|
||||
var stageFrameRate:int = diagram.stage.frameRate;
|
||||
|
||||
// FPS текст
|
||||
if (++fpsUpdateCounter == fpsUpdatePeriod) {
|
||||
value = 1000*fpsUpdatePeriod/(time - previousPeriodTime);
|
||||
if (value > stageFrameRate) value = stageFrameRate;
|
||||
mod = value*100 % 100;
|
||||
fpsTextField.text = int(value) + "." + ((mod >= 10) ? mod : ((mod > 0) ? ("0" + mod) : "00"));
|
||||
previousPeriodTime = time;
|
||||
fpsUpdateCounter = 0;
|
||||
}
|
||||
// FPS график
|
||||
value = 1000/(time - previousFrameTime);
|
||||
if (value > stageFrameRate) value = stageFrameRate;
|
||||
graph.bitmapData.scroll(1, 0);
|
||||
graph.bitmapData.fillRect(rect, 0x20FFFFFF);
|
||||
graph.bitmapData.setPixel32(0, 40*(1 - value/stageFrameRate), 0xFFCCCCCC);
|
||||
previousFrameTime = time;
|
||||
|
||||
// Время текст
|
||||
if (++timerUpdateCounter == timerUpdatePeriod) {
|
||||
if (timeCount > 0) {
|
||||
value = timeSum/timeCount;
|
||||
mod = value*100 % 100;
|
||||
timerTextField.text = int(value) + "." + ((mod >= 10) ? mod : ((mod > 0) ? ("0" + mod) : "00"));
|
||||
} else {
|
||||
timerTextField.text = "";
|
||||
}
|
||||
timerUpdateCounter = 0;
|
||||
timeSum = 0;
|
||||
timeCount = 0;
|
||||
}
|
||||
|
||||
// Память текст
|
||||
var memory:int = System.totalMemory;
|
||||
value = memory/1048576;
|
||||
mod = value*100 % 100;
|
||||
memoryTextField.text = int(value) + "." + ((mod >= 10) ? mod : ((mod > 0) ? ("0" + mod) : "00"));
|
||||
|
||||
// Память график
|
||||
if (memory > maxMemory) maxMemory = memory;
|
||||
graph.bitmapData.setPixel32(0, 40*(1 - memory/maxMemory), 0xFFCCCC00);
|
||||
|
||||
// Отрисовочные вызовы текст
|
||||
drawsTextField.text = String(numDraws);
|
||||
|
||||
// Полигоны текст
|
||||
polygonsTextField.text = String(numPolygons);
|
||||
|
||||
// Треугольники текст
|
||||
trianglesTextField.text = String(numTriangles);
|
||||
}
|
||||
|
||||
public function startTimer():void {
|
||||
timer = getTimer();
|
||||
}
|
||||
|
||||
public function stopTimer():void {
|
||||
timeSum += getTimer() - timer;
|
||||
timeCount++;
|
||||
}
|
||||
|
||||
public function get diagramAlign():String {
|
||||
return _diagramAlign;
|
||||
}
|
||||
|
||||
public function set diagramAlign(value:String):void {
|
||||
_diagramAlign = value;
|
||||
resizeDiagram();
|
||||
}
|
||||
|
||||
public function get diagramHorizontalMargin():Number {
|
||||
return _diagramHorizontalMargin;
|
||||
}
|
||||
|
||||
public function set diagramHorizontalMargin(value:Number):void {
|
||||
_diagramHorizontalMargin = value;
|
||||
resizeDiagram();
|
||||
}
|
||||
|
||||
public function get diagramVerticalMargin():Number {
|
||||
return _diagramVerticalMargin;
|
||||
}
|
||||
|
||||
public function set diagramVerticalMargin(value:Number):void {
|
||||
_diagramVerticalMargin = value;
|
||||
resizeDiagram();
|
||||
}
|
||||
|
||||
private function bytesToString(bytes:int):String {
|
||||
if (bytes < 1024) return bytes + "b";
|
||||
else if (bytes < 10240) return (bytes/1024).toFixed(2) + "kb";
|
||||
else if (bytes < 102400) return (bytes/1024).toFixed(1) + "kb";
|
||||
else if (bytes < 1048576) return (bytes >> 10) + "kb";
|
||||
else if (bytes < 10485760) return (bytes/1048576).toFixed(2);// + "mb";
|
||||
else if (bytes < 104857600) return (bytes/1048576).toFixed(1);// + "mb";
|
||||
else return String(bytes >> 20);// + "mb";
|
||||
}
|
||||
|
||||
// Отложенное удаление в коллектор
|
||||
|
||||
private var firstVertex:Vertex = new Vertex();
|
||||
private var firstFace:Face = new Face();
|
||||
private var firstWrapper:Wrapper = new Wrapper();
|
||||
alternativa3d var lastWrapper:Wrapper = firstWrapper;
|
||||
alternativa3d var lastVertex:Vertex = firstVertex;
|
||||
alternativa3d var lastFace:Face = firstFace;
|
||||
|
||||
private function deferredDestroy():void {
|
||||
for (var face:Face = firstFace.next; face != null; face = face.next) {
|
||||
var w:Wrapper = face.wrapper;
|
||||
if (w != null) {
|
||||
for (var lw:Wrapper = null; w != null; lw = w,w = w.next) {
|
||||
w.vertex = null;
|
||||
}
|
||||
lastWrapper.next = face.wrapper;
|
||||
lastWrapper = lw;
|
||||
}
|
||||
face.material = null;
|
||||
face.wrapper = null;
|
||||
//face.processNext = null;
|
||||
//face.geometry = null;
|
||||
}
|
||||
if (firstFace != lastFace) {
|
||||
lastFace.next = Face.collector;
|
||||
Face.collector = firstFace.next;
|
||||
firstFace.next = null;
|
||||
lastFace = firstFace;
|
||||
}
|
||||
if (firstWrapper != lastWrapper) {
|
||||
lastWrapper.next = Wrapper.collector;
|
||||
Wrapper.collector = firstWrapper.next;
|
||||
firstWrapper.next = null;
|
||||
lastWrapper = firstWrapper;
|
||||
}
|
||||
if (firstVertex != lastVertex) {
|
||||
lastVertex.next = Vertex.collector;
|
||||
Vertex.collector = firstVertex.next;
|
||||
firstVertex.next = null;
|
||||
lastVertex = firstVertex;
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function clearOccluders():void {
|
||||
for (var i:int = 0; i < numOccluders; i++) {
|
||||
var first:Vertex = occluders[i];
|
||||
//for (var last:Vertex = first; last.next != null; last = last.next);
|
||||
var last:Vertex = first;
|
||||
while (last.next != null) last = last.next;
|
||||
last.next = Vertex.collector;
|
||||
Vertex.collector = first;
|
||||
occluders[i] = null;
|
||||
}
|
||||
numOccluders = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package alternativa.engine3d.core {
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Graphics;
|
||||
import flash.display.Sprite;
|
||||
import flash.geom.ColorTransform;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class Canvas extends Sprite {
|
||||
|
||||
static private const defaultColorTransform:ColorTransform = new ColorTransform();
|
||||
static private const collector:Vector.<Canvas> = new Vector.<Canvas>();
|
||||
static private var collectorLength:int = 0;
|
||||
|
||||
alternativa3d var gfx:Graphics = graphics;
|
||||
|
||||
private var modifiedGraphics:Boolean;
|
||||
private var modifiedAlpha:Boolean;
|
||||
private var modifiedBlendMode:Boolean;
|
||||
private var modifiedColorTransform:Boolean;
|
||||
private var modifiedFilters:Boolean;
|
||||
|
||||
alternativa3d var _numChildren:int = 0;
|
||||
alternativa3d var numDraws:int = 0;
|
||||
|
||||
alternativa3d var interactiveObject:Object3D;
|
||||
|
||||
/*public function Canvas() {
|
||||
mouseEnabled = false;
|
||||
mouseChildren = false;
|
||||
}*/
|
||||
|
||||
alternativa3d function getChildCanvas(interactiveObject:Object3D, useGraphics:Boolean, useChildren:Boolean, alpha:Number = 1, blendMode:String = "normal", colorTransform:ColorTransform = null, filters:Array = null):Canvas {
|
||||
var canvas:Canvas;
|
||||
var displayObject:DisplayObject;
|
||||
// Зачистка не канвасов
|
||||
while (_numChildren > numDraws && !((displayObject = getChildAt(_numChildren - 1 - numDraws)) is Canvas)) {
|
||||
removeChild(displayObject);
|
||||
_numChildren--;
|
||||
}
|
||||
// Получение канваса
|
||||
if (_numChildren > numDraws++) {
|
||||
canvas = displayObject as Canvas;
|
||||
// Зачистка
|
||||
if (canvas.modifiedGraphics) {
|
||||
canvas.gfx.clear();
|
||||
}
|
||||
if (canvas._numChildren > 0 && !useChildren) {
|
||||
canvas.removeChildren(0);
|
||||
}
|
||||
} else {
|
||||
canvas = (collectorLength > 0) ? collector[--collectorLength] : new Canvas();
|
||||
addChildAt(canvas, 0);
|
||||
_numChildren++;
|
||||
}
|
||||
// Сохранение интерактивного объекта
|
||||
canvas.interactiveObject = interactiveObject;
|
||||
// Пометка о том, что в graphics будет что-то нарисовано
|
||||
canvas.modifiedGraphics = useGraphics;
|
||||
// Установка свойств
|
||||
if (alpha != 1) {
|
||||
canvas.alpha = alpha;
|
||||
canvas.modifiedAlpha = true;
|
||||
} else if (canvas.modifiedAlpha) {
|
||||
canvas.alpha = 1;
|
||||
canvas.modifiedAlpha = false;
|
||||
}
|
||||
if (blendMode != "normal") {
|
||||
canvas.blendMode = blendMode;
|
||||
canvas.modifiedBlendMode = true;
|
||||
} else if (canvas.modifiedBlendMode) {
|
||||
canvas.blendMode = "normal";
|
||||
canvas.modifiedBlendMode = false;
|
||||
}
|
||||
if (colorTransform != null) {
|
||||
colorTransform.alphaMultiplier = alpha;
|
||||
canvas.transform.colorTransform = colorTransform;
|
||||
canvas.modifiedColorTransform = true;
|
||||
} else if (canvas.modifiedColorTransform) {
|
||||
defaultColorTransform.alphaMultiplier = alpha;
|
||||
canvas.transform.colorTransform = defaultColorTransform;
|
||||
canvas.modifiedColorTransform = false;
|
||||
}
|
||||
if (filters != null) {
|
||||
canvas.filters = filters;
|
||||
canvas.modifiedFilters = true;
|
||||
} else if (canvas.modifiedFilters) {
|
||||
canvas.filters = null;
|
||||
canvas.modifiedFilters = false;
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
|
||||
alternativa3d function removeChildren(keep:int):void {
|
||||
for (var canvas:Canvas; _numChildren > keep; _numChildren--) {
|
||||
if ((canvas = removeChildAt(0) as Canvas) != null) {
|
||||
canvas.interactiveObject = null;
|
||||
if (canvas.modifiedGraphics) canvas.gfx.clear();
|
||||
if (canvas._numChildren > 0) canvas.removeChildren(0);
|
||||
collector[collectorLength++] = canvas;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package alternativa.engine3d.core {
|
||||
|
||||
public class Clipping {
|
||||
|
||||
/**
|
||||
* Объект отсекается целиком, если он полностью вне пирамиды видимости или пересекает nearClipping камеры.
|
||||
*/
|
||||
static public const BOUND_CULLING:int = 0;
|
||||
/**
|
||||
* Грань отсекается целиком, если она полностью вне пирамиды видимости или пересекает nearClipping камеры.
|
||||
*/
|
||||
static public const FACE_CULLING:int = 1;
|
||||
/**
|
||||
* Грань подрезается пирамидой видимости камеры.
|
||||
*/
|
||||
static public const FACE_CLIPPING:int = 2;
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user