Packagealternativa.engine3d.objects
Classpublic class Skin
InheritanceSkin Inheritance Mesh Inheritance Object3D Inheritance Object

Skin is a Mesh which can have a skeleton besides surfaces. The skeleton is a hierarchy of bones, represented by Joint class. Each bone can be linked with set of vertices, thus, position of the bone will affect to position of linked vertices. Set of positions of all skeleton bones defines a pose which also defines pose of skin's surfaces. Character animation implements through making sequence of such poses. If number of bones which affect one surface more than fixed number, skin would not be drawn. "Fixed number" defines by the material of given surface, look documentation of the material class for it. To avoid this problem use Skin.divide() method. If you creates a skeleton within a code, make sure that each bone added to: 1) skin hierarchy with addChild() method, 2) renderedJoints property which represented by Vector.<Joint>. Link of a vertex and a bone stores in vertex data of VertexAttributes.JOINTS type. Vertex buffer point to a joint with following form: index of the joint within renderedJoints multiplied with 3. It is done so in order to avoid this multiplication within vertex shader for each frame.

See also

alternativa.engine3d.core.VertexAttributes.JOINTS
alternativa.engine3d.objects.Joint
divide()


Public Properties
 PropertyDefined By
 InheritedboundBox : BoundBox
Bounds of the object described as rectangular parallelepiped.
Object3D
 InheritedconcatenatedMatrix : 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
 InheriteddoubleClickEnabled : Boolean = false
Specifies whether the object receives doubleClick events.
Object3D
 InheritedexcludedLights : Vector.<Light3D>
[read-only] Returns excluded lights list of current object.
Object3D
 Inheritedgeometry : Geometry
Through geometry property you can get access to vertices.
Mesh
 Inheritedmatrix : Matrix3D
The matrix property represents a transformation matrix that determines the position and orientation of an Object3D.
Object3D
 InheritedmouseChildren : Boolean = true
Determines whether or not the children of the object are mouse, or user input device, enabled.
Object3D
 InheritedmouseEnabled : Boolean = true
Specifies whether this object receives mouse, or other user input, messages.
Object3D
 Inheritedname : String
Name of the object.
Object3D
 InheritednumChildren : int
[read-only] Returns the number of children of this object.
Object3D
 InheritednumSurfaces : int
[read-only] Number of surfaces.
Mesh
 Inheritedparent : Object3D
[read-only] Object3D, to which this object was added as a child.
Object3D
 InheritedrotationX : Number
The angle of rotation of Object3D around the X-axis expressed in radians.
Object3D
 InheritedrotationY : Number
The angle of rotation of Object3D around the Y-axis expressed in radians.
Object3D
 InheritedrotationZ : Number
The angle of rotation of Object3D around the Z-axis expressed in radians.
Object3D
 InheritedscaleX : Number
The scale of the Object3D along the X-axis.
Object3D
 InheritedscaleY : Number
The scale of the Object3D along the Y-axis.
Object3D
 InheritedscaleZ : Number
The scale of the Object3D along the Z-axis.
Object3D
 InheriteduseHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the pointer rolls over a Object3D.
Object3D
 InheriteduserData : Object
Custom data available to store within Object3D by user.
Object3D
 Inheritedvisible : Boolean = true
Whether or not the display object is visible.
Object3D
 Inheritedx : Number
X coordinate.
Object3D
 Inheritedy : Number
Y coordinate.
Object3D
 Inheritedz : Number
Z coordinate.
Object3D
Public Methods
 MethodDefined By
  
Skin(maxInfluences:int)
Creates a new Skin instance.
Skin
 Inherited
Adds given Object3D instance as a child to the end of this Object3D's children list.
Object3D
 Inherited
addChildAt(child:Object3D, index:int):Object3D
Adds a child Object3D instance to this Object3D instance.
Object3D
 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
  
addSurface(material:Material, indexBegin:uint, numTriangles:uint):Surface
[override] Adds Surface to Mesh object.
Skin
  
Skin
 Inherited
Calculates object's bounds in its own coordinates
Object3D
 Inherited
clearExcludedLights(updateChildren:Boolean = false):void
Resets list of lights excluded from lighting this object.
Object3D
  
[override] Returns a copy of object.
Skin
 Inherited
contains(child:Object3D):Boolean
Check if given object is child of this Object3D.
Object3D
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
Object3D
  
divide(limit:uint, iterations:uint = 1):void
Subdivides skin surfaces.
Skin
 Inherited
excludeLight(light:Light3D, updateChildren:Boolean = false):void
Disables lighting of the object by given light.
Object3D
 Inherited
getChildAt(index:int):Object3D
Returns the child Object3D instance that exists at the specified index.
Object3D
 Inherited
Returns child Object3D instance with given name.
Object3D
 Inherited
Returns index of given child Object3D instance.
Object3D
 Inherited
getResources(hierarchy:Boolean = false, resourceType:Class = null):Vector.<Resource>
Gather the resources of this Object3D.
Object3D
 Inherited
getSurface(index:int):Surface
Returns surface by index.
Mesh
 Inherited
globalToLocal(point:Vector3D):Vector3D
Converts the Vector3D object from the root Object3D (global) coordinates to the local Object3D's own coordinates.
Object3D
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
Object3D
 Inherited
intersectRay(origin:Vector3D, direction:Vector3D):RayIntersectionData
[override] Searches for the intersection of an Object3D and given ray, defined by origin and direction.
Mesh
 Inherited
localToGlobal(point:Vector3D):Vector3D
Converts the Vector3D object from the Object3D's own (local) coordinates to the root Object3D (global) coordinates.
Object3D
 Inherited
Removes the specified child Object3D instance from the child list of the this Object3D instance.
Object3D
 Inherited
Removes a child Object3D from the specified index position in the child list of the Object3D.
Object3D
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
Removes child objects in given range of indexes.
Object3D
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
Object3D
 Inherited
setChildIndex(child:Object3D, index:int):void
Sets index for child Object3D instance.
Object3D
 Inherited
Assign given material to all surfaces.
Mesh
 Inherited
swapChildren(child1:Object3D, child2:Object3D):void
Swaps index positions of two specified child objects.
Object3D
 Inherited
swapChildrenAt(index1:int, index2:int):void
Swaps index positions of two child objects by its index.
Object3D
 Inherited
toString():String
Returns the string representation 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
  
[override] Copies basic properties of Object3D.
Skin
Events
 Event Summary Defined By
 InheritedDispatches when an Object3D is added as a child to another Object3D.Object3D
 InheritedDispatched when a user presses and releases the main button of the user's pointing device over the same Object3D.Object3D
 InheritedDispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same Object3D.Object3D
 InheritedDispatched when a user presses and releases the middle button of the user's pointing device over the same Object3D.Object3D
 InheritedDispatched when a user presses the middle pointing device button over an Object3D instance.Object3D
 InheritedDispatched when a user releases the pointing device button over an Object3D instance.Object3D
 InheritedDispatched when a user presses the pointing device button over an Object3D instance.Object3D
 InheritedDispatched when a user moves the pointing device while it is over an Object3D.Object3D
 InheritedDispatched when the user moves a pointing device away from an Object3D instance.Object3D
 InheritedDispatched when the user moves a pointing device over an Object3D instance.Object3D
 InheritedDispatched when a user releases the pointing device button over an Object3D instance.Object3D
 InheritedDispatched when a mouse wheel is spun over an Object3D instance.Object3D
 InheritedDispatched when a Object3D is about to be removed from the children list.Object3D
 InheritedDispatched when a user presses and releases the right button of the user's pointing device over the same Object3D.Object3D
 InheritedDispatched when a user presses the right pointing device button over an Object3D instance.Object3D
 InheritedDispatched when a user releases the pointing device button over an Object3D instance.Object3D
 InheritedDispatched when the user moves a pointing device away from an Object3D instance.Object3D
 InheritedDispatched when the user moves a pointing device over an Object3D instance.Object3D
Constructor Detail
Skin()Constructor
public function Skin(maxInfluences:int)

Creates a new Skin instance.

Parameters
maxInfluences:int — Max number of bones that can affect one vertex.
Method Detail
addSurface()method
override public function addSurface(material:Material, indexBegin:uint, numTriangles:uint):Surface

Adds Surface to Mesh object.

Parameters

material:Material — Material of the surface.
 
indexBegin:uint — Position of the firs index of surface in the geometry.
 
numTriangles:uint — Number of triangles.

Returns
Surface
calculateBindingMatrices()method 
public function calculateBindingMatrices():void

clone()method 
override public function clone():Object3D

Returns a copy of object.

Returns
Object3D — A copy of this Object3D.
clonePropertiesFrom()method 
override protected function clonePropertiesFrom(source:Object3D):void

Copies basic properties of Object3D. This method calls from clone() method.

Parameters

source:Object3DObject3D, properties of which will be copied.

collectDepthDraws()method 
override alternativa3d function collectDepthDraws(camera:Camera3D, depthRenderer:Renderer, depthMaterial:Material):void

Parameters

camera:Camera3D
 
depthRenderer:Renderer
 
depthMaterial:Material

divide()method 
public function divide(limit:uint, iterations:uint = 1):void

Subdivides skin surfaces. It can be useful in case of impossibility to render a skin due to too big number of bones affected to one surface. (In this case appropriate exception will generated).

Parameters

limit:uint — No more than limit of bones can have its own surface. I.e. if skin instance has 6 joints and limit = 3, it will divided into 2 surface and if limit = 6 - into 6 surfaces.
 
iterations:uint (default = 1) — Number of iterations. Increase accuracy and execution time.