Package | alternativa.engine3d.objects |
Class | public class Skin |
Inheritance | Skin ![]() ![]() ![]() |
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
Method | Defined By | ||
---|---|---|---|
Skin(maxInfluences:int)
Creates a new Skin instance. | Skin | ||
![]() |
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 | |
[override]
Adds Surface to Mesh object. | Skin | ||
calculateBindingMatrices():void | Skin | ||
![]() | 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 | |
[override]
Returns a copy of object. | Skin | ||
![]() |
Check if given object is child of this Object3D. | Object3D | |
![]() | dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | Object3D | |
divide(limit:uint, iterations:uint = 1):void
Subdivides skin surfaces. | Skin | ||
![]() | 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 | |
![]() | getSurface(index:int):Surface
Returns surface by index. | Mesh | |
![]() | 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 [override]
Searches for the intersection of an Object3D and given ray, defined by origin and direction. | Mesh | |
![]() | 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 | |
![]() | setMaterialToAllSurfaces(material:Material):void
Assign given material to all surfaces. | Mesh | |
![]() |
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 [override]
Copies basic properties of Object3D. | Skin |
Skin | () | Constructor |
public function Skin(maxInfluences:int)
Creates a new Skin instance.
ParametersmaxInfluences:int — Max number of bones that can affect one vertex.
|
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.
|
Surface |
calculateBindingMatrices | () | method |
public function calculateBindingMatrices():void
clone | () | method |
override public function clone():Object3D
Returns a copy of object.
ReturnsObject3D — 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:Object3D — Object3D , 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.
|