Packagealternativa.engine3d.core
Classpublic class Sector

Sectors provide a mechanism to control visibility of different scene parts in addition to splitters system. Each sector is located in one of the BSP-tree branches, which have been created by splitters. Also, every sector stores a set of other sectors, which are potentially visible from it.

If a camera is located in a child branch of a tree node, formed by a splitter, then visibility of the other branch of that node is determined by the following rules:

Sectors are specified in the Scene.sectors property.

See also

Scene3D.sectors
Splitter


Public Properties
 PropertyDefined by
  name : String
The name of the sector.
Sector
Public Methods
 MethodDefined by
  
Sector(x:Number = 0, y:Number = 0, z:Number = 0, name:String = null)
Creates a new instance of a sector.
Sector
  
addVisible(sector:Sector, ... sectors):void
Adds the specified sectors to the visibility list.
Sector
  
isVisible(sector:Sector):Boolean
Determines potential visibility of the specified sector.
Sector
  
removeVisible(sector:Sector, ... sectors):void
Removes the specified sectors from the visibility list.
Sector
  
toString():String
Creates a string representation of an object.
Sector
Property detail
nameproperty
public var name:String

The name of the sector.

Constructor detail
Sector()constructor
public function Sector(x:Number = 0, y:Number = 0, z:Number = 0, name:String = null)

Creates a new instance of a sector. Specified coordinates determine the child branch of a splitter, in which the sector will be located.

Parameters
x:Number (default = 0)X coordinate
 
y:Number (default = 0)Y coordinate
 
z:Number (default = 0)Z coordinate
 
name:String (default = null)the name of the sector. If null have been specified, the name will be generated automatically.
Method detail
addVisible()method
public function addVisible(sector:Sector, ... sectors):void

Adds the specified sectors to the visibility list. The visibility of sectors is mutual, therefore the current sector is automatically added to visibility list of each specified sector.

Parameters
sector:Sectorthe sector to add to the visibility list
 
... sectorsadditional sectors to add to the visibility list

See also

isVisible()method 
public function isVisible(sector:Sector):Boolean

Determines potential visibility of the specified sector.

Parameters
sector:Sectorsector whose visibility is checked

Returns
Booleantrue, if the specified sector is in the visibility list, otherwise false
removeVisible()method 
public function removeVisible(sector:Sector, ... sectors):void

Removes the specified sectors from the visibility list. The visibility of sectors is mutual, therefore the current sector is automatically removed from visibility list of each specified sector.

Parameters
sector:Sectorthe sector to delete from the visibility list
 
... sectorsadditional sectors to remove from the visibility list

See also

toString()method 
public function toString():String

Creates a string representation of an object.

Returns
Stringstring object representation