Packagealternativa.engine3d.core
Classpublic class Splitter

Splitters are used to control visibility of different parts of the scene. Splitters are located closer to the root of the scene's BSP-tree than regular polygons. Thus, they form a system of branches, each of which can be hidden from its immediate neighbor.

For example, imagine the scene has a single splitter, and the camera is located in the left child branch of the node, formed by the splitter. When the splitter is open, then the camera can potentially see the contents of the right branch. Otherwise, when the splitter is closed, the camera cannot see the contents of the right branch at all.

The depth of every splitter in the BSP-tree is determined by the order in which the splitters have been specified in the Scene3D.splitters property. Each subsequent splitter divides the subspaces formed by all previous splitters. As any regular polygon, a splitter itself can be split during the BSP procedure.

For additional visibility control objects of the class Sector can be used.

See also

Scene3D.splitters
Sector


Public Properties
 PropertyDefined by
  name : String
Object name.
Splitter
  open : Boolean
Shows whether the splitter is open or not.
Splitter
  vertices : Array
[read-only] The list of the splitter's vertices.
Splitter
Public Methods
 MethodDefined by
  
Splitter(vertices:Array, name:String = null)
Creates a new instance of a splitter.
Splitter
  
createFromFace(face:Face, name:String = null):Splitter
[static]Creates a splitter from a face.
Splitter
  
toString():String
Creates a string representation of an object.
Splitter
Property detail
nameproperty
public var name:String

Object name.

openproperty 
open:Boolean  [read-write]

Shows whether the splitter is open or not. If the splitter is closed, a camera which is located in one of its branches doesn't render the other branch.

Implementation
    public function get open():Boolean
    public function set open(value:Boolean):void
verticesproperty 
vertices:Array  [read-only]

The list of the splitter's vertices. Each element is an instance of the Point3D class.

Implementation
    public function get vertices():Array
Constructor detail
Splitter()constructor
public function Splitter(vertices:Array, name:String = null)

Creates a new instance of a splitter.

Parameters
vertices:Arraylist of the splitter's vertices. The plane which contains the vertices will be used as the plane of the splitter.
 
name:String (default = null)the name of the splitter. If null have been specified, the name will be generated automatically.

Throws
SplitterNeedMoreVerticesError throws when less than three vertices have been specified
Method detail
createFromFace()method
public static function createFromFace(face:Face, name:String = null):Splitter

Creates a splitter from a face. If the parent object of the face is on a scene, then global coordinates of the face's vertices are used. Otherwise local coordinates of the face's vertices are used.

Parameters
face:Facethe face from which the splitter is constructed
 
name:String (default = null)the name of the new splitter. If

Returns
Splitter
toString()method 
public function toString():String

Creates a string representation of an object.

Returns
Stringstring object representation