Package | flare.basic |
Class | public class Scene3D |
Inheritance | Scene3D ![]() ![]() |
Subclasses | Viewer3D |
The Scene3D class also has a Clock3D instance that manages update and render cycles. The update event indicates the need to update scene elements and the render and postRender events allow full control before and after the render process.
Once the scene has been created, use addChild or addChildFromFile to include 3d objects. This will dispatch the progress and complete events to control the loading process for external files.
The scene also creates a Camera3D object to view the scene. The canvas size will take Stage size values by default. To change the rendering area size, use the setViewport method.
See also
Property | Defined By | ||
---|---|---|---|
allowImportSettings : Boolean = false
Allows to import scene setting saved in the IDE. | Scene3D | ||
![]() | animationEnabled : Boolean = true
Activates or deactivates the animation. | Pivot3D | |
![]() | animationSmoothMode : int = 2
Sets or gets the animation method used to interpolate between frames. | Pivot3D | |
antialias : int
An int selecting anti-aliasing quality. | Scene3D | ||
autoDispose : Boolean = false | Scene3D | ||
autoResize : Boolean
This property forces to the scene to take the stage dimensions when the stage is resized if is setted to true. | Scene3D | ||
backgroundColor : int | Scene3D | ||
camera : Camera3D
Sets or returns the camera to be used for rendering. | Scene3D | ||
![]() | castShadows : Boolean = true
Gets or sets if the object should cast shadows. | Pivot3D | |
![]() | children : Vector.<Pivot3D> [read-only]
Returns a Pivot3D-type vector with its children. | Pivot3D | |
clearColor : Vector3D
Color to use to clear the back buffer. | Scene3D | ||
![]() | collider : Collider | Pivot3D | |
![]() | components : Vector.<IComponent>
A collection vector that contains all the components of the object. | Pivot3D | |
context : Context3D [read-only]
Returns the current Stage3D context. | Scene3D | ||
![]() | currentFrame : Number
Returns or sets the frame number where the pivot is situated. | Pivot3D | |
![]() | currentLabel : Label3D [read-only] | Pivot3D | |
![]() | dirty : Boolean = true
Gets or sets when the object has changed his transform matrix by hand. | Pivot3D | |
enableUpdateAndRender : Boolean
Enables or disable the automatic update, render and postRender events of the scene. | Scene3D | ||
frameRate : Number
Gets and sets the frame rate of the 3d scene only for the "update" event. | Scene3D | ||
![]() | frames : Vector.<Frame3D>
Vector that contains all the animation frames. | Pivot3D | |
![]() | frameSpeed : Number
Returns or sets animation speed. | Pivot3D | |
ignoreInvisibleUnderMouse : Boolean = true
Allow to detect mouse events with non visible objects such as references or simplified geometry. | Scene3D | ||
![]() | inView : Boolean [read-only] | Pivot3D | |
![]() | invWorld : Matrix3D [read-only]
Returns a matrix with the inverse global position, rotation and scale of the object. | Pivot3D | |
![]() | isPlaying : Boolean [read-only]
Returns true if an animation is being played. | Pivot3D | |
![]() | labels : Object
Returns or sets an object that contains the Labels3D objects used to play and manage animations. | Pivot3D | |
![]() | layer : int = 0
Gets or sets the layer to render the object. | Pivot3D | |
library : Library3D
Library3D instance that manages all scene resources. | Scene3D | ||
lights : LightFilter
A reference to a LightFilter that manage all scene lights. | Scene3D | ||
loadProgress : Number [read-only]
Gets the global loading process of the scene. | Scene3D | ||
![]() | lock : Boolean
Sets the pivot lock mode. | Pivot3D | |
materials : Vector.<Material3D> | Scene3D | ||
mouseEnabled : Boolean
Enables or disable all mouse scene events. | Scene3D | ||
![]() | name : String
Sets or returns the object name. | Pivot3D | |
![]() | parent : Pivot3D
Returns or sets the object’s parent. | Pivot3D | |
paused : Boolean [read-only]
Returns 'true' if the scene is paused. | Scene3D | ||
physics : Physics
Main reference to the physics manager. | Scene3D | ||
![]() | priority : int = 0
This value is for internal use to calculate the priority acording the distance from the camera during the render. | Pivot3D | |
profile : String | Scene3D | ||
![]() | receiveShadows : Boolean = true
Gets or sets if the object should receive shadows. | Pivot3D | |
renderList : Vector.<Pivot3D> [read-only]
Gets access to the render list. | Scene3D | ||
rendersPerSecond : int [read-only]
Returns the rendering frame rate for statistical purposes. | Scene3D | ||
renderTime : int [read-only]
Returns time taken to render the scene, including lights, object occlusion, drawing, etc.., in milliseconds. | Scene3D | ||
![]() | scaleX : Number
Increases or decreases the object scale on the X axis from its current scale. | Pivot3D | |
![]() | scaleY : Number
Increases or decreases the object scale on the Y axis from its current scale. | Pivot3D | |
![]() | scaleZ : Number
Increases or decreases the object scale on the Z axis from its current scale. | Pivot3D | |
![]() | scene : Scene3D [read-only]
Gets a reference to the scene that contains the object. | Pivot3D | |
showLogo : Boolean [write-only]
Shows or hides the Flare3D watermak logo for debugging purposes. | Scene3D | ||
showMenu : Boolean [write-only]
Shows or hides the Flare3D version on the right click menu. | Scene3D | ||
skipFrames : Boolean = false
When is set to true, the scene will maintain a constant
update framerate (based on scene.frameRate property), but render frames could be skipped to
keep the framerate constant (recommended for games). | Scene3D | ||
![]() | sortMode : int
Gets ot sets the sorting mode for the object. | Pivot3D | |
stageIndex : int [read-only]
Gets the associated Stage3D index. | Scene3D | ||
surfaces : Vector.<Surface3D> | Scene3D | ||
targetFilters : Vector.<Material3D> | Scene3D | ||
targetTexture : Texture3D | Scene3D | ||
textures : Vector.<Texture3D> | Scene3D | ||
![]() | transform : Matrix3D
Sets or returns the matrix of local position, rotation and scale. | Pivot3D | |
![]() | updatable : Boolean | Pivot3D | |
updateList : Vector.<Pivot3D> [read-only]
Gets access to the update list. | Scene3D | ||
updatesPerSecond : int [read-only]
Returns the update frame rate for statistical purposes. | Scene3D | ||
updateTime : int [read-only]
Returns the time taken to update the scene in milliseconds. | Scene3D | ||
![]() | userData : Object
Sets or returns an object for free use by the user. | Pivot3D | |
viewPort : Rectangle [read-only]
Gets the viewport area associated to the Stage3D. | Scene3D | ||
![]() | visible : Boolean = true
Sets or returns whether the object is visible. | Pivot3D | |
![]() | world : Matrix3D
Returns a matrix with the global position, rotation and scale of the object. | Pivot3D | |
![]() | x : Number
Returns or sets the position on the X axis. | Pivot3D | |
![]() | y : Number
Returns or sets the position on the Y axis. | Pivot3D | |
![]() | z : Number
Returns or sets the position on the Z axis. | Pivot3D |
Method | Defined By | ||
---|---|---|---|
Scene3D(container:DisplayObjectContainer, file:String)
Create a new Scene3D object. | Scene3D | ||
![]() |
Add a new object as a child. | Pivot3D | |
![]() | Pivot3D | ||
Loads and adds a Flare3D (*.f3d) file from an external file. | Scene3D | ||
![]() | addComponent(component:IComponent):Boolean
Adds a new component to the object. | Pivot3D | |
![]() | addFrameScript(frame:int, callback:Function):void | Pivot3D | |
![]() |
Adds a label that refers to a given animation. | Pivot3D | |
addTextureFromFile(request:*, optimizeForRenderToTexture:Boolean = false, format:int = 0, type:int = 0):Texture3D
Loads a texture from an external file. | Scene3D | ||
![]() |
Creates a copy of the object and all its elements. | Pivot3D | |
![]() |
Copy basic pivot properties to anotheer pivot. | Pivot3D | |
![]() | copyTransformFrom(source:Pivot3D, local:Boolean = true):void
Copies all transformations (position, rotation and scale) from another Pivot3D object. | Pivot3D | |
![]() | dispose():void
Disposes the pivot and all associated resources. | Pivot3D | |
![]() | download(includeChildren:Boolean = true):void | Pivot3D | |
![]() | draw(includeChildren:Boolean = true, material:Material3D = null):void
Draws the object. | Pivot3D | |
drawLayer(layer:int, material:Material3D = null):void
Draws the objects in the specified layer. | Scene3D | ||
drawQuadTexture(texture:Texture3D, x:Number, y:Number, width:Number, height:Number, material:Material3D = null, sourceFactor:String, destFactor:String):void | Scene3D | ||
endFrame():void | Scene3D | ||
![]() | forEach(callback:Function, filterClass:Class = null, params:Object = null, includeChildren:Boolean = true):void
Excecutes a calback functions for each of his children. | Pivot3D | |
freeMemory():void
Forces to free all unused memory. | Scene3D | ||
![]() | getBackward(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the back of the object. | Pivot3D | |
![]() | getChildByName(name:String, startIndex:int = 0, includeChildren:Boolean = true):Pivot3D
Returns the first child that matches the specified name. | Pivot3D | |
![]() | getChildrenByClass(cl:Class, includeChildren:Boolean = true, out:Vector.<Pivot3D> = null):Vector.<Pivot3D> | Pivot3D | |
![]() | getDir(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the front of the object. | Pivot3D | |
![]() | getDown(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the bottom side of the object. | Pivot3D | |
![]() | getLeft(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the left side of the object. | Pivot3D | |
![]() | getMaterialByName(name:String, includeChildren:Boolean = true):Material3D
Returns the first material that matches the specified name. | Pivot3D | |
![]() |
Returns an unique vector of pivot materials currently in use. | Pivot3D | |
getPointScreenCoords(point:Vector3D, out:Vector3D = null):Vector3D
Returns the coordinates of an arbitrary world point respect to the screen. | Scene3D | ||
![]() | getPosition(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the current position of the object. | Pivot3D | |
![]() | getRight(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the right side of the object. | Pivot3D | |
![]() | getRotation(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the current rotation of the object in euler angles. | Pivot3D | |
![]() | getScale(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the current scale of the object. | Pivot3D | |
![]() | getScreenCoords(out:Vector3D = null, camera:Camera3D = null, viewPort:Rectangle = null):Vector3D
Returns the coordinates of an object with respect to the screen. | Pivot3D | |
![]() |
Returns an unique vector of textures objects used by the pivot materials. | Pivot3D | |
![]() | getUp(local:Boolean = true, out:Vector3D = null):Vector3D
Returns the direction vector that points to the upper side of the object. | Pivot3D | |
![]() | globalToLocal(point:Vector3D, out:Vector3D = null):Vector3D
Transforms a point of the global space of the object into a local space. | Pivot3D | |
![]() | globalToLocalVector(vector:Vector3D, out:Vector3D = null):Vector3D
Transforms a point of the global space of the object into a local space without translation. | Pivot3D | |
![]() | gotoAndPlay(frame:Object, blendFrames:Number = 0, animationMode:int, includeChildren:Boolean = true):void
Starts playing the animation at the specified frame
| Pivot3D | |
![]() | gotoAndStop(frame:Object, blendFrames:Number = 0, includeChildren:Boolean = true):void
Stops the animation at the specified frame. | Pivot3D | |
![]() | hide():void
Sets whether the object is visible. | Pivot3D | |
hideLayer(layer:int):void
Hides the objects in the specified layer. | Scene3D | ||
![]() | localToGlobal(point:Vector3D, out:Vector3D = null):Vector3D
Transforms a point of the local space into the global space. | Pivot3D | |
![]() | localToGlobalVector(vector:Vector3D, out:Vector3D = null):Vector3D
Transforms a point of the local space of the object into a global space without translation. | Pivot3D | |
![]() | lookAt(x:Number, y:Number, z:Number, up:Vector3D = null, smooth:Number = 1):void
Directs the object towards the specified position. | Pivot3D | |
![]() | nextFrame():void | Pivot3D | |
pause():void
Pauses the “update” event and starts shooting the “paused” event. | Scene3D | ||
![]() | play(animationMode:int = 0, includeChildren:Boolean = true, resetAnimation:Boolean = true):void
Starts playing the animation. | Pivot3D | |
![]() | prevFrame():void | Pivot3D | |
registerClass(... rest):void | Scene3D | ||
![]() |
Removes a child of the object. | Pivot3D | |
![]() | removeComponent(component:IComponent):Boolean
Removes a component from the object. | Pivot3D | |
![]() |
Removes a label. | Pivot3D | |
Renders the current scene frame. | Scene3D | ||
![]() |
Replaces an existing material of the object with another material. | Pivot3D | |
![]() | resetTransforms():void
Resets the object position, rotation and scale. | Pivot3D | |
resume():void
Exits pause mode. | Scene3D | ||
![]() | rotateAxis(angle:Number, axis:Vector3D, pivotPoint:Vector3D = null):void
Rotates the object on the specified axis from its current position. | Pivot3D | |
![]() | rotateX(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void
Rotates the object on the X axis from its current position. | Pivot3D | |
![]() | rotateY(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void
Rotates the object on the Y axis from its current position. | Pivot3D | |
![]() | rotateZ(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void
Rotates the pivot on the Z axis from its current position. | Pivot3D | |
![]() | setAnimationLabel(label:Object, animationMode:int, includeChildren:Boolean = true):void
Sets the current animation label. | Pivot3D | |
![]() | setAnimationSmooth(mode:int, includeChildren:Boolean = true):void
Sets the animation interpolation mode for this pivot and its children. | Pivot3D | |
![]() | setLayer(value:int, includeChildren:Boolean = true):void
Sets the layer to render the object and all of his children. | Pivot3D | |
setLayerSortMode(layer:int, mode:int):void
Specifies a layer to be sorted per object on each frame. | Scene3D | ||
![]() | setMaterial(material:Material3D, includeChildren:Boolean = true):void
Sets a material for the object and, optionally, all its descendants. | Pivot3D | |
![]() | setNormalOrientation(normal:Vector3D, smooth:Number = 1):void
Aligns the object to a normal. | Pivot3D | |
![]() | setOrientation(dir:Vector3D, up:Vector3D = null, smooth:Number = 1):void
Orients the object in a specific direction. | Pivot3D | |
![]() | setPosition(x:Number, y:Number, z:Number, smooth:Number = 1, local:Boolean = true):void
Sets the position of the object. | Pivot3D | |
![]() | setRotation(x:Number, y:Number, z:Number):void
Sets the object rotation using euler angles. | Pivot3D | |
![]() | setScale(x:Number, y:Number, z:Number, smooth:Number = 1):void
Sets the object scale. | Pivot3D | |
![]() | setShadowsProperties(cast:Boolean = false, receive:Boolean = false, includeChildren:Boolean = true):void
Sets whether the object should cast and receive shadows. | Pivot3D | |
![]() | setTranslation(x:Number = 0, y:Number = 0, z:Number = 0, local:Boolean = true):void
Translates the object from its current position to the specified distance. | Pivot3D | |
setupConstants():void
Updates global constants for each frame. | Scene3D | ||
setupFrame(camera:Camera3D = null):void
This method prepares the scene to be rendered. | Scene3D | ||
setViewport(x:Number = 0, y:Number = 0, width:Number = 640, height:Number = 480, antialias:int = 0):void
Sets the dimensions of the canvas rendering area. | Scene3D | ||
![]() | show():void
Sets whether the object is visible. | Pivot3D | |
showLayer(layer:int):void
Shows the object in the specified layer. | Scene3D | ||
![]() | startDrag(lockCenter:Boolean = false, refPlaneNormal:Vector3D = null):void
Lets the user drag the specified Pivot3D. | Pivot3D | |
![]() | stop(includeChildren:Boolean = true):void | Pivot3D | |
![]() | stopDrag():void
Ends the startDrag() method. | Pivot3D | |
![]() | translateAxis(distance:Number, axis:Vector3D):void
Translates the object on a certain axis from its current position. | Pivot3D | |
![]() | translateX(distance:Number, local:Boolean = true):void
Translates the object on the X axis from its current position. | Pivot3D | |
![]() | translateY(distance:Number, local:Boolean = true):void
Translates the object on the Y axis from its current position. | Pivot3D | |
![]() | translateZ(distance:Number, local:Boolean = true):void
Translates the object on the Z axis from its current position. | Pivot3D | |
update():void [override]
Forces to update the scene and animations and will dispatch the scene 'update' event. | Scene3D | ||
updateMouseEvents():void
This method forces to update mouse events for all 3D objects in the scene. | Scene3D | ||
![]() | updateTransforms(includeChildren:Boolean = false):void
This method is used to force the system to update the object in those cases where its matrices have been modified manually. | Pivot3D | |
![]() | Pivot3D |
Event | Summary | Defined By | ||
---|---|---|---|---|
![]() | This event occurs when the object is added to a scene or to any other object. | Pivot3D | ||
![]() | This event occurs when the object is added to a scene. | Pivot3D | ||
![]() | This event occurs at the end of an animation. | Pivot3D | ||
![]() | This event occurs whatever the object changes his position, rotation or scale. | Pivot3D | ||
This event occurs once the loading process of all the scene elements has been completed. | Scene3D | |||
![]() | This event occurs before drag the object. | Pivot3D | ||
![]() | This event occurs before draw the object. | Pivot3D | ||
![]() | This event occurs before entering any frame. | Pivot3D | ||
![]() | This event occurs after drag the object. | Pivot3D | ||
![]() | This event occurs after draw the object. | Pivot3D | ||
![]() | This event occurs after updating every frame. | Pivot3D | ||
Dispatched if a call to load() results in a fatal error that terminates the download. | Scene3D | |||
This event occurs after all the render proccess, but before calling present(). | Scene3D | |||
This event occurs after rendering the scene. | Scene3D | |||
This event occurs whenever the loading progress of the elements of a scene is modified. | Scene3D | |||
![]() | This event occurs when the object is removed from a scene or from any other object. | Pivot3D | ||
![]() | This event occurs when the object is removed from a scene. | Pivot3D | ||
This event occurs before rendering the scene. | Scene3D | |||
![]() | This event occurs when the dispose method of the object itself or of a parent object is called. | Pivot3D | ||
This event occurs whenever the program must be updated. | Scene3D |
Constant | Defined By | ||
---|---|---|---|
![]() | ADDED_EVENT : String = added [static]
Defines the value for the 'added' event. | Pivot3D | |
![]() | ADDED_TO_SCENE_EVENT : String = addedToScene [static]
Defines the value for the 'addedToScene' event. | Pivot3D | |
![]() | ANIMATION_COMPLETE_EVENT : String = animationComplete [static]
Defines the value for the 'animationComplete' event. | Pivot3D | |
![]() | ANIMATION_LOOP_MODE : int = 0 [static] | Pivot3D | |
![]() | ANIMATION_PING_PONG_MODE : int = 1 [static] | Pivot3D | |
![]() | ANIMATION_SMOOTH_BEST : int = 2 [static] | Pivot3D | |
![]() | ANIMATION_SMOOTH_NONE : int = 0 [static] | Pivot3D | |
![]() | ANIMATION_SMOOTH_NORMAL : int = 1 [static] | Pivot3D | |
![]() | ANIMATION_STOP_MODE : int = 2 [static] | Pivot3D | |
COMPLETE_EVENT : String = complete [static] Defines the value for the “complete” event. | Scene3D | ||
![]() | ENTER_DRAG_EVENT : String = enterDrag [static]
Defines the value for the 'enterDrag' event. | Pivot3D | |
![]() | ENTER_DRAW_EVENT : String = enterDraw [static]
Defines the value for the 'enterDraw' event. | Pivot3D | |
![]() | ENTER_FRAME_EVENT : String = enterFrame [static]
Defines the value for the 'enterFrame' event. | Pivot3D | |
![]() | EXIT_DRAG_EVENT : String = exitDrag [static]
Defines the value for the 'exitDrag' event. | Pivot3D | |
![]() | EXIT_DRAW_EVENT : String = exitDraw [static]
Defines the value for the 'exitDraw' event. | Pivot3D | |
![]() | EXIT_FRAME_EVENT : String = exitFrame [static]
Defines the value for the 'exitFrame' event. | Pivot3D | |
OVERLAY_EVENT : String = overlay [static] Defines the value for the “overlay” render event. | Scene3D | ||
PAUSED_EVENT : String = paused [static] Defines the value for the “paused” event. | Scene3D | ||
POSTRENDER_EVENT : String = postRender [static] Defines the value for the “postRender” event. | Scene3D | ||
POSTUPDATE_EVENT : String = postUpdate [static] Defines the value for the “postRender” event. | Scene3D | ||
PROGRESS_EVENT : String = progress [static] Defines the value for the “progress” event. | Scene3D | ||
![]() | REMOVED_EVENT : String = removed [static]
Defines the value for the 'removed' event. | Pivot3D | |
![]() | REMOVED_FROM_SCENE_EVENT : String = removedFromScene [static]
Defines the value for the 'removedFromScene' event. | Pivot3D | |
RENDER_EVENT : String = render [static] Defines the value for the “render” event. | Scene3D | ||
SORT_BACK_TO_FRONT : int = 2 [static] | Scene3D | ||
![]() | SORT_CENTER : int = 1 [static] | Pivot3D | |
![]() | SORT_FAR : int = 4 [static] | Pivot3D | |
SORT_FRONT_TO_BACK : int = 1 [static] | Scene3D | ||
![]() | SORT_NEAR : int = 2 [static] | Pivot3D | |
SORT_NONE : int = 0 [static] | Scene3D | ||
![]() | UNLOAD_EVENT : String = unload [static]
Defines the value for the 'unload' event. | Pivot3D | |
UPDATE_EVENT : String = update [static] Defines the value for the update” event. | Scene3D | ||
![]() | UPDATE_TRANSFORM_EVENT : String = updateTransform [static]
Defines the value for the 'updateTransform' event. | Pivot3D |
allowImportSettings | property |
public var allowImportSettings:Boolean = false
Allows to import scene setting saved in the IDE. Once the settings are imported for the first time, this property is set to false automatically.
antialias | property |
antialias:int
An int selecting anti-aliasing quality. 0 is no anti-aliasing. Correlates to the number of sub-samples; a value of 2 is generally the minimum, although some systems with anti-alias with a value of one. More anti-aliasing is more depanding on the GPU and may impact performance.
public function get antialias():int
public function set antialias(value:int):void
autoDispose | property |
public var autoDispose:Boolean = false
autoResize | property |
autoResize:Boolean
This property forces to the scene to take the stage dimensions when the stage is resized if is setted to true. Also changes the stage.align to topLeft and sets the stage.scaleMode to noScale.
public function get autoResize():Boolean
public function set autoResize(value:Boolean):void
backgroundColor | property |
backgroundColor:int
public function get backgroundColor():int
public function set backgroundColor(value:int):void
camera | property |
camera:Camera3D
Sets or returns the camera to be used for rendering.
public function get camera():Camera3D
public function set camera(value:Camera3D):void
See also
clearColor | property |
public var clearColor:Vector3D
Color to use to clear the back buffer.
context | property |
context:Context3D
[read-only] Returns the current Stage3D context.
public function get context():Context3D
enableUpdateAndRender | property |
enableUpdateAndRender:Boolean
Enables or disable the automatic update, render and postRender events of the scene. Seting this property to false will allow you to manage your own update and render loop, calling to those methods manually.
public function get enableUpdateAndRender():Boolean
public function set enableUpdateAndRender(value:Boolean):void
See also
frameRate | property |
frameRate:Number
Gets and sets the frame rate of the 3d scene only for the "update" event. The frame rate is defined as frames per second.
public function get frameRate():Number
public function set frameRate(value:Number):void
ignoreInvisibleUnderMouse | property |
public var ignoreInvisibleUnderMouse:Boolean = true
Allow to detect mouse events with non visible objects such as references or simplified geometry.
library | property |
public var library:Library3D
Library3D instance that manages all scene resources.
lights | property |
public var lights:LightFilter
A reference to a LightFilter that manage all scene lights.
loadProgress | property |
loadProgress:Number
[read-only] Gets the global loading process of the scene. The returned value is a percent value between 0 and 100.
public function get loadProgress():Number
materials | property |
public var materials:Vector.<Material3D>
mouseEnabled | property |
mouseEnabled:Boolean
Enables or disable all mouse scene events.
public function get mouseEnabled():Boolean
public function set mouseEnabled(value:Boolean):void
paused | property |
paused:Boolean
[read-only] Returns 'true' if the scene is paused.
public function get paused():Boolean
physics | property |
public var physics:Physics
Main reference to the physics manager.
profile | property |
profile:String
public function get profile():String
public function set profile(value:String):void
renderList | property |
renderList:Vector.<Pivot3D>
[read-only] Gets access to the render list.
public function get renderList():Vector.<Pivot3D>
rendersPerSecond | property |
rendersPerSecond:int
[read-only] Returns the rendering frame rate for statistical purposes.
public function get rendersPerSecond():int
renderTime | property |
renderTime:int
[read-only] Returns time taken to render the scene, including lights, object occlusion, drawing, etc.., in milliseconds. The returned time, does not include the present call.
public function get renderTime():int
showLogo | property |
showLogo:Boolean
[write-only] Shows or hides the Flare3D watermak logo for debugging purposes. This property only works on comercial versions of Flare3D or if the content is running using a Flash Player Debugger version. If the library is a trial version and the content is runnung under a Flash Player release version, this property will not take any effect.
public function set showLogo(value:Boolean):void
showMenu | property |
showMenu:Boolean
[write-only] Shows or hides the Flare3D version on the right click menu. This property should be setted inmediaelly after the scene creation.
public function set showMenu(value:Boolean):void
skipFrames | property |
public var skipFrames:Boolean = false
When is set to true, the scene will maintain a constant update framerate (based on scene.frameRate property), but render frames could be skipped to keep the framerate constant (recommended for games). Otherwise, theh update and render will be synchronized with the enterFrame event (better sittuated for simple visualizations). By default is true.
stageIndex | property |
stageIndex:int
[read-only] Gets the associated Stage3D index.
public function get stageIndex():int
surfaces | property |
public var surfaces:Vector.<Surface3D>
targetFilters | property |
public var targetFilters:Vector.<Material3D>
targetTexture | property |
targetTexture:Texture3D
public function get targetTexture():Texture3D
public function set targetTexture(value:Texture3D):void
textures | property |
public var textures:Vector.<Texture3D>
updateList | property |
updateList:Vector.<Pivot3D>
[read-only] Gets access to the update list.
public function get updateList():Vector.<Pivot3D>
updatesPerSecond | property |
updatesPerSecond:int
[read-only] Returns the update frame rate for statistical purposes.
public function get updatesPerSecond():int
updateTime | property |
updateTime:int
[read-only] Returns the time taken to update the scene in milliseconds.
public function get updateTime():int
viewPort | property |
viewPort:Rectangle
[read-only] Gets the viewport area associated to the Stage3D.
public function get viewPort():Rectangle
Scene3D | () | Constructor |
public function Scene3D(container:DisplayObjectContainer, file:String)
Create a new Scene3D object.
Parameterscontainer:DisplayObjectContainer — Object that will serve as container to render the scene. Preferably, it should be an empty MovieClip or Sprite. It must not be rotated or scaled.
| |
file:String — Optional name of the *.f3d file to be loaded into the scene. The file parameter is optional. If null, an empty scene is created. More *.f3d files can be subsequently added using the addChild or addChildFromFile method.
|
addChildFromFile | () | method |
public function addChildFromFile(request:*, parent:Pivot3D = null, loaderClass:Class = null):Pivot3D
Loads and adds a Flare3D (*.f3d) file from an external file.
Parameters
request:* — File path.
| |
parent:Pivot3D (default = null ) — pivot that will serve as container for the objects in the file.
If ‘parent’ is null, a container with the name of the file to be added to the scene is created.
| |
loaderClass:Class (default = null )
|
Pivot3D — The Flare3DLoader object that loads the file. The loaded elements will become available only after the “complete” event of the scene.
|
addTextureFromFile | () | method |
public function addTextureFromFile(request:*, optimizeForRenderToTexture:Boolean = false, format:int = 0, type:int = 0):Texture3D
Loads a texture from an external file.
Parameters
request:* — File path.
| |
optimizeForRenderToTexture:Boolean (default = false )
| |
format:int (default = 0 )
| |
type:int (default = 0 )
|
Texture3D — The loaded texture. The texture will become available after the “complete” event of the scene.
|
drawLayer | () | method |
public function drawLayer(layer:int, material:Material3D = null):void
Draws the objects in the specified layer.
Parameters
layer:int — The layer to draw.
| |
material:Material3D (default = null ) — An optional material to use in the draw operations.
|
drawQuadTexture | () | method |
public function drawQuadTexture(texture:Texture3D, x:Number, y:Number, width:Number, height:Number, material:Material3D = null, sourceFactor:String, destFactor:String):void
Parameters
texture:Texture3D | |
x:Number | |
y:Number | |
width:Number | |
height:Number | |
material:Material3D (default = null )
| |
sourceFactor:String (default = NaN )
| |
destFactor:String (default = NaN )
|
endFrame | () | method |
public function endFrame():void
freeMemory | () | method |
public function freeMemory():void
Forces to free all unused memory. This method calls to download method of all previously uploaded resources (textures, materials and surfaces), and then uploads again all the objects linked to the scene in order to render the next frame. Use this method when you want to clean the GPU memory of objects that are not currently in use. When you upload multiple files, textures, materials into the GPU, those resources will remain active until you release them.
getPointScreenCoords | () | method |
public function getPointScreenCoords(point:Vector3D, out:Vector3D = null):Vector3D
Returns the coordinates of an arbitrary world point respect to the screen. The returned values are relative to the viewPort size that is currently used.
Parameters
point:Vector3D — If a vector is specified, this vector will be filled with the returned values.
| |
out:Vector3D (default = null )
|
Vector3D — The vector with the coordinates.
|
hideLayer | () | method |
public function hideLayer(layer:int):void
Hides the objects in the specified layer.
Parameters
layer:int — The layer to hide.
|
pause | () | method |
public function pause():void
Pauses the “update” event and starts shooting the “paused” event.
See also
registerClass | () | method |
public function registerClass(... rest):void
Parameters
... rest |
render | () | method |
public function render(camera:Camera3D = null, clearDepth:Boolean = false, target:Texture3D = null):void
Renders the current scene frame. This method is called by the scene automatically but can force the rendering if necessary or if the scene is paused. This method also will dispatch the scene 'render' event but not the 'postRender' event.
Parameters
camera:Camera3D (default = null )
| |
clearDepth:Boolean (default = false )
| |
target:Texture3D (default = null )
|
resume | () | method |
setLayerSortMode | () | method |
public function setLayerSortMode(layer:int, mode:int):void
Specifies a layer to be sorted per object on each frame. This is very useful to draw correctly alpha objects that needs to be sorted. This property is property is used in conjunction with Pivot3D sortMode property.
Parameters
layer:int — Index of the layer to be sorted.
| |
mode:int (default = NaN ) — The sort mode should be one of the constants SORT_FRONT_TO_BACK, SORT_BACK_TO_FRONT or SORT_NONE.
|
setupConstants | () | method |
public function setupConstants():void
Updates global constants for each frame.
setupFrame | () | method |
public function setupFrame(camera:Camera3D = null):void
This method prepares the scene to be rendered. The render method call to this before render. You should only use this function if you want to draw manually specific objects.
Parameters
camera:Camera3D (default = null )
|
setViewport | () | method |
public function setViewport(x:Number = 0, y:Number = 0, width:Number = 640, height:Number = 480, antialias:int = 0):void
Sets the dimensions of the canvas rendering area.
Parameters
x:Number (default = 0 ) — left maring of rendering area in pixels.
| |
y:Number (default = 0 ) — Top maring of rendering area in pixels.
| |
width:Number (default = 640 ) — Width of rendering area in pixels.
| |
height:Number (default = 480 ) — Height of rendering area in pixels.
| |
antialias:int (default = 0 ) — an int selecting anti-aliasing quality. 0 is no anti-aliasing. Correlates to the number of sub-samples; a value of 2 is generally the minimum, although some systems with anti-alias with a value of one. More anti-aliasing is more depanding on the GPU and may impact performance.
|
showLayer | () | method |
public function showLayer(layer:int):void
Shows the object in the specified layer.
Parameters
layer:int — The layer to show.
|
update | () | method |
override public function update():void
Forces to update the scene and animations and will dispatch the scene 'update' event.
updateMouseEvents | () | method |
public function updateMouseEvents():void
This method forces to update mouse events for all 3D objects in the scene.
complete | Event |
flash.events.Event
flash.events.Event
This event occurs once the loading process of all the scene elements has been completed.
ioError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.IO_ERROR
Dispatched if a call to load() results in a fatal error that terminates the download.
overlay | Event |
flash.events.Event
flash.events.Event
This event occurs after all the render proccess, but before calling present().
postRender | Event |
flash.events.Event
flash.events.Event
This event occurs after rendering the scene.
progress | Event |
flash.events.ProgressEvent
flash.events.Event
This event occurs whenever the loading progress of the elements of a scene is modified.
render | Event |
flash.events.Event
flash.events.Event
This event occurs before rendering the scene.
update | Event |
flash.events.Event
flash.events.Event
This event occurs whenever the program must be updated. This event is synchronized with the frames-per-second rate defined in Device3D and bit rate is constant.
COMPLETE_EVENT | Constant |
public static const COMPLETE_EVENT:String = complete
Defines the value for the “complete” event.
OVERLAY_EVENT | Constant |
public static const OVERLAY_EVENT:String = overlay
Defines the value for the “overlay” render event.
PAUSED_EVENT | Constant |
public static const PAUSED_EVENT:String = paused
Defines the value for the “paused” event.
POSTRENDER_EVENT | Constant |
public static const POSTRENDER_EVENT:String = postRender
Defines the value for the “postRender” event.
POSTUPDATE_EVENT | Constant |
public static const POSTUPDATE_EVENT:String = postUpdate
Defines the value for the “postRender” event.
PROGRESS_EVENT | Constant |
public static const PROGRESS_EVENT:String = progress
Defines the value for the “progress” event.
RENDER_EVENT | Constant |
public static const RENDER_EVENT:String = render
Defines the value for the “render” event.
SORT_BACK_TO_FRONT | Constant |
public static const SORT_BACK_TO_FRONT:int = 2
SORT_FRONT_TO_BACK | Constant |
public static const SORT_FRONT_TO_BACK:int = 1
SORT_NONE | Constant |
public static const SORT_NONE:int = 0
UPDATE_EVENT | Constant |
public static const UPDATE_EVENT:String = update
Defines the value for the update” event.
import flare.basic.* // creates the scene. var scene:Scene3D = new Scene3D( this ) // adds the events to manage the object loading process. scene.addEventListener( Scene3D.PROGRESS_EVENT, progressEvent ) scene.addEventListener( Scene3D.COMPLETE_EVENT, completeEvent ) // loads 3d models from external files. scene.addChildFromFile( "myModel1.f3d" ) scene.addChildFromFile( "myModel2.f3d" ) scene.addChildFromFile( "myModel3.f3d" ) function progressEvent( e:Event ):void { // shows loading progress (0-100). trace( scene.loadProgress ) } function completeEvent( e:Event ):void { // once the scene loading process has been completed, elements can be accessed and the scene can be updated. scene.addEventListener( Scene3D.UPDATE_EVENT, updateEvent ) } function updateEvent( e:Event ):void { // update scene here. }