Packagealternativa.engine3d.core
Classpublic class Scene3D

Scene is an interacting objects' container. All objects interactions are being calculated within one scene. Class provides signals system work and implements BSP-building algorithm for scene content.

See also

splitters
sectors


Public Properties
 PropertyDefined by
  planeOffsetThreshold : Number
The distance measurement threshold.
Scene3D
  root : Object3D
Scene root object.
Scene3D
  sectors : Array
Scene sectors.
Scene3D
  splitAnalysis : Boolean
Splitter analysis mode flag.
Scene3D
  splitBalance : Number
BSP-tree balancing parameter (works when analysis is turned on).
Scene3D
  splitters : Array
List of scene splitters.
Scene3D
Public Methods
 MethodDefined by
  
Create an instance of class.
Scene3D
  
calculate():void
Scene calculating.
Scene3D
  
drawBSP(container:Sprite):void
BSP-tree visualization.
Scene3D
  
hasChanges():Boolean
Checks if a scene has changed since the last call of calculate() method.
Scene3D
Property detail
planeOffsetThresholdproperty
planeOffsetThreshold:Number  [read-write]

The distance measurement threshold. When BSP-tree is being built, a point is considered to be on the splitter's plane if distance from the point to the plane is less than specified threshold.

The default value is 0.01.

Implementation
    public function get planeOffsetThreshold():Number
    public function set planeOffsetThreshold(value:Number):void
rootproperty 
root:Object3D  [read-write]

Scene root object.

Implementation
    public function get root():Object3D
    public function set root(value:Object3D):void
sectorsproperty 
sectors:Array  [read-write]

Scene sectors. Sectors specify visibility between parts of the scene which have been formed by splitters.

Implementation
    public function get sectors():Array
    public function set sectors(value:Array):void

Throws
SectorInOtherSceneError throws when a sector has already been added to another scene

See also

splitAnalysisproperty 
splitAnalysis:Boolean  [read-write]

Splitter analysis mode flag. If active, every adding polygon is being evaluated as a dividing plane (splitter). Splitters with the most quality are being added to BSP-tree first.

The default value is true.

Implementation
    public function get splitAnalysis():Boolean
    public function set splitAnalysis(value:Boolean):void

See also

splitBalanceproperty 
splitBalance:Number  [read-write]

BSP-tree balancing parameter (works when analysis is turned on). May vary from 0 (minimal polygon fragmentation) to 1 (maximum balance).

The default value is 0.

Implementation
    public function get splitBalance():Number
    public function set splitBalance(value:Number):void

See also

splittersproperty 
splitters:Array  [read-write]

List of scene splitters. Each element is an instance of Splitter class. The order of scene division is determined by the order of splitters in the specified array.

Implementation
    public function get splitters():Array
    public function set splitters(value:Array):void

Throws
SplitterInOtherSceneError throws when a splitter has already been added to another scene

See also

Constructor detail
Scene3D()constructor
public function Scene3D()

Create an instance of class.

Method detail
calculate()method
public function calculate():void

Scene calculating. Method analyzes all changes happened since last iteration, forms command list and complete these commands in necessary order. As a result, all the views with cameras in scene are being redraw.

drawBSP()method 
public function drawBSP(container:Sprite):void

BSP-tree visualization. Tree is being draw in given container. Every tree node is marked as a dot with first node polyigon material color (when texture is applied, dot is colored by first texture pixel color).

Parameters
container:Spritecontainer that is used to draw BSP-tree
hasChanges()method 
public function hasChanges():Boolean

Checks if a scene has changed since the last call of calculate() method.

Returns
Booleantrue if a scene has changed since the last call of calculate() method, otherwise false

See also