Packagealternativa.engine3d.core
Classpublic final class Face
Implementsflash.events.IEventDispatcher

The face that is being created by three or more vertices. Faces are parts of objects of the class Mesh. Every face contains references to the mesh and surface to which it belongs. To map a texture to a face, UV-coordinates can be assigned to the first three vertices of the face.

The class implements flash.events.IEventDispatcher interface and can dispatch mouse events which contain an information about point in the 3d-space where an event has occured.



Public Properties
 PropertyDefined by
  aUV : Point
UV-coordinates of the first face's vertex
Face
  bUV : Point
UV-coordinates of the second face's vertex
Face
  cUV : Point
UV-coordinates of the third face's vertex
Face
  edgeJoinedFaces : Set
[read-only] A set of faces which have common edges with current one.
Face
  id : Object
[read-only] Face identifier in Mesh-object.
Face
  mesh : Mesh
[read-only] Mesh-object containing given face.
Face
  mouseEnabled : Boolean = true
Specifies whether this face receives mouse messages.
Face
  normal : Point3D
[read-only] Face normal in local coordinates system.
Face
  surface : Surface
[read-only] Get surface in which given face is located.
Face
  vertices : Array
[read-only] A set of face vertices, represented as alternativa.
Face
  verticesCount : uint
[read-only] Get number of given face vertices.
Face
Public Methods
 MethodDefined by
  
Face(vertices:Array)
Create face instance.
Face
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
Face
  
dispatchEvent(event:Event):Boolean
Dispatches an event.
Face
  
getUV(point:Point3D):Point
Count UV-coordinates for any given point in mesh coordinates system.
Face
  
hasEventListener(type:String):Boolean
Checks if there are registered event listeners for events with the specified type.
Face
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
Face
  
toString():String
Creates a string representation of a Face object.
Face
  
willTrigger(type:String):Boolean
Face
Events
 EventSummaryDefined by
   Dispatched when a user presses and releases left mouse button over the same face.Face
   Dispatched when a user presses left mouse button over a face.Face
   Dispatched when a user moves mouse pointer while it is over a face.Face
   Dispatched when a user moves mouse pointer away from a face.Face
   Dispatched when a user moves mouse pointer over a face.Face
   Dispatched when a user releases left mouse button over a face.Face
   Dispatched when a user spins mouse wheel over a face.Face
Property detail
aUVproperty
aUV:Point  [read-write]

UV-coordinates of the first face's vertex

Implementation
    public function get aUV():Point
    public function set aUV(value:Point):void
bUVproperty 
bUV:Point  [read-write]

UV-coordinates of the second face's vertex

Implementation
    public function get bUV():Point
    public function set bUV(value:Point):void
cUVproperty 
cUV:Point  [read-write]

UV-coordinates of the third face's vertex

Implementation
    public function get cUV():Point
    public function set cUV(value:Point):void
edgeJoinedFacesproperty 
edgeJoinedFaces:Set  [read-only]

A set of faces which have common edges with current one.

Implementation
    public function get edgeJoinedFaces():Set
idproperty 
id:Object  [read-only]

Face identifier in Mesh-object. If face is not a part of any Mesh object, null is returned.

Implementation
    public function get id():Object
meshproperty 
mesh:Mesh  [read-only]

Mesh-object containing given face.

Implementation
    public function get mesh():Mesh
mouseEnabledproperty 
public var mouseEnabled:Boolean = true

Specifies whether this face receives mouse messages.

normalproperty 
normal:Point3D  [read-only]

Face normal in local coordinates system.

Implementation
    public function get normal():Point3D
surfaceproperty 
surface:Surface  [read-only]

Get surface in which given face is located.

Implementation
    public function get surface():Surface
verticesproperty 
vertices:Array  [read-only]

A set of face vertices, represented as alternativa.engine3d.core.Vertex class objects.

Implementation
    public function get vertices():Array

See also

verticesCountproperty 
verticesCount:uint  [read-only]

Get number of given face vertices.

Implementation
    public function get verticesCount():uint
Constructor detail
Face()constructor
public function Face(vertices:Array)

Create face instance.

Parameters
vertices:Arrayan array with alternativa.engine3d.core.core.Vertex type objects, which set faces' vertices in clockwise order.

See also

Method detail
addEventListener()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Registers an event listener.

Parameters
type:Stringthe type of an event
 
listener:Functionthe listener function
 
useCapture:Boolean (default = false)not used
 
priority:int (default = 0)the priority level of the event listener. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added.
 
useWeakReference:Boolean (default = false)Determines whether the reference to the listener is strong or weak. A strong reference prevents your listener from being garbage-collected. A weak reference does not.
dispatchEvent()method 
public function dispatchEvent(event:Event):Boolean

Dispatches an event.

Parameters
event:Eventthe event to dispatch

Returns
Booleanfalse
getUV()method 
public function getUV(point:Point3D):Point

Count UV-coordinates for any given point in mesh coordinates system.

Parameters
point:Point3Da point at face surface, for which UV-coordinates are being calculated

Returns
PointUV-coordinates of the given point
hasEventListener()method 
public function hasEventListener(type:String):Boolean

Checks if there are registered event listeners for events with the specified type.

Parameters
type:Stringthe type of an event

Returns
Booleantrue if there are listeners of events with the specified type, otherwise false
removeEventListener()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Removes an event listener.

Parameters
type:Stringthe type of an event
 
listener:Functionthe listener function
 
useCapture:Boolean (default = false)not used
toString()method 
public function toString():String

Creates a string representation of a Face object.

Returns
Stringstring object representation
willTrigger()method 
public function willTrigger(type:String):Boolean

Parameters
type:String

Returns
Boolean
Event detail
clickevent 
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.CLICK

Dispatched when a user presses and releases left mouse button over the same face.

The value of the type property of a click event object.
mouseDownevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_DOWN

Dispatched when a user presses left mouse button over a face.

The value of the type property of a mouseDown event object.
mouseMoveevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_MOVE

Dispatched when a user moves mouse pointer while it is over a face.

The value of the type property of a mouseMove event object.
mouseOutevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_OUT

Dispatched when a user moves mouse pointer away from a face.

The value of the type property of a mouseOut event object.
mouseOverevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_OVER

Dispatched when a user moves mouse pointer over a face.

The value of the type property of a mouseOver event object.
mouseUpevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_UP

Dispatched when a user releases left mouse button over a face.

The value of the type property of a mouseUp event object.
mouseWheelevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_WHEEL

Dispatched when a user spins mouse wheel over a face.

The value of the type property of a mouseWheel event object.