Packagealternativa.engine3d.primitives
Classpublic class Cone
InheritanceCone Inheritance Mesh Inheritance Object3D

Truncated cone or cylinder.



Public Properties
 PropertyDefined by
 Inheritedchildren : Set
A set of child objects.
Object3D
 Inheritedcoords : Point3D
Object coordinates.
Object3D
 Inheritedfaces : Map
A set of an object faces.
Mesh
 Inheritedmobility : int
Mobility level.
Object3D
 InheritedmouseEnabled : Boolean = true
Specifies whether this object receives mouse messages.
Object3D
 Inheritedname : String
Object name.
Object3D
 Inheritedparent : Object3D
Parent object.
Object3D
 InheritedrotationX : Number
X-axis rotation angle in radians.
Object3D
 InheritedrotationY : Number
Y-axis rotation angle in radians.
Object3D
 InheritedrotationZ : Number
Z-axis rotation angle in radians.
Object3D
 InheritedscaleX : Number
X-axis scale coefficient.
Object3D
 InheritedscaleY : Number
Y-axis scale coefficient.
Object3D
 InheritedscaleZ : Number
Z-axis scale coefficient.
Object3D
 Inheritedscene : Scene3D
Scene containing given object.
Object3D
 Inheritedsurfaces : Map
A set of object's surfaces.
Mesh
 Inheritedtransformation : Matrix3D
Full (global) transformation matrix of an object.
Object3D
 Inheritedvertices : Map
A set of object's vertices.
Mesh
 Inheritedx : Number
X coordinate.
Object3D
 Inheritedy : Number
Y coordinate.
Object3D
 Inheritedz : Number
Z coordinate.
Object3D
Public Methods
 MethodDefined 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
 Inherited
Adds a child object.
Object3D
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
Object3D
 Inherited
Clones object.
Object3D
 Inherited
Setting a material for all surfaces of the object.
Mesh
 Inherited
createFace(vertices:Array, id:Object = null):Face
Add new face.
Mesh
 Inherited
createSurface(faces:Array = null, id:Object = null):Surface
Add new surface.
Mesh
 Inherited
createVertex(x:Number = 0, y:Number = 0, z:Number = 0, id:Object = null):Vertex
Add new vertex.
Mesh
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event.
Object3D
 Inherited
forEach(func:Function):void
Calls the specified function for the object an all its children, passing the current object as an argument.
Object3D
 Inherited
getChildByName(name:String, deep:Boolean = false):Object3D
Gets a child object with the given name.
Object3D
 Inherited
getFaceById(id:Object):Face
Get face by it's identifier
Mesh
 Inherited
getFaceId(face:Face):Object
Get face identifier.
Mesh
 Inherited
getSurfaceById(id:Object):Surface
Get surface by it's identifier
Mesh
 Inherited
getSurfaceId(surface:Surface):Object
Get surface identifier.
Mesh
 Inherited
getVertexById(id:Object):Vertex
Get vertex by it's identifier
Mesh
 Inherited
getVertexId(vertex:Vertex):Object
Get vertex identifier
Mesh
 Inherited
globalToLocal(point:Point3D, result:Point3D = null):Point3D
Transforms a point form global coordinate system to an object's coordinate system
Object3D
 Inherited
hasEventListener(type:String):Boolean
Checks if there are registered event listeners for events of the specified type.
Object3D
 Inherited
hasFace(face:Object):Boolean
Check if face is present in object.
Mesh
 Inherited
hasSurface(surface:Object):Boolean
Check if surface is present in object.
Mesh
 Inherited
hasVertex(vertex:Object):Boolean
Check if vertex is present in object.
Mesh
 Inherited
localToGlobal(point:Point3D, result:Point3D = null):Point3D
Transforms a point from local coordinate system of an object to global coordinate system.
Object3D
 Inherited
moveAllFacesToSurface(surface:Object = null, removeSurfaces:Boolean = false):Surface
Adds all object faces to a given surface.
Mesh
 Inherited
Delete child object.
Object3D
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
Object3D
 Inherited
removeFace(face:Object):Face
Delete face.
Mesh
 Inherited
removeSurface(surface:Object):Surface
Delete surface.
Mesh
 Inherited
removeVertex(vertex:Object):Vertex
Delete vertex.
Mesh
 Inherited
setMaterialToSurface(material:SurfaceMaterial, surface:Object):void
Set material to a given surface.
Mesh
 Inherited
setUVsToFace(aUV:Point, bUV:Point, cUV:Point, face:Object):void
Set UV-coordinates to a given face.
Mesh
 Inherited
toString():String
Get string representation of object.
Mesh
 Inherited
willTrigger(type:String):Boolean
Object3D
Protected Methods
 MethodDefined by
 Inherited
addToScene(scene:Scene3D):void
Method is being called when adding object to scene.
Object3D
 Inherited
Copy source object properties.
Mesh
  
Create empty object without inner structure.
Cone
  
defaultName():String
Default object name.
Cone
 Inherited
Method is being called whed deleting object from a scene.
Object3D
Events
 EventSummaryDefined by
 Inherited Dispatched when a user presses and releases left mouse button over the same object.Object3D
 Inherited Dispatched when a user presses left mouse button over an object.Object3D
 Inherited Dispatched when a user moves mouse pointer while it is over an object.Object3D
 Inherited Dispatched when a user moves mouse pointer away from an object.Object3D
 Inherited Dispatched when a user moves mouse pointer over an object.Object3D
 Inherited Dispatched when a user releases left mouse button over an object.Object3D
 Inherited Dispatched when a user spins mouse wheel over an object.Object3D
Constructor detail
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.
Method detail
createEmptyObject()method
protected override function createEmptyObject():Object3D

Create 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.

Returns
Object3Da new empty object
defaultName()method 
protected override function defaultName():String

Default object name.

Returns
Stringdefault object name