| Package | alternativa.engine3d.core |
| Class | public class Mesh |
| Inheritance | Mesh Object3D |
| Subclasses | Box, Cone, GeoPlane, GeoSphere, Plane, Sphere |
| Property | Defined by | ||
|---|---|---|---|
![]() | children : Set
A set of child objects.
| Object3D | |
![]() | coords : Point3D
Object coordinates.
| Object3D | |
| faces : Map
[read-only] A set of an object faces.
| Mesh | ||
![]() | mobility : int Mobility level.
| Object3D | |
![]() | mouseEnabled : Boolean = true Specifies whether this object receives mouse messages.
| Object3D | |
![]() | name : String Object name.
| Object3D | |
![]() | parent : Object3D
Parent object.
| Object3D | |
![]() | rotationX : Number X-axis rotation angle in radians.
| Object3D | |
![]() | rotationY : Number Y-axis rotation angle in radians.
| Object3D | |
![]() | rotationZ : Number Z-axis rotation angle in radians.
| Object3D | |
![]() | scaleX : Number X-axis scale coefficient.
| Object3D | |
![]() | scaleY : Number Y-axis scale coefficient.
| Object3D | |
![]() | scaleZ : Number Z-axis scale coefficient.
| Object3D | |
![]() | scene : Scene3D
Scene containing given object.
| Object3D | |
| surfaces : Map
[read-only] A set of object's surfaces.
| Mesh | ||
![]() | transformation : Matrix3D
Full (global) transformation matrix of an object.
| Object3D | |
| vertices : Map
[read-only] A set of object's vertices.
| Mesh | ||
![]() | x : Number X coordinate.
| Object3D | |
![]() | y : Number Y coordinate.
| Object3D | |
![]() | z : Number Z coordinate.
| Object3D | |
| Method | Defined by | ||
|---|---|---|---|
|
Mesh(name:String = null)
Create an instance of class.
| Mesh | ||
![]() |
Adds a child object.
| Object3D | |
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| Object3D | |
![]() |
Clones object.
| Object3D | |
|
cloneMaterialToAllSurfaces(material:SurfaceMaterial):void
Setting a material for all surfaces of the object.
| Mesh | ||
|
createFace(vertices:Array, id:Object = null):Face
Add new face.
| Mesh | ||
|
createSurface(faces:Array = null, id:Object = null):Surface
Add new surface.
| Mesh | ||
|
createVertex(x:Number = 0, y:Number = 0, z:Number = 0, id:Object = null):Vertex
Add new vertex.
| Mesh | ||
![]() |
dispatchEvent(event:Event):Boolean
Dispatches an event.
| Object3D | |
![]() |
forEach(func:Function):void
Calls the specified function for the object an all its children, passing the current object as an argument.
| Object3D | |
![]() |
getChildByName(name:String, deep:Boolean = false):Object3D
Gets a child object with the given name.
| Object3D | |
|
getFaceById(id:Object):Face
Get face by it's identifier
| Mesh | ||
|
Get face identifier.
| Mesh | ||
|
getSurfaceById(id:Object):Surface
Get surface by it's identifier
| Mesh | ||
|
getSurfaceId(surface:Surface):Object
Get surface identifier.
| Mesh | ||
|
getVertexById(id:Object):Vertex
Get vertex by it's identifier
| Mesh | ||
|
getVertexId(vertex:Vertex):Object
Get vertex identifier
| Mesh | ||
![]() |
Transforms a point form global coordinate system to an object's coordinate system
| Object3D | |
![]() |
hasEventListener(type:String):Boolean
Checks if there are registered event listeners for events of the specified type.
| Object3D | |
|
hasFace(face:Object):Boolean
Check if face is present in object.
| Mesh | ||
|
hasSurface(surface:Object):Boolean
Check if surface is present in object.
| Mesh | ||
|
hasVertex(vertex:Object):Boolean
Check if vertex is present in object.
| Mesh | ||
![]() |
Transforms a point from local coordinate system of an object to global coordinate system.
| Object3D | |
|
moveAllFacesToSurface(surface:Object = null, removeSurfaces:Boolean = false):Surface
Adds all object faces to a given surface.
| Mesh | ||
![]() |
Delete child object.
| Object3D | |
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
| Object3D | |
|
removeFace(face:Object):Face
Delete face.
| Mesh | ||
|
removeSurface(surface:Object):Surface
Delete surface.
| Mesh | ||
|
removeVertex(vertex:Object):Vertex
Delete vertex.
| Mesh | ||
|
setMaterialToSurface(material:SurfaceMaterial, surface:Object):void
Set material to a given surface.
| Mesh | ||
|
setUVsToFace(aUV:Point, bUV:Point, cUV:Point, face:Object):void
Set UV-coordinates to a given face.
| Mesh | ||
|
toString():String
Get string representation of object.
| Mesh | ||
![]() |
willTrigger(type:String):Boolean
| Object3D | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
addToScene(scene:Scene3D):void
Method is being called when adding object to scene.
| Object3D | |
|
clonePropertiesFrom(source:Object3D):void
Copy source object properties.
| Mesh | ||
|
Create empty object without inner structure.
| Mesh | ||
|
defaultName():String
Default object name.
| Mesh | ||
![]() |
removeFromScene(scene:Scene3D):void
Method is being called whed deleting object from a scene.
| Object3D | |
| faces | property |
faces:Map [read-only]A set of an object faces. Map keys are faces' identifiers.
Implementation public function get faces():Map
| surfaces | property |
surfaces:Map [read-only]A set of object's surfaces. Map keys are surfaces' identifiers.
Implementation public function get surfaces():Map
| vertices | property |
vertices:Map [read-only]A set of object's vertices. Map keys are surfaces' identifiers.
Implementation public function get vertices():Map
| Mesh | () | constructor |
public function Mesh(name:String = null)Create an instance of class.
Parametersname:String (default = null) — instance name |
| cloneMaterialToAllSurfaces | () | method |
public function cloneMaterialToAllSurfaces(material:SurfaceMaterial):voidSetting a material for all surfaces of the object. For each surface a copy of the material is being set. If null value is passed then materials of all surfaces are cleared.
material:SurfaceMaterial — meterial that is being set |
| clonePropertiesFrom | () | method |
protected override function clonePropertiesFrom(source:Object3D):voidCopy source object properties. This method is being used in clone() method and must be redefined in it's descendants to get a right object. Every descendant must copy only properties that were added to base class in this exact method. Inherited properties copying is made by calling super.clonePropertiesFrom(source).
Parameterssource:Object3D — object, which properties are being copied |
| createEmptyObject | () | method |
protected override function createEmptyObject():Object3DCreate empty object without inner structure. For example, if geometrical primitive, when added, forms a bunch of vertices, faces and surfaces, this method don't create them. This method is being used in clone() and has to be redefined in descendants in order to get the right object.
ReturnsObject3D — a new empty object |
| createFace | () | method |
public function createFace(vertices:Array, id:Object = null):FaceAdd new face.
Parametersvertices:Array — A set of face's vertices, in counterclockwise order. Every array element is the alternativa.engine3d.core.Vertex class instance, or face's vertice identifier. In both cases an object must contain given vertice. |
|
id:Object (default = null) — face identifier. If null value is given, the identifier will be created automatically. |
Face — added face instance |
FaceNeedMoreVerticesError — invalid vertex identifier value |
|
FaceExistsError — invalid vertex identifier value |
|
InvalidIDError — invalid vertex identifier value |
|
VertexNotFoundError — invalid vertex identifier value |
See also
| createSurface | () | method |
public function createSurface(faces:Array = null, id:Object = null):SurfaceAdd new surface.
Parametersfaces:Array (default = null) — a set of faces containing the surface. Avery array element is alternativa.engine3d.core.Face class instance or face identifier. In both cases an object must contain given face. If null is given, an empty surface will be created. If any face is placed in other surface, it will be moved to a new one. |
|
id:Object (default = null) — new surface identifier. If null is given, the identifier will be created automatically. |
Surface — added surface instance |
SurfaceExistsError — an attempt to refer to a face with reserved value |
|
InvalidIDError — an attempt to refer to a face with reserved value |
See also
| createVertex | () | method |
public function createVertex(x:Number = 0, y:Number = 0, z:Number = 0, id:Object = null):VertexAdd new vertex.
Parametersx:Number (default = 0) — X coordinate in local coordinates system |
|
y:Number (default = 0) — Y coordinate in local coordinates system |
|
z:Number (default = 0) — Z coordinate in local coordinates system |
|
id:Object (default = null) — vertex identifier. If null is given, the identifier will be created automatically. |
Vertex — added vertex instance |
VertexExistsError — an attempt to refer to a face with reserved value |
|
InvalidIDError — an attempt to refer to a face with reserved value |
| defaultName | () | method |
protected override function defaultName():StringDefault object name.
ReturnsString — default object name |
| getFaceById | () | method |
public function getFaceById(id:Object):FaceGet face by it's identifier
Parametersid:Object — face identifier |
Face — a face with given ID |
FaceNotFoundError — invalid face identifier value |
|
InvalidIDError — invalid face identifier value |
| getFaceId | () | method |
public function getFaceId(face:Face):ObjectGet face identifier.
Parametersface:Face — face instance |
Object — the identifier of given face |
FaceNotFoundError — object does not contain given face |
| getSurfaceById | () | method |
public function getSurfaceById(id:Object):SurfaceGet surface by it's identifier
Parametersid:Object — surface identifier |
Surface — a surface instance with given ID |
SurfaceNotFoundError — invalid surface identifier value |
|
InvalidIDError — invalid surface identifier value |
| getSurfaceId | () | method |
public function getSurfaceId(surface:Surface):ObjectGet surface identifier.
Parameterssurface:Surface — surface instance |
Object — surface identifier |
SurfaceNotFoundError — object does not contain given surface |
| getVertexById | () | method |
public function getVertexById(id:Object):VertexGet vertex by it's identifier
Parametersid:Object — vertex identifier |
Vertex — a vertex instance with given ID |
VertexNotFoundError — invalid vertex identifier value |
|
InvalidIDError — invalid vertex identifier value |
| getVertexId | () | method |
public function getVertexId(vertex:Vertex):ObjectGet vertex identifier
Parametersvertex:Vertex — vertices |
Object — vertex identifier |
VertexNotFoundError — object does not contain given vertex |
| hasFace | () | method |
public function hasFace(face:Object):BooleanCheck if face is present in object.
Parametersface:Object — Face class instance or face identifier |
Boolean — true, if the object contains given face, otherwise false |
FaceNotFoundError — invalid face identifier value |
|
InvalidIDError — invalid face identifier value |
| hasSurface | () | method |
public function hasSurface(surface:Object):BooleanCheck if surface is present in object.
Parameterssurface:Object — Surface class instance or face identifier |
Boolean — true, if the object contains given surface, otherwise |
SurfaceNotFoundError — invalid surface identifier value |
|
InvalidIDError — invalid surface identifier value |
| hasVertex | () | method |
public function hasVertex(vertex:Object):BooleanCheck if vertex is present in object.
Parametersvertex:Object — alternativa.engine3d.core.Vertex class instance or vertex identifier |
Boolean — true if the object contains given vertex, otherwise false |
VertexNotFoundError — invalid vertex identifier value |
|
InvalidIDError — invalid vertex identifier value |
See also
| moveAllFacesToSurface | () | method |
public function moveAllFacesToSurface(surface:Object = null, removeSurfaces:Boolean = false):SurfaceAdds all object faces to a given surface.
Parameterssurface:Object (default = null) — alternativa.engine3d.core.Surface class instance or surface indentifier, in which faces are being added. If identifier is set, and there is no such surface, a new surface will be created. |
|
removeSurfaces:Boolean (default = false) — to remove or not to remove empty surfaces after faces removing |
Surface — a surface to which faces were moved |
SurfaceNotFoundError — an attempt to refer to a face with reserved value |
|
InvalidIDError — an attempt to refer to a face with reserved value |
| removeFace | () | method |
public function removeFace(face:Object):FaceDelete face.
Parametersface:Object — alternativa.engine3d.core.Face class instance or face identifier |
Face — the instance of the removed face |
FaceNotFoundError — invalid face identifier value |
|
InvalidIDError — invalid face identifier value |
| removeSurface | () | method |
public function removeSurface(surface:Object):SurfaceDelete surface.
Parameterssurface:Object — alternativa.engine3d.core.Face class instance or face identifier |
Surface — the instance of the removed surface |
SurfaceNotFoundError — invalid surface identifier value |
|
InvalidIDError — invalid surface identifier value |
| removeVertex | () | method |
public function removeVertex(vertex:Object):VertexDelete vertex. Faces containing this vertex will be deleted too.
Parametersvertex:Object — alternativa.engine3d.core.Vertex class instance or vertex identifier |
Vertex — the instance of the removed vertex |
VertexNotFoundError — invalid vertex identifier |
|
InvalidIDError — invalid vertex identifier |
| setMaterialToSurface | () | method |
public function setMaterialToSurface(material:SurfaceMaterial, surface:Object):voidSet material to a given surface.
Parametersmaterial:SurfaceMaterial — meterial that is being set to a surface. One SurfaceMaterial may be assigned to only one surface. |
|
surface:Object — alternativa.engine3d.core.Surface class instance or surface identifier |
SurfaceNotFoundError — invalid surface identifier value |
|
InvalidIDError — invalid surface identifier value |
See also
| setUVsToFace | () | method |
public function setUVsToFace(aUV:Point, bUV:Point, cUV:Point, face:Object):voidSet UV-coordinates to a given face. Transformation matrix is being calculated using first three vertices of the face.
ParametersaUV:Point — UV-coordinates of first vertex |
|
bUV:Point — UV-coordinates of second vertex |
|
cUV:Point — UV-coordinates of third vertex |
|
face:Object — alternativa.engine3d.core.Face class instance or face identifier |
FaceNotFoundError — invalid face identifier value |
|
InvalidIDError — invalid face identifier value |
See also
| toString | () | method |
public override function toString():StringGet string representation of object.
ReturnsString — a string representation of the object |