Face
public function createNormale(Void):Vectorcreate the normal vector of the Face
This method must be called when a face is created. Quite often a single normal vector is used for many faces , so in this case, use sandy.core.face.IPolygon.setNotmale(Vertex)
A vertex is returned rather than a mb.sandy.core.data.Vector4 because it migth be useful to have it transform coordinates.
Vertex the normal vector
public function enableEvents(b:Boolean):VoidEnable or not the events onPress, onRollOver and onRollOut with this face.
b | Boolean True to enable the events, false otherwise. |
public function isVisible(Void):BooleanSay if the face is visible by the camera or not
This method is called during the object rendering, it is very useful to prevent from displaying unvisible faces.
If the user wants to display unvisible faces, he must use mb.sandy.core.Object3D#drawAllFaces property.
Boolean a boolean set at true if the face is visible, false otherwise.
public function render(mc:MovieClip, pS:Skin, pSb:Skin):VoidDisplay the Face of the Object3D into a MovieClip.
This method is called when we want to display the face. It calls it skin mb.sandy.skin.Skin specific rendering method, depending of the type of the face
mc represent the MovieClip where the Face must be displayed.
mc | The MovieClip |
public function setNormale(n:Vector):VoidSet the normale vector of the face. Useful when the normale for this face is alleady computed
This method is called mainly in primitives, when th object is created. It can saves some CPU calculations when somes faces have the same normale vector
n represent the normale vector, but here as a Vertex, because the Vertex class is used in the engine.
n | the normal Vector |
public function setSkin(s:Skin):VoidSet skin of this face.
This method is called when the object is changing its skin. You can also call directly this method to apply a specific skin to a face, if you have the reference of the face
s represent the skin which is will be applied during the rendering.
s | the Skin |
public function setBackSkin(s:Skin):VoidSet skin to the back of this face.
This method is called when the object is changing its back skin. You can also call directly this method to apply a specific skin to a face, if you have the reference of the face
s represent the skin which is will be applied during the rendering.
s | the Skin |
public function getSkin(Void):Skinreturns skin of this face.
This method is called by Object3D.getSkin
The Skin of the Face
public function updateTextureMatrix(s:Skin):VoidUpdate the texture matrix in case that one of its vertex has been changed
public function getTextureMatrix(Void):MatrixReturns the precomputed matrix for the texture algorithm.
public function getBackSkin(Void):Skinreturns back skin of this face.
This method is called by Object3D.getBackSkin
The Skin of the Face
public function getZAverage(Void):NumberRetusn the average of depth of this face
This method is called when the object is rendering, and it's very useful to do the z-sorting
a Number containing the average
public function getMinDepth(Void):NumberReturns the min depth of its vertex.
Void |
number the minimum depth of it's vertex
public function getMaxDepth(Void):NumberReturns the max depth of its vertex.
Void |
number the maximum depth of it's vertex
public function refresh(mc:MovieClip, pS:Skin, pSb:Skin):VoidForce the face to refresh. Mainly used when skin has changed and the object didn't move. In that case we just need to refresh the movieclip, not to compute it again.
public function swapCulling(Void):VoidThis method change the value of the "normal" clipping side.
Void |