| Package | sandy.core.data |
| Class | public final class Polygon |
| Implements | IDisplayable |
| Property | Defined by | ||
|---|---|---|---|
| aEdges : Array
[READ-ONLY] property.
| Polygon | ||
| aNeighboors : Array
[READ-ONLY] property
Array of polygons that share an edge with the current polygon.
| Polygon | ||
| appearance : Appearance
The appearance of this polygon.
| Polygon | ||
| aUVCoord : Array
[READ-ONLY] property.
| Polygon | ||
| broadcaster : BubbleEventBroadcaster
[read-only]
The broadcaster property.
| Polygon | ||
| caUVCoord : Array
[READ-ONLY] property.
| Polygon | ||
| container : Sprite [read-only]
The container for this polygon.
| Polygon | ||
| cvertices : Array
[READ-ONLY] property.
| Polygon | ||
| depth : Number
The z depth of this polygon.
| Polygon | ||
| enableEvents : Boolean | Polygon | ||
| enableInteractivity : Boolean | Polygon | ||
| isClipped : Boolean = false
[READ-ONLY] property.
| Polygon | ||
| maxBounds : Vector
[READ-ONLY] property.
| Polygon | ||
| meanBounds : Vector
[READ-ONLY] property.
| Polygon | ||
| minBounds : Vector
[READ-ONLY] property.
| Polygon | ||
| normal : Vertex
[READ-ONLY] property.
| Polygon | ||
| POLYGON_MAP : Dictionary [static]
This property lists all the polygons.
| Polygon | ||
| scene : Scene3D
[READ-ONLY] property.
| Polygon | ||
| shape : Shape3D
[READ-ONLY] property.
| Polygon | ||
| uvBounds : Rectangle
[READ-ONLY] property.
| Polygon | ||
| vertexNormals : Array
[READ-ONLY] property.
| Polygon | ||
| vertices : Array
[READ-ONLY] property.
| Polygon | ||
| visible : Boolean [read-only]
Is this face visible?.
| Polygon | ||
| Property | Defined by | ||
|---|---|---|---|
| m_oContainer : Sprite | Polygon | ||
| m_oEB : BubbleEventBroadcaster | Polygon | ||
| m_oVisibilityRef : Vertex | Polygon | ||
| Method | Defined by | ||
|---|---|---|---|
|
Polygon(p_oOwner:Shape3D, p_geometry:Geometry3D, p_aVertexID:Array, p_aUVCoordsID:Array = null, p_nFaceNormalID:Number = 0, p_nEdgesID:uint = 0)
Creates a new polygon.
| Polygon | ||
|
addEventListener(p_sEvent:String, oL:*):void
Adds a listener for specifical event.
| Polygon | ||
|
clear():void
Clears the container of this polygon from graphics.
| Polygon | ||
|
Returns an array containing the vertices, clipped by the camera frustum.
| Polygon | ||
|
clipFrontPlane(p_oFrustum:Frustum):Array
Perform a clipping against the near frustum plane.
| Polygon | ||
|
computeVisibility():void
Pre-compute several properties of the polygon in the same time.
| Polygon | ||
|
Calculates and returns the normal vector of the polygon.
| Polygon | ||
|
destroy():void
Destroys the sprite attache to this polygon.
| Polygon | ||
|
Displays this polygon on its container if visible.
| Polygon | ||
|
get3DFrom2D(p_oScreenPoint:Point):Vector
Returns the real 3D position of the 2D screen position.
| Polygon | ||
|
getUVFrom2D(p_oScreenPoint:Point):UVCoord
Get the UVCoord under the 2D screen position after a mouse click or something
The 2D position is usually coming from :
var l_nClicX:Number = m_oScene.container.mouseX;
var l_nClicY:Number = m_oScene.container.mouseY;
| Polygon | ||
|
precomputeBounds():void
Pre-compute several properties of the polygon in the same time.
| Polygon | ||
|
removeEventListener(p_sEvent:String, oL:*):void
Removes a listener for specifical event.
| Polygon | ||
|
swapCulling():void
Changes which side is the "normal" culling side.
| Polygon | ||
|
toString():String
Returns a string representing of this polygon.
| Polygon | ||
| Method | Defined by | ||
|---|---|---|---|
|
_onInteraction(p_oEvt:Event):void
| Polygon | ||
|
_onTextureInteraction(p_oEvt:Event = null):void
| Polygon | ||
|
_startMouseInteraction(e:MouseEvent = null):void
| Polygon | ||
|
_stopMouseInteraction(e:MouseEvent = null):void
| Polygon | ||
| Constant | Defined by | ||
|---|---|---|---|
| id : uint
[READ-ONLY] property
Unique polygon ID Number.
| Polygon | ||
| aEdges | property |
public var aEdges:Array[READ-ONLY] property.
| aNeighboors | property |
public var aNeighboors:Array[READ-ONLY] property Array of polygons that share an edge with the current polygon.
| appearance | property |
appearance:Appearance [read-write]The appearance of this polygon.
Implementation public function get appearance():Appearance
public function set appearance(value:Appearance):void
| aUVCoord | property |
public var aUVCoord:Array[READ-ONLY] property.
| broadcaster | property |
broadcaster:BubbleEventBroadcaster [read-only]The broadcaster property.
The broadcaster is the property used to send events to listeners.
Implementation public function get broadcaster():BubbleEventBroadcaster
| caUVCoord | property |
public var caUVCoord:Array[READ-ONLY] property.
| container | property |
container:Sprite [read-only]The container for this polygon.
Implementation public function get container():Sprite
| cvertices | property |
public var cvertices:Array[READ-ONLY] property. Array of clipped vertices. Check isClipped property first to see if this array shall be containing the useful data or not.
| depth | property |
depth:Number [read-write]The z depth of this polygon.
Implementation public function get depth():Number
public function set depth(value:Number):void
| enableEvents | property |
enableEvents:Boolean [read-write]Implementation
public function get enableEvents():Boolean
public function set enableEvents(value:Boolean):void
| enableInteractivity | property |
enableInteractivity:Boolean [read-write]Implementation
public function get enableInteractivity():Boolean
public function set enableInteractivity(value:Boolean):void
| isClipped | property |
public var isClipped:Boolean = false[READ-ONLY] property. Specify if the polygon has been clipped
| maxBounds | property |
public var maxBounds:Vector[READ-ONLY] property. Max values of this polygon
| meanBounds | property |
public var meanBounds:Vector[READ-ONLY] property. Mean values of this polygon
| minBounds | property |
public var minBounds:Vector[READ-ONLY] property. Min values of this polygon
| m_oContainer | property |
protected var m_oContainer:Sprite
| m_oEB | property |
protected var m_oEB:BubbleEventBroadcaster
| m_oVisibilityRef | property |
protected var m_oVisibilityRef:Vertex
| normal | property |
public var normal:Vertex[READ-ONLY] property.
| POLYGON_MAP | property |
public static var POLYGON_MAP:DictionaryThis property lists all the polygons. This is an helping property since it allows to retrieve a polygon instance from its unique ID. Polygon objects have an unique ID with myPolygon.id. Using : Polygon.POLYGON_MAP[myPolygon.id] returns myPolygon (for sure this example has no interesst except showing the use of the property.
| scene | property |
public var scene:Scene3D[READ-ONLY] property. Refers to the Scene3D the shape is linked to.
| shape | property |
public var shape:Shape3D[READ-ONLY] property. Link to the Shape3D instance this polygon is related too.
| uvBounds | property |
public var uvBounds:Rectangle[READ-ONLY] property. This property contains the texture bounds as a Rectangle.
| vertexNormals | property |
public var vertexNormals:Array[READ-ONLY] property.
| vertices | property |
public var vertices:Array[READ-ONLY] property. Array of original vertices.
| visible | property |
visible:Boolean [read-only]Is this face visible?. The method returns the visibility value pre computed after precompute method call. This getter shall be called afer the precompute call.
Implementation public function get visible():Boolean
| Polygon | () | constructor |
public function Polygon(p_oOwner:Shape3D, p_geometry:Geometry3D, p_aVertexID:Array, p_aUVCoordsID:Array = null, p_nFaceNormalID:Number = 0, p_nEdgesID:uint = 0)Creates a new polygon.
Parametersp_oOwner:Shape3D — The shape this polygon belongs to
|
|
p_geometry:Geometry3D — The geometry this polygon is part of
|
|
p_aVertexID:Array — The vertexID array of this polygon
|
|
p_aUVCoordsID:Array (default = null) — The UVCoordsID array of this polygon
|
|
p_nFaceNormalID:Number (default = 0) — The faceNormalID of this polygon
|
|
p_nEdgesID:uint (default = 0) — The edgesID of this polygon
|
| _onInteraction | () | method |
protected function _onInteraction(p_oEvt:Event):voidParameters
p_oEvt:Event |
| _onTextureInteraction | () | method |
protected function _onTextureInteraction(p_oEvt:Event = null):voidParameters
p_oEvt:Event (default = null) |
| _startMouseInteraction | () | method |
protected function _startMouseInteraction(e:MouseEvent = null):voidParameters
e:MouseEvent (default = null) |
| _stopMouseInteraction | () | method |
protected function _stopMouseInteraction(e:MouseEvent = null):voidParameters
e:MouseEvent (default = null) |
| addEventListener | () | method |
public function addEventListener(p_sEvent:String, oL:*):voidAdds a listener for specifical event.
Parametersp_sEvent:String — Name of the Event.
|
|
oL:* — Listener object.
|
| clear | () | method |
public function clear():voidClears the container of this polygon from graphics.
| clip | () | method |
public function clip(p_oFrustum:Frustum):ArrayReturns an array containing the vertices, clipped by the camera frustum.
Parametersp_oFrustum:Frustum |
Array — The array of clipped vertices
|
| clipFrontPlane | () | method |
public function clipFrontPlane(p_oFrustum:Frustum):ArrayPerform a clipping against the near frustum plane.
Parametersp_oFrustum:Frustum |
Array — The array of clipped vertices
|
| computeVisibility | () | method |
public function computeVisibility():voidPre-compute several properties of the polygon in the same time. List of the computed properties : - visibility : if the polygon is visible
| createNormal | () | method |
public function createNormal():VectorCalculates and returns the normal vector of the polygon.
ReturnsVector —
The normal vector
|
| destroy | () | method |
public function destroy():voidDestroys the sprite attache to this polygon.
| display | () | method |
public function display(p_oScene:Scene3D, p_oContainer:Sprite = null):voidDisplays this polygon on its container if visible.
Parametersp_oScene:Scene3D — The current scene this polygon is rendered into
|
|
p_oContainer:Sprite (default = null) — The container to draw on
|
| get3DFrom2D | () | method |
public function get3DFrom2D(p_oScreenPoint:Point):VectorReturns the real 3D position of the 2D screen position. The 2D position is usually coming from :
var l_nClicX:Number = m_oScene.container.mouseX;
var l_nClicY:Number = m_oScene.container.mouseY;
p_oScreenPoint:Point |
Vector —
the real 3D position which correspond to the intersection onto that polygone
|
| getUVFrom2D | () | method |
public function getUVFrom2D(p_oScreenPoint:Point):UVCoordGet the UVCoord under the 2D screen position after a mouse click or something The 2D position is usually coming from :
var l_nClicX:Number = m_oScene.container.mouseX;
var l_nClicY:Number = m_oScene.container.mouseY;
p_oScreenPoint:Point |
UVCoord —
the UVCoord under the 2D screen point
|
| precomputeBounds | () | method |
public function precomputeBounds():voidPre-compute several properties of the polygon in the same time. List of the computed properties :
| removeEventListener | () | method |
public function removeEventListener(p_sEvent:String, oL:*):voidRemoves a listener for specifical event.
Parametersp_sEvent:String — Name of the Event.
|
|
oL:* — Listener object.
|
| swapCulling | () | method |
public function swapCulling():voidChanges which side is the "normal" culling side.
The method also swaps the front and back skins.
| toString | () | method |
public function toString():StringReturns a string representing of this polygon.
ReturnsString — The string representation.
|
| id | constant |
public const id:uint[READ-ONLY] property Unique polygon ID Number.