Package | alternativa.engine3d.core |
Class | public class Object3D |
Inheritance | Object3D ![]() |
Implements | flash.events.IEventDispatcher |
Subclasses | AxisAlignedSprite, Camera3D, Joint, Light3D, LOD, Mesh, Occluder, Sprite3D, WireFrame |
Object3D
class ia a base class for all 3D objects. Any Object3D
has a property
of transformation that defines its position in space, the property boundBox
,
which describes the rectangular parallelepiped into which fits this 3D object.
The last feature of this class is the one place in the 3d hierarchy like
DisplayObject
has its own place in Display List.
Unlike the previous version Alternativa3D, an instance of this class can contain many children,
so it can act as a container. This also applies to all the inheritors Object3D
.
See also
Property | Defined By | ||
---|---|---|---|
boundBox : BoundBox
Bounds of the object described as rectangular parallelepiped. | Object3D | ||
concatenatedMatrix : Matrix3D [read-only]
A Matrix3D object representing the combined transformation matrices of the Object3D
and all of its parent objects, back to the root level. | Object3D | ||
doubleClickEnabled : Boolean = false
Specifies whether the object receives doubleClick events. | Object3D | ||
excludedLights : Vector.<Light3D> [read-only]
Returns excluded lights list of current object. | Object3D | ||
matrix : Matrix3D
The matrix property represents a transformation matrix that determines the position
and orientation of an Object3D. | Object3D | ||
mouseChildren : Boolean = true
Determines whether or not the children of the object are mouse, or user input device, enabled. | Object3D | ||
mouseEnabled : Boolean = true
Specifies whether this object receives mouse, or other user input, messages. | Object3D | ||
name : String
Name of the object. | Object3D | ||
numChildren : int [read-only]
Returns the number of children of this object. | Object3D | ||
parent : Object3D [read-only]
Object3D, to which this object was added as a child. | Object3D | ||
rotationX : Number
The angle of rotation of Object3D around the X-axis expressed in radians. | Object3D | ||
rotationY : Number
The angle of rotation of Object3D around the Y-axis expressed in radians. | Object3D | ||
rotationZ : Number
The angle of rotation of Object3D around the Z-axis expressed in radians. | Object3D | ||
scaleX : Number
The scale of the Object3D along the X-axis. | Object3D | ||
scaleY : Number
The scale of the Object3D along the Y-axis. | Object3D | ||
scaleZ : Number
The scale of the Object3D along the Z-axis. | Object3D | ||
useHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor)
appears when the pointer rolls over a Object3D. | Object3D | ||
userData : Object
Custom data available to store within Object3D by user. | Object3D | ||
visible : Boolean = true
Whether or not the display object is visible. | Object3D | ||
x : Number
X coordinate. | Object3D | ||
y : Number
Y coordinate. | Object3D | ||
z : Number
Z coordinate. | Object3D |
Method | Defined By | ||
---|---|---|---|
Adds given Object3D instance as a child to the end of this Object3D's children list. | Object3D | ||
Adds a child Object3D instance to this Object3D instance. | Object3D | ||
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 | ||
calculateBoundBox():void
Calculates object's bounds in its own coordinates
| Object3D | ||
clearExcludedLights(updateChildren:Boolean = false):void
Resets list of lights excluded from lighting this object. | Object3D | ||
Returns a copy of object. | Object3D | ||
Check if given object is child of this Object3D. | Object3D | ||
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | Object3D | ||
excludeLight(light:Light3D, updateChildren:Boolean = false):void
Disables lighting of the object by given light. | Object3D | ||
getChildAt(index:int):Object3D
Returns the child Object3D instance that exists at the specified index. | Object3D | ||
getChildByName(name:String):Object3D
Returns child Object3D instance with given name. | Object3D | ||
getChildIndex(child:Object3D):int
Returns index of given child Object3D instance. | Object3D | ||
getResources(hierarchy:Boolean = false, resourceType:Class = null):Vector.<Resource>
Gather the resources of this Object3D. | Object3D | ||
globalToLocal(point:Vector3D):Vector3D
Converts the Vector3D object from the root Object3D (global) coordinates to the local Object3D's own coordinates. | Object3D | ||
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):RayIntersectionData
Searches for the intersection of an Object3D and given ray, defined by origin and direction. | Object3D | ||
localToGlobal(point:Vector3D):Vector3D
Converts the Vector3D object from the Object3D's own (local) coordinates to the root Object3D (global) coordinates. | Object3D | ||
Removes the specified child Object3D instance from the child list of the
this Object3D instance. | Object3D | ||
removeChildAt(index:int):Object3D
Removes a child Object3D from the specified index position in the child list of
the Object3D. | Object3D | ||
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
Removes child objects in given range of indexes. | Object3D | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. | Object3D | ||
setChildIndex(child:Object3D, index:int):void
Sets index for child Object3D instance. | Object3D | ||
Swaps index positions of two specified child objects. | Object3D | ||
swapChildrenAt(index1:int, index2:int):void
Swaps index positions of two child objects by its index. | Object3D | ||
toString():String
Returns the string representation of the specified object. | Object3D | ||
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 |
Method | Defined By | ||
---|---|---|---|
clonePropertiesFrom(source:Object3D):void
Copies basic properties of Object3D. | Object3D |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatches when an Object3D is added as a child to another Object3D. | Object3D | |||
Dispatched when a user presses and releases the main button of the user's pointing device over the same Object3D. | Object3D | |||
Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same Object3D. | Object3D | |||
Dispatched when a user presses and releases the middle button of the user's pointing device over the same Object3D. | Object3D | |||
Dispatched when a user presses the middle pointing device button over an Object3D instance. | Object3D | |||
Dispatched when a user releases the pointing device button over an Object3D instance. | Object3D | |||
Dispatched when a user presses the pointing device button over an Object3D instance. | Object3D | |||
Dispatched when a user moves the pointing device while it is over an Object3D. | Object3D | |||
Dispatched when the user moves a pointing device away from an Object3D instance. | Object3D | |||
Dispatched when the user moves a pointing device over an Object3D instance. | Object3D | |||
Dispatched when a user releases the pointing device button over an Object3D instance. | Object3D | |||
Dispatched when a mouse wheel is spun over an Object3D instance. | Object3D | |||
Dispatched when a Object3D is about to be removed from the children list. | Object3D | |||
Dispatched when a user presses and releases the right button of the user's pointing device over the same Object3D. | Object3D | |||
Dispatched when a user presses the right pointing device button over an Object3D instance. | Object3D | |||
Dispatched when a user releases the pointing device button over an Object3D instance. | Object3D | |||
Dispatched when the user moves a pointing device away from an Object3D instance. | Object3D | |||
Dispatched when the user moves a pointing device over an Object3D instance. | Object3D |
boundBox | property |
public var boundBox:BoundBox
Bounds of the object described as rectangular parallelepiped.
concatenatedMatrix | property |
concatenatedMatrix:Matrix3D
[read-only]
A Matrix3D
object representing the combined transformation matrices of the Object3D
and all of its parent objects, back to the root level.
public function get concatenatedMatrix():Matrix3D
doubleClickEnabled | property |
public var doubleClickEnabled:Boolean = false
Specifies whether the object receives doubleClick
events.
The default value is false, which means that by default an Object3D
instance does not receive doubleClick
events.
The doubleClickEnabled
property of current stage
also should be true
.
excludedLights | property |
excludedLights:Vector.<Light3D>
[read-only] Returns excluded lights list of current object.
public function get excludedLights():Vector.<Light3D>
matrix | property |
matrix:Matrix3D
The matrix
property represents a transformation matrix that determines the position
and orientation of an Object3D
.
public function get matrix():Matrix3D
public function set matrix(value:Matrix3D):void
mouseChildren | property |
public var mouseChildren:Boolean = true
Determines whether or not the children of the object are mouse, or user input device, enabled.
In case of false
, the value of target
property of the event
will be the self Object3D
wether mouse pointed on it or on its child.
The default value is true
.
mouseEnabled | property |
public var mouseEnabled:Boolean = true
Specifies whether this object receives mouse, or other user input, messages.
The default value is true
.
The behaviour is consistent with behaviour of flash.display.InteractiveObject
.
name | property |
public var name:String
Name of the object.
numChildren | property |
numChildren:int
[read-only] Returns the number of children of this object.
public function get numChildren():int
parent | property |
parent:Object3D
[read-only]
Object3D
, to which this object was added as a child.
public function get parent():Object3D
rotationX | property |
rotationX:Number
The angle of rotation of Object3D
around the X-axis expressed in radians.
public function get rotationX():Number
public function set rotationX(value:Number):void
rotationY | property |
rotationY:Number
The angle of rotation of Object3D
around the Y-axis expressed in radians.
public function get rotationY():Number
public function set rotationY(value:Number):void
rotationZ | property |
rotationZ:Number
The angle of rotation of Object3D
around the Z-axis expressed in radians.
public function get rotationZ():Number
public function set rotationZ(value:Number):void
scaleX | property |
scaleX:Number
The scale of the Object3D
along the X-axis.
public function get scaleX():Number
public function set scaleX(value:Number):void
scaleY | property |
scaleY:Number
The scale of the Object3D
along the Y-axis.
public function get scaleY():Number
public function set scaleY(value:Number):void
scaleZ | property |
scaleZ:Number
The scale of the Object3D
along the Z-axis.
public function get scaleZ():Number
public function set scaleZ(value:Number):void
useHandCursor | property |
useHandCursor:Boolean
A Boolean value that indicates whether the pointing hand (hand cursor)
appears when the pointer rolls over a Object3D
.
public function get useHandCursor():Boolean
public function set useHandCursor(value:Boolean):void
userData | property |
public var userData:Object
Custom data available to store within Object3D
by user.
visible | property |
public var visible:Boolean = true
Whether or not the display object is visible.
x | property |
x:Number
X coordinate.
public function get x():Number
public function set x(value:Number):void
y | property |
y:Number
Y coordinate.
public function get y():Number
public function set y(value:Number):void
z | property |
z:Number
Z coordinate.
public function get z():Number
public function set z(value:Number):void
addChild | () | method |
public function addChild(child:Object3D):Object3D
Adds given Object3D
instance as a child to the end of this Object3D
's children list.
If the given object was added to another Object3D
already, it removes from it's old place.
Parameters
child:Object3D — The Object3D instance to add.
|
Object3D — The Object3D instance that you pass in the child parameter.
|
addChildAt | () | method |
public function addChildAt(child:Object3D, index:int):Object3D
Adds a child Object3D
instance to this Object3D
instance. The child is added at the index position specified.
Parameters
child:Object3D — The Object3D instance to add as a child of this Object3D instance.
| |
index:int — The index position to which the child is added.
|
Object3D — The Object3D instance that you pass in the child parameter.
|
addEventListener | () | method |
public function 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.
Parameters
type:String — The type of event.
| |
listener:Function — The listener function that processes the event.
| |
useCapture:Boolean (default = false ) — Determines whether the listener works in the capture phase or the target and bubbling phases.
| |
priority:int (default = 0 ) — The priority level of the event listener.
| |
useWeakReference:Boolean (default = false ) — Does not used.
|
calculateBoundBox | () | method |
public function calculateBoundBox():void
Calculates object's bounds in its own coordinates
clearExcludedLights | () | method |
public function clearExcludedLights(updateChildren:Boolean = false):void
Resets list of lights excluded from lighting this object.
Parameters
updateChildren:Boolean (default = false )
|
clone | () | method |
public function clone():Object3D
Returns a copy of object.
ReturnsObject3D — A copy of this Object3D .
|
clonePropertiesFrom | () | method |
protected function clonePropertiesFrom(source:Object3D):void
Copies basic properties of Object3D
. This method calls from clone()
method.
Parameters
source:Object3D — Object3D , properties of which will be copied.
|
contains | () | method |
public function contains(child:Object3D):Boolean
Check if given object is child of this Object3D
.
Parameters
child:Object3D — Child Object3D instance.
|
Boolean — true if given instance is this Object3D or one of its children or false otherwise.
|
dispatchEvent | () | method |
public function dispatchEvent(event:Event):Boolean
Dispatches an event
into the event flow. In case of dispatched event extends Event
class, properties target
and currentTarget
will not be set. They will be set if dispatched event extends Event3D
oe subclasses.
Parameters
event:Event — The Event object that is dispatched into the event flow.
|
Boolean — A value of true if the event was successfully dispatched. Otherwise returns false .
|
excludeLight | () | method |
public function excludeLight(light:Light3D, updateChildren:Boolean = false):void
Disables lighting of the object by given light
.
Parameters
light:Light3D — Light which should not affect to the object
| |
updateChildren:Boolean (default = false ) — If true all children of this object will be also shielded from the given light.
|
See also
getChildAt | () | method |
public function getChildAt(index:int):Object3D
Returns the child Object3D
instance that exists at the specified index.
Parameters
index:int — Position of wished child.
|
Object3D — Child object at given position.
|
getChildByName | () | method |
public function getChildByName(name:String):Object3D
Returns child Object3D
instance with given name
.
In case of there are several objects with same name, the first of them will returned.
If there are no objects with given name, null
will returned.
Parameters
name:String — The name of child object.
|
Object3D — Child Object3D with given name.
|
getChildIndex | () | method |
public function getChildIndex(child:Object3D):int
Returns index of given child Object3D
instance.
Parameters
child:Object3D — Child Object3D instance.
|
int — Index of given child Object3D instance.
|
getResources | () | method |
public function getResources(hierarchy:Boolean = false, resourceType:Class = null):Vector.<Resource>
Gather the resources of this Object3D
. This resources should be uploaded in the Context3D
in order to Object3D
can be rendered.
Parameters
hierarchy:Boolean (default = false ) — If true , the resources of all children will be gathered too.
| |
resourceType:Class (default = null ) — If defined, only resources of this type will be gathered.
|
Vector.<Resource> — Vector consists of gathered resources
|
See also
globalToLocal | () | method |
public function globalToLocal(point:Vector3D):Vector3D
Converts the Vector3D
object from the root Object3D
(global) coordinates to the local Object3D
's own coordinates.
Parameters
point:Vector3D — Point in coordinates of root Object3D .
|
Vector3D — Point in local coordinates of Object3D .
|
hasEventListener | () | method |
public function hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
Parameters
type:String — The type of event.
|
Boolean — A value of true if a listener of the specified type is registered; false otherwise.
|
intersectRay | () | method |
public function intersectRay(origin:Vector3D, direction:Vector3D):RayIntersectionData
Searches for the intersection of an Object3D
and given ray, defined by origin
and direction
.
Parameters
origin:Vector3D — Origin of the ray.
| |
direction:Vector3D — Direction of the ray.
|
RayIntersectionData — The result of searching given as RayIntersectionData . null will returned in case of intersection was not found.
|
See also
localToGlobal | () | method |
public function localToGlobal(point:Vector3D):Vector3D
Converts the Vector3D
object from the Object3D
's own (local) coordinates to the root Object3D
(global) coordinates.
Parameters
point:Vector3D — Point in local coordinates of Object3D .
|
Vector3D — Point in coordinates of root Object3D .
|
removeChild | () | method |
public function removeChild(child:Object3D):Object3D
Removes the specified child Object3D
instance from the child list of the
this Object3D
instance. The parent
property of the removed child is set to null
.
Parameters
child:Object3D — The Object3D instance to remove.
|
Object3D — The Object3D instance that you pass in the child parameter.
|
removeChildAt | () | method |
public function removeChildAt(index:int):Object3D
Removes a child Object3D
from the specified index position in the child list of
the Object3D
. The parent property of the removed child is set to null
.
Parameters
index:int — The child index of the Object3D to remove.
|
Object3D — The Object3D instance that was removed.
|
removeChildren | () | method |
public function removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
Removes child objects in given range of indexes.
Parameters
beginIndex:int (default = 0 ) — Index, starts from which objects should be removed.
| |
endIndex:int (default = 2147483647 ) — Index, till which objects should be removed.
|
removeEventListener | () | method |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
Parameters
type:String — The type of event.
| |
listener:Function — The listener object to remove.
| |
useCapture:Boolean (default = false ) — Specifies whether the listener was registered for the capture phase or the target and bubbling phases.
|
setChildIndex | () | method |
public function setChildIndex(child:Object3D, index:int):void
Sets index for child Object3D
instance.
Parameters
child:Object3D — Child Object3D instance.
| |
index:int — Index should be set.
|
swapChildren | () | method |
public function swapChildren(child1:Object3D, child2:Object3D):void
Swaps index positions of two specified child objects.
Parameters
child1:Object3D — The first object to swap.
| |
child2:Object3D — The second object to swap.
|
swapChildrenAt | () | method |
public function swapChildrenAt(index1:int, index2:int):void
Swaps index positions of two child objects by its index.
Parameters
index1:int — Index of the first object to swap.
| |
index2:int — Index of the second object to swap.
|
toString | () | method |
public function toString():String
Returns the string representation of the specified object.
ReturnsString — The string representation of the specified object.
|
willTrigger | () | method |
public function 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.
Parameters
type:String — The type of event.
|
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
|
added | Event |
alternativa.engine3d.core.events.Event3D
alternativa.engine3d.core.events.Event3D.ADDED
Dispatches when an Object3D
is added as a child to another Object3D
.
Following methods generate this event: Object3D.addChild()
, Object3D.addChildAt()
.
type
property of a added
event object.
See also
click | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.CLICK
Dispatched when a user presses and releases the main button
of the user's pointing device over the same Object3D
.
Any other evens can occur between pressing and releasing the button.
doubleClick | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.DOUBLE_CLICK
Dispatched when a user presses and releases the main button of
a pointing device twice in rapid succession over the same Object3D
.
middleClick | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MIDDLE_CLICK
Dispatched when a user presses and releases the middle button
of the user's pointing device over the same Object3D
.
Any other evens can occur between pressing and releasing the button.
middleMouseDown | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MIDDLE_MOUSE_DOWN
Dispatched when a user presses the middle pointing device button over an Object3D
instance.
Any other evens can occur between pressing and releasing the button.
middleMouseUp | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MIDDLE_MOUSE_UP
Dispatched when a user releases the pointing device button over an Object3D
instance.
mouseDown | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_DOWN
Dispatched when a user presses the pointing device button over an Object3D
instance.
mouseMove | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_MOVE
Dispatched when a user moves the pointing device while it is over an Object3D
.
mouseOut | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_OUT
Dispatched when the user moves a pointing device away from an Object3D
instance.
mouseOver | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_OVER
Dispatched when the user moves a pointing device over an Object3D
instance.
mouseUp | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_UP
Dispatched when a user releases the pointing device button over an Object3D
instance.
mouseWheel | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_WHEEL
Dispatched when a mouse wheel is spun over an Object3D
instance.
removed | Event |
alternativa.engine3d.core.events.Event3D
alternativa.engine3d.core.events.Event3D.REMOVED
Dispatched when a Object3D
is about to be removed from the children list.
Following methods generate this event: Object3D.removeChild()
and Object3D.removeChildAt()
.
type
property of a removed
event object.
See also
rightClick | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.CLICK
Dispatched when a user presses and releases the right button
of the user's pointing device over the same Object3D
.
Any other evens can occur between pressing and releasing the button.
rightMouseDown | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.CLICK
Dispatched when a user presses the right pointing device button over an Object3D
instance.
Any other evens can occur between pressing and releasing the button.
rightMouseUp | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.MOUSE_UP
Dispatched when a user releases the pointing device button over an Object3D
instance.
rollOut | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.ROLL_OUT
Dispatched when the user moves a pointing device away from an Object3D
instance.
rollOver | Event |
alternativa.engine3d.core.events.MouseEvent3D
alternativa.engine3d.events.MouseEvent3D.ROLL_OVER
Dispatched when the user moves a pointing device over an Object3D
instance.