Packagealternativa.engine3d.objects
Classpublic class Sprite3D
InheritanceSprite3D Inheritance Object3D
SubclassesAnimSprite

Flat and always turned to camera 3D object.



Public Properties
 PropertyDefined by
 Inheritedalpha : Number = 1
Alpha transparency value.
Object3D
  autoSize : Boolean = false
If true the size of sprite is synchronized with texture size.
Sprite3D
 InheritedblendMode : String = "normal"
A value from the flash.
Object3D
 InheritedboundMaxX : Number = 1e+22
Right bound of object in its space.
Object3D
 InheritedboundMaxY : Number = 1e+22
Front bound of object in its space.
Object3D
 InheritedboundMaxZ : Number = 1e+22
Top bound of object in its space.
Object3D
 InheritedboundMinX : Number = -1e+22
Left bound of object in its space.
Object3D
 InheritedboundMinY : Number = -1e+22
Back bound of object in its space.
Object3D
 InheritedboundMinZ : Number = -1e+22
Bottom bound of object in its space.
Object3D
  clipping : int = 2
Object clipping mode by camera frustum.
Sprite3D
 InheritedcolorTransform : ColorTransform = null
A ColorTransform object containing values that universally adjust the colors in the display object.
Object3D
 InheritedconcatenatedMatrix : Matrix3D
A Matrix3D object which is the combined result of transformation matrices of object and all its parens.
Object3D
 InheriteddoubleClickEnabled : Boolean = false
Specifies whether the object receives doubleClick events.
Object3D
 Inheritedfilters : Array = null
An indexed array that contains each filter object currently associated with the display object.
Object3D
  height : Number
Sprite height.
Sprite3D
  material : Material
Sprite material.
Sprite3D
 Inheritedmatrix : Matrix3D
Matrix3D object.
Object3D
 InheritedmouseEnabled : Boolean = true
Specifies whether this object receives mouse messages.
Object3D
 Inheritedname : String
Object name.
Object3D
  originX : Number = 0.5
X coordinate of the origin point.
Sprite3D
  originY : Number = 0.5
Y coordinate of the origin point.
Sprite3D
 Inheritedparent : Object3DContainer
Indicates the Object3DContainer object that contains this display object.
Object3D
  perspectiveScale : Boolean = true
Perspective scale option.
Sprite3D
  rotation : Number = 0
Rotation angle (in radians).
Sprite3D
 InheritedrotationX : Number = 0
Rotation angle by X axis (in radians).
Object3D
 InheritedrotationY : Number = 0
Rotation angle by Y axis (in radians).
Object3D
 InheritedrotationZ : Number = 0
Rotation angle by Z axis (in radians).
Object3D
 InheritedscaleX : Number = 1
Scale by X axis.
Object3D
 InheritedscaleY : Number = 1
Scale by Y axis.
Object3D
 InheritedscaleZ : Number = 1
Scale by Z axis.
Object3D
  sorting : int = 0
Sorting mode.
Sprite3D
 InheriteduseHandCursor : Boolean = false
Set this property to true to show "hand" mouse cursor while hovering the object, false otherwise.
Object3D
 Inheritedvisible : Boolean = true
Whether or not the display object is visible.
Object3D
  width : Number
Sprite width.
Sprite3D
 Inheritedx : Number = 0
X coordinate.
Object3D
 Inheritedy : Number = 0
Y coordinate.
Object3D
 Inheritedz : Number = 0
Z coordinate.
Object3D
Public Methods
 MethodDefined by
  
Sprite3D(width:Number, height:Number, material:Material = null)
Creates a new instance.
Sprite3D
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
Object3D
 Inherited
Calculates object bounds in its space.
Object3D
  
calculateResolution(textureWidth:int, textureHeight:int, type:int = 1, matrix:Matrix3D = null):Number
Calculates how many units of 3D space correspond to one pixel of texture.
Sprite3D
  
Returns an object that is an exact copy of the original object.
Sprite3D
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
Object3D
 Inherited
globalToLocal(point:Vector3D):Vector3D
Transforms a point from global space to local spce of the object.
Object3D
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
Object3D
  
intersectRay(origin:Vector3D, direction:Vector3D, excludedObjects:Dictionary = null, camera:Camera3D = null):RayIntersectionData
Searches for the ray intersection.
Sprite3D
 Inherited
localToGlobal(point:Vector3D):Vector3D
Transforms a point from local space of object to global spce.
Object3D
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
Object3D
 Inherited
toString():String
Returns the string presentation of the specified object.
Object3D
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
Object3D
Protected Methods
 MethodDefined by
  
Copies the base properties.
Sprite3D
Events
 EventSummaryDefined by
 Inherited Dispatched when a user presses and releases the main button of the user's pointing device over the same object.Object3D
 Inherited Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same object when that object's doubleClickEnabled flag is set to true.Object3D
 Inherited Dispatched when a user presses the pointing device button over an object.Object3D
 Inherited Dispatched when a user moves the pointing device while it is over an object.Object3D
 Inherited Dispatched when the user moves a pointing device away from an object.Object3D
 Inherited Dispatched when the user moves a pointing device over an object.Object3D
 Inherited Dispatched when a user releases the pointing device button over an object.Object3D
 Inherited Dispatched when a mouse wheel is spun over an object.Object3D
 Inherited Dispatched when the user moves a pointing device away from an object.Object3D
 Inherited Dispatched when the user moves a pointing device over an object.Object3D
Property detail
autoSizeproperty
public var autoSize:Boolean = false

If true the size of sprite is synchronized with texture size. Default value is false.

See also

clippingproperty 
public var clipping:int = 2

Object clipping mode by camera frustum. You can use following constants of Clipping class: Clipping.BOUND_CULLING, Clipping.FACE_CULLING, Clipping.FACE_CLIPPING. Default value is Clipping.FACE_CLIPPING.

See also

heightproperty 
public var height:Number

Sprite height.

materialproperty 
public var material:Material

Sprite material.

See also

originXproperty 
public var originX:Number = 0.5

X coordinate of the origin point. Can be from 0 to 1. Default value is 0.5.

originYproperty 
public var originY:Number = 0.5

Y coordinate of the origin point. Can be from 0 to 1. Default value is 0.5.

perspectiveScaleproperty 
public var perspectiveScale:Boolean = true

Perspective scale option. If false, size of sprite will be the same regardless of distance to camera. Default value is true.

rotationproperty 
public var rotation:Number = 0

Rotation angle (in radians).

sortingproperty 
public var sorting:int = 0

Sorting mode. You can use the following constants of Sorting to determine sorting property: Sorting.NONE, Sorting.AVERAGE_Z, Sorting.DYNAMIC_BSP. This property doen't mean anything with usual drawing. But if sprite is a child of ConflictContainer object, then in the sorting on polygonal level it does mean something. Default value is Sorting.NONE.

See also

widthproperty 
public var width:Number

Sprite width.

Constructor detail
Sprite3D()constructor
public function Sprite3D(width:Number, height:Number, material:Material = null)

Creates a new instance.

Parameters
width:NumberSprite width.
 
height:NumberSprite height.
 
material:Material (default = null)Material.

See also

Method detail
calculateResolution()method
public override function calculateResolution(textureWidth:int, textureHeight:int, type:int = 1, matrix:Matrix3D = null):Number

Calculates how many units of 3D space correspond to one pixel of texture. It is useful for mipmapping.

Parameters
textureWidth:intTexture width.
 
textureHeight:intTexture height.
 
type:int (default = 1)Calculation method: 0 - by first edge, 1 - average value, 2 - max value, 3 - min value.
 
matrix:Matrix3D (default = null)Transformation matrix.

Returns
NumberResolution.
clone()method 
public override function clone():Object3D

Returns an object that is an exact copy of the original object.

Returns
Object3DOriginal object clone.
clonePropertiesFrom()method 
protected override function clonePropertiesFrom(source:Object3D):void

Copies the base properties.

Parameters
source:Object3DSource object.
intersectRay()method 
public override function intersectRay(origin:Vector3D, direction:Vector3D, excludedObjects:Dictionary = null, camera:Camera3D = null):RayIntersectionData

Searches for the ray intersection.

Parameters
origin:Vector3DRay origin.
 
direction:Vector3DRay direction.
 
excludedObjects:Dictionary (default = null)The objects that are keys of this dictionary will be exluded from intersection test.
 
camera:Camera3D (default = null)The camera for Sprite3D objects intersection test.

Returns
RayIntersectionDataIntersection test result - RayIntersectionData object. If there is no intersection the value of null will be returned.