| Package | alternativa.engine3d.primitives |
| Class | public class Cone |
| Inheritance | Cone Mesh Object3D |
| Method | Defined by | ||
|---|---|---|---|
|
Cone(height:Number = 100, bottomRadius:Number = 100, topRadius:Number = 0, heightSegments:uint = 1, radialSegments:uint = 12, reverse:Boolean = false, triangulate:Boolean = false)
Creates truncated cone or cylinder.
| Cone | ||
![]() |
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.
| Cone | ||
|
defaultName():String
Default object name.
| Cone | ||
![]() |
removeFromScene(scene:Scene3D):void
Method is being called whed deleting object from a scene.
| Object3D | |
| Cone | () | constructor |
public function Cone(height:Number = 100, bottomRadius:Number = 100, topRadius:Number = 0, heightSegments:uint = 1, radialSegments:uint = 12, reverse:Boolean = false, triangulate:Boolean = false)Creates truncated cone or cylinder.
Different values let to create different primitives. Setting topRadius = 0 will give you cone. If bottomRadius = topRadius, there will be a cylinder.
As a default, triangulate is set to false, and primitive will not be able to have texture set on. You can apply the texture by setting this parameter to true. After creation the primitive always has two surfaces - "bottom" and "side". Truncated cone and cylinder have one more surface - "top". Every surface may contain it's own material.Parameters
height:Number (default = 100) — primitive's height. Size along Z axis. Can't be negative. |
|
bottomRadius:Number (default = 100) — primitive bottom radius |
|
topRadius:Number (default = 0) — primitive top radius |
|
heightSegments:uint (default = 1) — quantity of height segments |
|
radialSegments:uint (default = 12) — quantity of radial segments |
|
reverse:Boolean (default = false) — sets normals vectors. If true is given, normals will be set inside the primitive. |
|
triangulate:Boolean (default = false) — triangulation flag. If true, all rectangular faces will be triangulated in order to have an ability to set texture to it. |
| 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 |
| defaultName | () | method |
protected override function defaultName():StringDefault object name.
ReturnsString — default object name |