尔冬橙

博客园 首页 新随笔 联系 订阅 管理

package:flare.core

Interfaces

接口名:IComponent

Package flare.core

Interface public interface IComponent

 

Method Detail

added () method

public function added(target:Pivot3D):Boolean

Parameters  target:Pivot3D

Returns Boolean

 

removed () method  

public function removed():Boolean

Returns Boolean

 

接口名:IDrawable

Property Detail

inView property

inView:Boolean  [read-only]

Returns whether the object should be drawn. The property usually uses a Boundings3D-class values and determines whether it is visible or not based on the object radius. Therefore, the returned value is only an approximation.

Implementation

    public function get inView():Boolean

 

layer property  

layer:int

Implementation

    public function get layer():int

    public function set layer(value:int):void

Method Detail

draw () method

public function draw(includeChildren:Boolean = true):void

Parameters  includeChildren:Boolean (default = true)

 

类:Classes

Boundings3D

Package flare.core

Class public class Boundings3D

Inheritance: Boundings3D—>Object

The Boundings3D class has the information about Pivot3D-type object dimensions.

The values established in this class will not affect objects physically; they are just informative.

 

The values returned are represented in the local space of each object. To transform them to a global space use localToGlobal or localToGlobalVector of the Pivot3D objects.

 

Although values can be modified, this is not advisable as these properties are often used by the visibility and collision calculation system, for example. Preferably, create a copy using the clone system and modify that copy.

 

Property Detail

center

property

public var center:Vector3D

Center of the object. The center does not correspond to (0,0,0) of the object, but it is the calculated center of all the vertices.

length

property

 

public var length:Vector3D

Lengths of the bounding box of the object. (Maximum corner minus minimum corner).

max

property

 

public var max:Vector3D

Maximum corner of the bounding box of the object.

min

property

 

public var min:Vector3D

Minimum corner of the bounding box of the object.

radius

property

 

public var radius:Number = 0

Radius of the object count from the center of the object (not from the object).

 

Constructor Detail

Boundings3D

()

Constructor

public function Boundings3D()

Creates a new Boundings3D object.

 

Method Detail

clone () method

public function clone():Boundings3D

Creates a copy of a Boundings3D object.

Returns Boundings3D — Returns a new Boundings3D object. 

reset () method  

public function reset():void

Resets the object properties to its default values.

 

 

类:Camera3D

Package:flare.core

Class public class Camera3D

Inheritance: Camera3D  Pivot3D  flash.events.EventDispatcher

The Camera3D class represents the point of view and orientation of the scene.

There can be as many cameras as required, but the one selected in the scene will do the rendering.

 

Property Detail

aspectRatio property

aspectRatio:Number

Sets or returns the aspect ratio of the camera.

Implementation

    public function get aspectRatio():Number

    public function set aspectRatio(value:Number):void

 

canvasSize property  

canvasSize:Point

Defines the projection area for the camera viewPort. If no canvasSize is defined, the values from scene viewPort are used. This property could be used in case where you need to render to a texture that has different dimensions that the scene viewport.

Implementation

    public function get canvasSize():Point

    public function set canvasSize(value:Point):void

 

clipRectangle property  

public var clipRectangle:Boolean = true

Define whatever the viewPort clip all pixels outside the viewPort.

 

far property  

far:Number

Sets or returns the furthest clip plane from the camera. The higher the value, the further the camera will view. This value corresponds to the distance between the camera and the plane. Everything beyond that distance is not to be rendered. For optimization purposes, complex scenes with a large number of polygons should not have a high value to avoid the unnecessary rendering of objects that are too far.

Implementation

    public function get far():Number

    public function set far(value:Number):void

fieldOfView property  

fieldOfView:Number

Sets and returns the camera’s angle of view. The angle of view is inversely proportional to the zoom. The wider the angle, the closer the projection plane and, therefore, the shorter the zoom.

Implementation

    public function get fieldOfView():Number

    public function set fieldOfView(value:Number):void

 

near property  

near:Number

Sets or returns the clip plane that is closest to the camera. Its value must be greater than zero. Everything beyond this virtual plane is not to be rendered. The value corresponds to the distance between the camera and the plane. This value should be set at the furthest possible point from the camera. This is likely to result in improved performance, especially in those situations where objects go through the camera plane.

Implementation

    public function get near():Number

    public function set near(value:Number):void

 

projection property  

projection:Matrix3D  [read-only]

Returns the projection matrix.

Implementation

    public function get projection():Matrix3D

 

view property  

view:Matrix3D  [read-only]

Returns the view matrix.

Implementation

    public function get view():Matrix3D

 

viewPort property  

viewPort:Rectangle

Defines the area where the camera will draw. This area is relative to the scene viewport or camvasSize if it is defined.

Implementation

    public function get viewPort():Rectangle

    public function set viewPort(value:Rectangle):void

 

viewProjection property  

viewProjection:Matrix3D  [read-only]

Returns the viewProjection matrix.

Implementation

    public function get viewProjection():Matrix3D

 

zoom property  

zoom:Number

Sets or returns the camera zoom. The zoom is the distance between the point of origin of the camera and the projection plane.

Implementation

    public function get zoom():Number

public function set zoom(value:Number):void

 

Constructor Detail

Camera3D

()

Constructor

public function Camera3D(name:String, fieldOfView:Number = 60)

Parameters

 

name:String

   
 

fieldOfView:Number (default = 60)

 

Method Detail

getPointDir

()

method

public function getPointDir(x:Number, y:Number, out:Vector3D = null):Vector3D

Returns a global 3D direction vector relative to a 2D camera position.

Parameters

 

x:Number — The x position over the camera   viewport.

   
 

y:Number — The y position over the camera   viewport.

   
 

out:Vector3D (default = null) — A   reference vector to return the direction vector.

Returns

 

Vector3D — If the 'out' is 'null', a new   vector will be returned. Otherwise, the same vector, passed to the 'out'   parameter, will be returned.

 

类:Knot3D

Package: flare.core

Class: public class Knot3D

Inheritance: Knot3Dàflash.geom.Vector3D

The Knot3D class defines points for the splines (Spline3D).

Knot3D objects not only define the points as vertices do in a mesh, but also define control points to generate and move bezier curves through “inVec” and “outVec” vectors.

Property Detail

inVec property

public var inVec:Vector3D

Input vector for splines (Spline3D)

 

outVec property  

public var outVec:Vector3D

Output vector for splines (Spline3D)

Constructor Detail

Knot3D

()

Constructor

public function Knot3D()

Creates a new Knot3D.

Method Detail

clone () method

override public function clone():Vector3D

Returns a copy of Knot3D.

Returns Vector3D — a new Knot3D. 

类:Label3D

Package: flare.core

Class: public class Label3D

Inheritance: Label3DàObject

The Label3D class defines labels to be used for 3d object animation.

Property Detail

from

property

public var from:int

Frame where animation begins. The frame number is zero-based.

length

property

 

length:int [read-only]

Returns the length of the animation label.

Implementation
public function get length():int

name

property

 

public var name:String

Name given to the animation.

to

property

 

public var to:int

Frame where animation ends. The frame number is zero-based.

Constructor Detail

Label3D

()

Constructor

public function Label3D(name:String, from:int, to:int)

Creates a new Label3D object.

Parameters

 

name:String — Animation name.

   
 

from:int — Frame where animation begins.   The frame number is zero-based.

   
 

to:int — Frame where animation ends. The   frame number is zero-based.

Method Detail

toString

()

method

public function toString():String

returns string

类:Light3D

Package: flare.core

Class: public class Light3D

Inheritance: Light3DàPivot3Dàflash.events.EventDispatcher

Implements IDrawable

The Light3D class represents a 3d light. Lights will have an effect on the materials that admit them.

Property Detail

attenuation property

public var attenuation:Number = 100

Sets or returns light attenuation.

color property

public var color:Vector3D

Sets or returns light color.

infinite property

public var infinite:Boolean = true

Sets and returns if the light is infinite or not. Set it to true for ambient lights. Directional lights are always infinite.

inView property

inView:Boolean [read-only]

Implementation

public function get inView():Boolean

multipler property

public var multipler:Number = 1

Light color multipler.

priority property

public var priority:int

This value is for internal use to calculate the light priority acording the distance from the camera during the render.

radius property

public var radius:Number = 0

Sets or returns light radius.

sample property

public var sample:BitmapData

The BitmapData to use for light projections.

type   property  

public var type:int

Type of light (point/directional)

Constructor Detail

Light3D

()

Constructor

public function Light3D(name:String, type:int)

Parameters

 

name:String

   
 

type:int (default = NaN)

Method Detail

setParams

()

method

public function setParams(color:int = 0xffffff, radius:Number = 0, attenuation:Number = 1, multipler:Number = 1, infinite:Boolean = false):void

Sets the light properties.

Parameters

 

color:int (default = 0xffffff)

   
 

radius:Number (default = 0)

   
 

attenuation:Number (default = 1)

   
 

multipler:Number (default = 1)

   
 

infinite:Boolean (default = false)

Constant Detail

DIRECTIONAL Constant

public static const DIRECTIONAL:int = 0

Constant that defines a directional light.

 

POINT Constant  

public static const POINT:int = 1

Constant that defines a point light.

 

类:Lines3D

Package: flare.core

Class: public class Lines3D

Inheritance: Lines3DàPivot3Dàflash.events.EventDispatcher

Implements IDrawable

The Lines3D class is a helper to work with 3D pixel thickness lines.

 

Constructor Detail

Lines3D

()

Constructor

public function Lines3D(name:String)

Parameters

 

name:String

Method Detail

clear () method

public function clear():void

 

lineStyle () method  

public function lineStyle(thickness:Number = 1, color:uint = 0xffffff, alpha:Number = 1):void

Parameters

thickness:Number (default = 1)

color:uint (default = 0xffffff)

alpha:Number (default = 1)

 

lineTo () method  

public function lineTo(x:Number, y:Number, z:Number):void

Parameters

x:Number

y:Number

z:Number

 

moveTo () method  

public function moveTo(x:Number, y:Number, z:Number):void

Parameters

x:Number

y:Number

z:Number

 

类:Mesh3D

Package: flare.core

Class: public class Mesh3D

Inheritance: Mesh3DàPivot3Dàflash.events.EventDispatcher

Implements IDrawable

Subclasses: Cone, Cube, Plane, SkyBox, Sphere

The Mesh3D class contains the data (geometry, materials, modifiers) instances which can be drawn a 3d object.

Property Detail

bounds property

 

bounds:Boundings3D

Returns or sets a Boundings3D object with object properties, such as radius, dimensions, etc.

Implementation

    public function get bounds():Boundings3D

    public function set bounds(value:Boundings3D):void

 

modifier property  

public var modifier:Modifier

Modifier instance used to process and project vertices.

 

mouseEnabled property  

 

public var mouseEnabled:Boolean = false

Enables the mouse interaction with the object. If any mouse related event is added trough addEventListener method, this property will automatically be seted to 'true'.

 

surfaces property  

public var surfaces:Vector.<Surface3D>

Instance to the Surface3D class.

 

useHandCursor property  

public var useHandCursor:Boolean = false

Value that defines whether the hand cursor is to display when events such as MouseEvent3D.MOUSE_OVER or MouseEvent3D.MOUSE_MOVE are defined. The default value is false.

Constructor Detail

Mesh3D () Constructor

public function Mesh3D(name:String)

Creates a new Mesh3D object.

Parameters  name:String — Mesh name. 

Method Detail

updateBoundings

()

method

public function updateBoundings():void

Forces to update mesh boundings.

Event Detail

click Event 

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseDown Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseMove Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseOut Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseOver Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseUp Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

 

mouseWheel Event   

Event Object Type: flare.events.MouseEvent3D

MouseEvent3D.type property = flash.events.Event

类:Particle3D

Package: flare.core

Class: public class Particle3D

Inheritance: Particle3DàObject

The Particle3D is used as a base template class for ParticleEmiter3D.

Property Detail

rotation property

public var rotation:Number = 0

The rotation of the particle in radians.

 

sizeX property  

public var sizeX:Number = 1

The size along the x axis of the particle.

 

sizeY property  

public var sizeY:Number = 1

The size along the y axis of the particle.

 

x property  

public var x:Number = 0

The x position of the particle.

 

y property  

public var y:Number = 0

The y position of the particle.

 

z property  

public var z:Number = 0

The z position of the particle.

 

Constructor Detail

Particle3D () Constructor

public function Particle3D()

Creates a new Particle3D objects.

Method Detail

clone () method

public function clone():Particle3D

You must override this method to implement a custom particle.

Returns Particle3D — A new cloned particle. 

 

init () method  

public function init(emiter:ParticleEmiter3D):void

This method is called by the ParticleEmiter3D when needs to initializate the particle. Each particle could be initialized and reused many times while the emiter is active.

Parameters

emiter:ParticleEmiter3D — The parent ParticleEmiter3D object that fires the particle. 

 

update () method  

public function update(time:Number):void

This method is called each frame by the ParticleEmiter3D class when needs to update the particle.

Parameters

time:Number — The life time of the particle (from 0 to 1 ). 

 

类:ParticleEmiter3D

Package:flare.core

Class: public class ParticleEmiter3D

Inheritance: ParticleEmiter3DàPivot3Dàflash.events.EventDispatcher

Implements IDrawable

The ParticleEmiter3D is used to create particle effects.

 

Property Detail

bounds property

bounds:Boundings3D

Gets or sets the boudings to use for the emiter.

Implementation

    public function get bounds():Boundings3D

    public function set bounds(value:Boundings3D):void

 

decrementPerFrame property  

public var decrementPerFrame:Number = 0

A value of 0 (by default), keeps the particle emision constantly in loop. A value from 1 to n, will decrement each frame the amount of particles to fire by this value. If we set a emitParticlesPerFrame to a value of 10, and decrementPerFrame to 2, the first frame will fire 10, the second 8, the third 6, etc...until emitParticlesPerFrame is equal to 0. If the value is -1, the emitParticlesPerFrame property will be seted to 0 after fire the particles and no particles will be fired after a new emitParticlesPerFrame value is defined.

 

emitParticlesPerFrame property  

emitParticlesPerFrame:Number

How many particles fires each frame. When this property is changed, the emitParticlesPerSecond is also updated.

Implementation

    public function get emitParticlesPerFrame():Number

    public function set emitParticlesPerFrame(value:Number):void

 

emitParticlesPerSecond property  

emitParticlesPerSecond:Number

How many particles fires each second. When this property is changed, the emitParticlesPerFrame is also updated.

Implementation

    public function get emitParticlesPerSecond():Number

    public function set emitParticlesPerSecond(value:Number):void

 

material property  

material:Material3D

Sets or gets the materisl to be used to render the particles. The material should be a compatible material for particle emiters.

 

Implementation

    public function get material():Material3D

    public function set material(value:Material3D):void

 

particle property  

particle:Particle3D

Set the particle to use as a template for all emited particles.

Implementation

    public function get particle():Particle3D

    public function set particle(value:Particle3D):void

 

particlesLife property  

public var particlesLife:Number = 100

Particles life in frames.

 

surface property  

surface:Surface3D  [read-only]

Gets the surface associated to the emiter.

Implementation

    public function get surface():Surface3D

 

useGlobalSpace property  

useGlobalSpace:Boolean

If true, all particles will be updated in global space, otherwise, will be linked to the emiter object.

Implementation

    public function get useGlobalSpace():Boolean

    public function set useGlobalSpace(value:Boolean):void

 

Constructor Detail

ParticleEmiter3D () Constructor

public function ParticleEmiter3D(name:String, material:Material3D = null, particle:Particle3D = null)

Creates a new ParticleEmiter3D object.

Parameters

name:String — The name of the particle emiter. 

material:Material3D (default = null) — The texture to use for the particles. 

particle:Particle3D (default = null) — The particle to use as a template for all emited particles. 

 

Method Detail

dispose () method

override public function dispose():void

类:Pivot3D

Package: flare.core

Class: public class Pivot3D

Inheritance: Pivot3Dàflash.events.EventDispatcher

Subclasses: Camera3D, ColladaLoader, Flare3DLoader, Flare3DLoader1, Flare3DLoader2, Light3D, Lines3D, Mesh3D, ParticleEmiter3D, Scene3D, Shape3D

The Pivot3D class is the most basic three-dimensional element.

Represents a point, its orientation and scale in the 3d space.

 

The Pivot3D object can also be parent or container of other 3d objects and can be animated.

 

Property Detail

animationEnabled property

public var animationEnabled:Boolean = true

Activates or deactivates the animation. If the object is animated and this animation is being placed, the element will be blocked by the animation and will not be able to move or rotate manually; therefore, if an animated object is to be controlled, the animation must first be disabled by setting animationEnabled false.

animationMode property  

public var animationMode:int = 0

children property  

children:Vector.<Pivot3D>  [read-only]

Returns a Pivot3D-type vector with its children.

Implementation

    public function get children():Vector.<Pivot3D>

components property  

public var components:Vector.<IComponent>

A collection vector that contains all the components of the object.

currentFrame property  

currentFrame:Number

Returns or sets the frame number where the pivot is situated. Animation frames are zero-based.

Implementation

    public function get currentFrame():Number

    public function set currentFrame(value:Number):void

dirty property  

public var dirty:Boolean = true

Gets or sets when the object has changed his transform matrix by hand.

frames property  

public var frames:Vector.<Frame3D>

Vector that contains all the animation frames.

frameSpeed property  

frameSpeed:Number

Returns or sets animation speed. The default value is 1. The frame number is increased by the “frameSpeed” value in each update (“update” event) and is directly related to the number of updates per second in Device3D.

Implementation

    public function get frameSpeed():Number

    public function set frameSpeed(value:Number):void

global property  

global:Matrix3D

Returns a matrix with the global position, rotation and scale of the object. If the object is part of a hierarchy that has been moved, rotated, scaled, etc., this property will return the matrix relative to the furthest parent that can be found. In general, this could be the scene. The “world” matrix, instead, represents the local position, rotation and scale. If the “world” matrix has been manually modified, it will have to call the updateTransforms method to update the global matrix.

Implementation

    public function get global():Matrix3D

    public function set global(value:Matrix3D):void

invGlobal property  

invGlobal:Matrix3D  [read-only]

Returns a matrix with the inverse global position, rotation and scale of the object. If the object is part of a hierarchy that has been moved, rotated, scaled, etc., this property will return the matrix relative to the furthest parent that can be found. In general, this could be the scene.

Implementation

    public function get invGlobal():Matrix3D

isPlaying property  

isPlaying:Boolean  [read-only]

Returns true if an animation is being played.

Implementation

    public function get isPlaying():Boolean

labels property  

public var labels:Array

Returns or sets a vector that contains the Labels3D objects used to play and manage animations.

layer property  

layer:int

Gets and sets the layer to render the object.

Implementation

    public function get layer():int

    public function set layer(value:int):void

name property  

public var name:String

Sets or returns the object name.

parent property  

parent:Pivot3D

Returns or sets the object’s parent. Setting the parent through the “parent” property has the same effect as establishing the “parent” property with the AddChild method of the Pivot3D that will be parent. It can remove parent object by setting the “parent” property to “null”.

Implementation

    public function get parent():Pivot3D

    public function set parent(value:Pivot3D):void

scaleX property  

scaleX:Number

Increases or decreases the object scale on the X axis from its current scale. Use a value greater than one to increase or less than one to decrease. Setting the scale to 2 means that objects will be scaled to twice their original size, whereas a value of 0.5 would scale objects to one half of their original size.

Implementation

    public function get scaleX():Number

    public function set scaleX(value:Number):void

scaleY property  

scaleY:Number

Increases or decreases the object scale on the Y axis from its current scale. Use a value greater than one to increase or less than one to decrease. Setting the scale to 2 means that objects will be scaled to twice their original size, whereas a value of 0.5 would scale objects to one half of their original size.

Implementation

    public function get scaleY():Number

    public function set scaleY(value:Number):void

scaleZ property  

scaleZ:Number

Increases or decreases the object scale on the Z axis from its current scale. Use a value greater than one to increase or less than one to decrease. Setting the scale to 2 means that objects will be scaled to twice their original size, whereas a value of 0.5 would scale objects to one half their original size.

Implementation

    public function get scaleZ():Number

    public function set scaleZ(value:Number):void

scene property  

scene:Scene3D  [read-only]

Gets a reference to the scene that contains the object.

Implementation

    public function get scene():Scene3D

userData property  

public var userData:Object

Sets or returns an object for free use by the user. The userData object may also contain variables included within the f3d files.

visible property  

visible:Boolean

Sets or returns whether the object is visible. If the visible property is set false, the object will be hidden and so will all its descendants.

Implementation

    public function get visible():Boolean

    public function set visible(value:Boolean):void

world property  

public var world:Matrix3D

Sets or returns the matrix of local position, rotation and scale. The world property corresponds to the local space of the object.

x property  

x:Number

Returns or sets the position on the X axis.

Implementation

    public function get x():Number

    public function set x(value:Number):void

y property  

y:Number

Returns or sets the position on the Y axis.

Implementation

    public function get y():Number

    public function set y(value:Number):void

z property  

z:Number

Returns or sets the position on the Z axis.

Implementation

    public function get z():Number

    public function set z(value:Number):void

Constructor Detail

Pivot3D () Constructor

public function Pivot3D(name:String)

Creates a new Pivot3D object.

Parameters  name:String — 3d object name. 

Method Detail

addChild () method

public function addChild(pivot:Pivot3D, useGlobalSpace:Boolean = false):Pivot3D

Add a new object as a child.

Parameters

    pivot:Pivot3D — Object to be added. 

useGlobalSpace:Boolean (default = false)

Returns Pivot3D — The object that has been added. 

addComponent () method  

public function addComponent(component:IComponent):Boolean

Adds a new component to the object.

Parameters

    component:IComponent — The component to add. 

Returns Boolean — 'true' is the component was sucesfully added, 'false' otherwise. 

addLabel () method  

public function addLabel(label:Label3D, includeChildren:Boolean = true):Label3D

Adds a label that refers to a given animation.

Parameters

    label:Label3D — Label3D object. 

includeChildren:Boolean (default = true) — true if labels are to be included in all the sub-objects. 

Returns Label3D — Returns same Label3D object that contains the label information. 

clone () method  

public function clone():Pivot3D

Creates a copy of the object and all its elements.

Returns Pivot3D — A new Pivot3D object. 

copyTransformFrom () method  

public function copyTransformFrom(source:Pivot3D, local:Boolean = true):void

Copies all transformations (position, rotation and scale) from another Pivot3D object.

Parameters

    source:Pivot3D — Source object from you want to copy. 

local:Boolean (default = true) — true to copy from/to local coordinates, false will take global space coordinates. 

download () method  

public function download():void

draw () method  

public function draw(includeChildren:Boolean = true):void

Draws the object. This method is generally called by the scene that contains it and manages it. However, it is possible to manage the drawing process independently from a scene. To do so, it is essential that the canvas and the camera be properly set in the Device3D class and that the calculateView method of the Camera3D class be previously called.

Parameters

 includeChildren:Boolean (default = true)

forEach () method  

public function forEach(callback:Function, filterClass:Class = null, params:Object = null, includeChildren:Boolean = true):void

Excecutes a calback functions for each of his children. The callback should recibe a object:Pivot3D parameter.

Parameters

    callback:Function

filterClass:Class (default = null)

params:Object (default = null)

includeChildren:Boolean (default = true)

getBackward () method  

public function getBackward(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the back of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

getChildByName () method  

public function getChildByName(name:String, startIndex:int = 0, includeChildren:Boolean = true):Pivot3D

Returns the first child that matches the specified name.

Parameters

    name:String — Name of the object to be searched for. 

startIndex:int (default = 0) — An optional integer specifying the starting index of the search. 

includeChildren:Boolean (default = true) — true to extend the search to all the hierarchy. 

Returns Pivot3D — The object that matches the specified name. 

getDir () method  

public function getDir(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the front of the object.

Parameters

 local:Boolean (default = true)

 

 out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

getDown () method  

public function getDown(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the bottom side of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

getLeft () method  

public function getLeft(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the left side of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

getMaterialByName () method  

public function getMaterialByName(name:String, includeChildren:Boolean = true):Material3D

Returns the first material that matches the specified name.

Parameters

    name:String — Name of the material to be searched for. 

includeChildren:Boolean (default = true) — true to extend the search to all the object hierarchy. 

Returns Material3D — The material that matches the specified name. 

getPosition () method  

public function getPosition(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the current position of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — A new vector with the current position of the object. 

getRight () method  

public function getRight(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the right side of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

getRotation () method  

public function getRotation(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the current rotation of the object in euler angles.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — A new vector with the current rotation of the object. 

getScale () method  

public function getScale(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the current scale of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — A new vector with the current scale of the object. 

getScreenCoords () method  

public function getScreenCoords(out:Vector3D = null):Vector3D

Returns the coordinates of an object with respect to the screen. The returned values are relative to the viewPort size that is currently used.

Parameters

 out:Vector3D (default = null) — If a vector is specified, this vector will be filled with the returned values. 

Returns Vector3D — The vector with the coordinates. 

getUp () method  

public function getUp(local:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction vector that points to the upper side of the object.

Parameters

    local:Boolean (default = true)

out:Vector3D (default = null)

Returns Vector3D — The new direction vector. 

globalToLocal () method  

public function globalToLocal(point:Vector3D, out:Vector3D = null):Vector3D

Transforms a point of the global space of the object into a local space.

Parameters

    point:Vector3D — The point to be transformed. 

out:Vector3D (default = null) — Vector3D where the transformed point will be returned. If null, a new Vector3D is returned. 

Returns Vector3D — Vector3D with the transformed point. 

globalToLocalVector () method  

public function globalToLocalVector(vector:Vector3D, out:Vector3D = null):Vector3D

Transforms a point of the global space of the object into a local space without translation. Useful to convert direction normals or vectors.

Parameters

    vector:Vector3D — The point to be transformed. 

out:Vector3D (default = null) — Vector3D where the transformed point will be returned. If null, a new Vector3D is returned. 

Returns Vector3D — Vector3D with the transformed point. 

gotoAndPlay () method  

public function gotoAndPlay(frame:Object, blendFrames:Number = 0, animationMode:int):void

Parameters

    frame:Object

blendFrames:Number (default = 0)

animationMode:int (default = NaN)

gotoAndStop () method  

public function gotoAndStop(frame:Object, blendFrames:Number = 0):void

Stops the animation at the specified frame.

Parameters

    frame:Object — Frame number at which animation will be stopped. Animation frames are zero-based. 

blendFrames:Number (default = 0)

hide () method  

public function hide():void

Sets whether the object is visible. Only affects the current object.

localToGlobal () method  

public function localToGlobal(point:Vector3D, out:Vector3D = null):Vector3D

Transforms a point of the local space into the global space.

Parameters

 point:Vector3D — The point to be transformed. 

out:Vector3D (default = null) — The Vector3D where the transformed point will be returned. If null, a new Vector3D is returned. 

Returns Vector3D — If the “out” parameter is “null”, a new Vector3D object with the transformed point will be returned, or the same “out” vector. 

localToGlobalVector () method  

public function localToGlobalVector(vector:Vector3D, out:Vector3D = null):Vector3D

Transforms a point of the local space of the object into a global space without translation. Useful to convert direction normals or vectors.

Parameters

 vector:Vector3D — The point to be transformed. 

 

 out:Vector3D (default = null) — Vector3D where the transformed point will be returned. If null, a new Vector3D is returned. 

Returns Vector3D — Vector3D with the transformed point. 

lookAt () method  

public function lookAt(x:Number, y:Number, z:Number, up:Vector3D = null, smooth:Number = 1):void

Directs the object towards the specified position. Coordinates are related to the local space of the object.

Parameters

    x:Number — Position on x 

y:Number — Position on Y 

z:Number — Position on z 

up:Vector3D (default = null) — Vector3D related to the direction of the upper side of the object. The default value is (0, 1, 0). 

smooth:Number (default = 1) — Optional interpolation value towards final transformation (0-1). 

nextFrame () method  

public function nextFrame():void

play () method  

public function play(animationMode:int = 0):void

Parameters

 animationMode:int (default = 0)

prevFrame () method  

public function prevFrame():void

removeChild () method  

public function removeChild(pivot:Pivot3D):Pivot3D

Removes a child of the object.

Parameters

    pivot:Pivot3D — Object to be removed. 

Returns Pivot3D — The object that has been removed. 

removeComponent () method  

public function removeComponent(component:IComponent):Boolean

Removes a component from the object.

Parameters

 component:IComponent — The component to remove. 

Returns Boolean — 'true' if the component was sucesfully removed, 'false' otherwise or if the components was in the components list.. 

removeLabel () method  

public function removeLabel(label:Label3D, includeChildren:Boolean = true):Label3D

Removes a label.

Parameters

 label:Label3D — Label3D object to be removed. 

 

 includeChildren:Boolean (default = true) — true if the labels of all the sub-objects are to be removed. 

Returns Label3D — The label has been removed. 

replaceMaterial () method  

public function replaceMaterial(source:Material3D, replaceFor:Material3D, includeChildren:Boolean = true):void

Replaces an existing material of the object with another material.

Parameters

    source:Material3D — Material that is to be replaced. 

replaceFor:Material3D — Material that is to replace the previous one. 

includeChildren:Boolean (default = true) — true if children are to be included. 

resetTransforms () method  

public function resetTransforms():void

Resets the object position, rotation and scale.

rotateAxis () method  

public function rotateAxis(angle:Number, axis:Vector3D, pivotPoint:Vector3D = null):void

Rotates the object on the specified axis from its current position. The pivotPoint parameter can be used to rotate around a point.

Parameters

    angle:Number — Angles to be rotated 

axis:Vector3D — Direction vector or axis on which to rotate. 

pivotPoint:Vector3D (default = null) — Position vector that sets an anchoring point for rotation. The position must be expressed in local units. 

rotateX () method  

public function rotateX(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void

Rotates the object on the X axis from its current position. The pivotPoint parameter can be used to rotate around a point.

Parameters

    angle:Number — Angles to be rotated. 

local:Boolean (default = true) — true to rotate respecting current orientation, or false to rotate according to orientation relative to parent. 

pivotPoint:Vector3D (default = null) — Position vector that sets an anchoring point for rotation. The position must be expressed in local units. 

rotateY () method  

public function rotateY(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void

Rotates the object on the Y axis from its current position. The pivotPoint parameter can be used to rotate around a point.

Parameters

    angle:Number — Angles to be rotated. 

local:Boolean (default = true) — true to rotate respecting current orientation, or false to rotate according to orientation relative to parent. 

pivotPoint:Vector3D (default = null) — Position vector that sets an anchoring point for rotation. The position must be expressed in local units. 

rotateZ () method  

public function rotateZ(angle:Number, local:Boolean = true, pivotPoint:Vector3D = null):void

Rotates the pivot on the Z axis from its current position. The pivotPoint parameter can be used to rotate around a point.

Parameters

    angle:Number — Angles to be rotated. 

local:Boolean (default = true) — true to rotate respecting current orientation, or false to rotate according to orientation relative to parent. 

pivotPoint:Vector3D (default = null) — Position vector that sets an anchoring point for rotation. The position must be expressed in local units. 

setLayer () method  

public function setLayer(value:int):void

Sets the layer to render the object and all of his children.

Parameters

 value:int — The layer index. 

setMaterial () method  

public function setMaterial(material:Material3D, includeChildren:Boolean = true):void

Sets a material for the object and, optionally, all its descendants. The material will only affect Mesh3D objects that contain the Pivot3D.

Parameters

    material:Material3D — Material that will be assigned. 

includeChildren:Boolean (default = true) — true if all the hierarchy is to be included. 

setNormalOrientation () method  

public function setNormalOrientation(normal:Vector3D, smooth:Number = 1):void

Aligns the object to a normal.

Parameters

    normal:Vector3D — Normal used for alignment. 

smooth:Number (default = 1) — Optional interpolation value (0-1). 

setOrientation () method  

public function setOrientation(dir:Vector3D, up:Vector3D = null, smooth:Number = 1):void

Orients the object in a specific direction.

Parameters

    dir:Vector3D — Direction set for orientation. 

up:Vector3D (default = null) — Upper side of the object. The default value is (0,1,0). 

smooth:Number (default = 1) — Optional interpolation value (0-1). 

setPosition () method  

public function setPosition(x:Number, y:Number, z:Number, smooth:Number = 1, local:Boolean = true):void

Sets the position of the object.

Parameters

    x:Number — Position on x 

y:Number — Position on y 

z:Number — Position on z 

smooth:Number (default = 1) — Optional interpolation value towards final transformation (0-1). 

local:Boolean (default = true)

setRotation () method  

public function setRotation(x:Number, y:Number, z:Number):void

Sets the object rotation using euler angles. Rotation is absolute, so any previous rotation will be ignored.

Parameters

    x:Number — Rotation on x in angles. 

y:Number — Rotation on y in angles. 

z:Number — Rotation on z in angles. 

setScale () method  

public function setScale(x:Number, y:Number, z:Number, smooth:Number = 1):void

Sets the object scale. This method sets the scale in an absolute manner; therefore, any previous scale will be ignored. Default value is 1, use a value greater than one to increase or less than 1 to decrease the scale. Setting the scale to 2 means that objects will be scaled to twice their original size, whereas a value of 0.5 would scale objects to one half of their original size.

Parameters

    x:Number — Scale on x 

y:Number — Scale on y 

z:Number — Scale on z 

smooth:Number (default = 1)

setTranslation () method  

public function setTranslation(x:Number = 0, y:Number = 0, z:Number = 0, local:Boolean = true):void

Translates the object from its current position to the specified distance.

Parameters

    x:Number (default = 0) — Distance in units to translate on X axis. 

y:Number (default = 0) — Distance in units to translate on Y axis. 

z:Number (default = 0) — Distance in units to translate on Z axis. 

local:Boolean (default = true) — true to translate respecting current orientation or false to translate on the coordinates relative to the parent. 

show () method  

public function show():void

Sets whether the object is visible. Only affects the current object.

startDrag () method  

public function startDrag(lockCenter:Boolean = false, reference:Vector3D = null):void

Lets the user drag the specified Pivot3D. The Pivot3D remains draggable until explicitly stopped through a call to the Pivot3D.stopDrag() method, or until another Pivot3D is made draggable. Only one Pivot3D is draggable at a time.

Parameters

    lockCenter:Boolean (default = false)

reference:Vector3D (default = null)

stop () method  

public function stop():void

stopDrag () method  

public function stopDrag():void

Ends the startDrag() method. A Pivot3D that was made draggable with the startDrag() method remains draggable until a stopDrag() method is added, or until another Pivot3D becomes draggable. Only one Pivot3D is draggable at a time.

translateAxis () method  

public function translateAxis(distance:Number, axis:Vector3D):void

Translates the object on a certain axis from its current position.

Parameters

    distance:Number — Distance to translate. 

axis:Vector3D — Direction vector or axis on which to translate. 

translateX () method  

public function translateX(distance:Number, local:Boolean = true):void

Translates the object on the X axis from its current position.

Parameters

    distance:Number — Distance to translate. 

local:Boolean (default = true) — true to translate respecting current orientation, or false to translate on the coordinates relative to parent. 

translateY () method  

public function translateY(distance:Number, local:Boolean = true):void

Translates the object on the Y axis from its current position.

Parameters

    distance:Number — Distance to translate. 

local:Boolean (default = true) — true to translate respecting current orientation, or false to translate on the coordinates relative to parent. 

translateZ () method  

public function translateZ(distance:Number, local:Boolean = true):void

Translates the object on the Z axis from its current position.

Parameters

    distance:Number — Distance to translate. 

local:Boolean (default = true) — true to translate respecting current orientation, or false to translate on the coordinates relative to parent. 

update () method  

public function update():void

updateTransforms () method  

public function updateTransforms(includeChildren:Boolean = false):void

This method is used to force the system to update the object in those cases where its matrices have been modified manually.

Parameters

 includeChildren:Boolean (default = false) — true to include all the hierarchy. 

upload () method  

public function upload(scene:Scene3D = null, force:Boolean = false, includeChildren:Boolean = true):Boolean

Parameters

    scene:Scene3D (default = null)

force:Boolean (default = false)

includeChildren:Boolean (default = true)

Returns Boolean

Event Detail

added Event 

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs when the object is added to a scene or to any other object.

addedToScene Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs when the object is added to a scene.

animationComplete Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs at the end of an animation.

changeTransform Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs whatever the object changes his position, rotation or scale.

enterDrag Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs before drag the object.

enterDraw Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs before draw the object.

enterFrame Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs before entering any frame.

exitDrag Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs after drag the object.

exitDraw Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs after draw the object.

exitFrame Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs after updating every frame.

removed Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs when the object is removed from a scene or from any other object.

removedFromScene Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs when the object is removed from a scene.

unload Event   

Event Object Type: flash.events.Event

Event.type property = flash.events.Event

This event occurs when the dispose method of the object itself or of a parent object is called.

Constant Detail

ADDED_EVENT Constant

public static const ADDED_EVENT:String = added

Defines the value for the 'added' event.

ADDED_TO_SCENE_EVENT Constant  

public static const ADDED_TO_SCENE_EVENT:String = addedToScene

Defines the value for the 'addedToScene' event.

ANIMATION_COMPLETE_EVENT Constant  

public static const ANIMATION_COMPLETE_EVENT:String = animationComplete

Defines the value for the 'animationComplete' event.

ANIMATION_LOOP_MODE Constant  

public static const ANIMATION_LOOP_MODE:int = 0

ANIMATION_PING_PONG_MODE Constant  

public static const ANIMATION_PING_PONG_MODE:int = 1

ANIMATION_STOP_MODE Constant  

public static const ANIMATION_STOP_MODE:int = 2

ENTER_DRAW_EVENT Constant  

public static const ENTER_DRAW_EVENT:String = enterDraw

Defines the value for the 'enterDraw' event.

ENTER_FRAME_EVENT Constant  

public static const ENTER_FRAME_EVENT:String = enterFrame

Defines the value for the 'enterFrame' event.

EXIT_DRAW_EVENT Constant  

public static const EXIT_DRAW_EVENT:String = exitDraw

Defines the value for the 'exitDraw' event.

EXIT_FRAME_EVENT Constant  

public static const EXIT_FRAME_EVENT:String = exitFrame

Defines the value for the 'exitFrame' event.

REMOVED_EVENT Constant  

public static const REMOVED_EVENT:String = removed

Defines the value for the 'removed' event.

REMOVED_FROM_SCENE_EVENT Constant  

public static const REMOVED_FROM_SCENE_EVENT:String = removedFromScene

Defines the value for the 'removedFromScene' event.

UNLOAD_EVENT Constant  

public static const UNLOAD_EVENT:String = unload

Defines the value for the 'unload' event.

UPDATE_TRANSFORM_EVENT Constant  

public static const UPDATE_TRANSFORM_EVENT:String = updateTransform

Defines the value for the 'updateTransform' event.

 

 

 

类:Shape3D

Package: flare.core

Class: public class Shape3D

Inheritance: Shape3DàPivot3Dàflash.events.EventDispatcher

The Shape3D class represents a set of splines (Spline3D).

Property Detail

splines property

public var splines:Vector.<Spline3D>

Spline3D-type vector with the splines contained in the Shape3D.

Constructor Detail

Shape3D () Constructor

public function Shape3D(name:String)

Creates a new set of splines.

Parameters  name:String — Object name. 

Method Detail

getPoint () method

public function getPoint(value:Number, global:Boolean = true, out:Vector3D = null):Vector3D

Returns the position on the spline depending on the “value” parameter. This method will take into consideration all the splines (Spline3D) that are contained in the Shape3D. For example, if two Spline3D objects are contained, a value ranging from 0.0 to 0.5 in the “value” parameter will locate the resulting position on the first spline, whereas a value ranging from 0.5 to 1.0 will locate the resulting position on the second spline.

Parameters

value:Number — 0 to 1 value that represents the position in time on the spline. 

global:Boolean (default = true) — Sets whether the value will be returned in the global space or local space of the Shape3D. The default value is 'true'. 

out:Vector3D (default = null) — Vector where the position will be returned. 

Returns Vector3D — If an 'out' value has been specified, the same object is returned. Otherwise, a new vector with the position is returned. 

 

getTangent () method  

public function getTangent(value:Number, global:Boolean = true, out:Vector3D = null):Vector3D

Returns the direction on the spline in a given position. This method will take into consideration all the splines (Spline3D) that are contained in the Shape3D. For example, if two Spline3D objects are contained, a value ranging from 0.0 to 0.5 in the “value” parameter will locate the resulting position on the first spline, whereas a value ranging from 0.5 to 1.0 will locate the resulting position on the second spline.

Parameters

value:Number — 0 to 1 value that represents the position in time on the spline. 

global:Boolean (default = true) — Sets whether the value will be returned in the global space or local space of the Shape3D. The default value is 'true'. 

out:Vector3D (default = null) — Vector where the direction will be returned. 

Returns Vector3D — If an 'out' value has been specified, the same object is returned. Otherwise, a new vector with the position is returned. 

 

 

类:Spline3D

Package: flare.core

Class: public class Spline3D

Inheritance: Spline3DàObject

The Spline3D class represents a 3d spline.

Property Detail

closed property

closed:Boolean

Returns or sets whether this is a closed spline. In that case, the last Knot3D will be joined to the first.

Implementation

    public function get closed():Boolean

    public function set closed(value:Boolean):void

knots property  

public var knots:Vector.<Knot3D>

Knot3D-type vector with the spline knots.

Constructor Detail

Spline3D () Constructor

public function Spline3D()

Creates a new spline.

 

Method Detail

clone () method

public function clone():Spline3D

Creates a copy of the spline.

Returns Spline3D — The new copy of the spline. 

getPoint () method  

public function getPoint(value:Number, out:Vector3D = null):Vector3D

Returns the position on the spline depending on the “value” parameter.

Parameters

value:Number — 0 to 1 value that represents the position in time on the spline. 

out:Vector3D (default = null) — Vector where the position will be returned. 

Returns Vector3D — If an 'out' value has been specified, the same object is returned. Otherwise, a new vector with the position is returned. 

getTangent () method  

public function getTangent(value:Number, out:Vector3D = null):Vector3D

Returns the direction on the spline in a given position.

Parameters

value:Number — 0 to 1 value that represents the position in time on the spline. 

out:Vector3D (default = null) — Vector where the direction will be returned. 

Returns Vector3D — If an 'out' value has been specified, the same object is returned. Otherwise, a new vector with the position is returned. 

 

 

类:Surface3D

Package: flare.core

Class public class Surface3D

Inheritance Surface3D  Object

The Surface3D class represents a set of vertices, polygons and surfaces which can be drawn.

Property Detail

bounds property

public var bounds:Boundings3D

Returns or sets a Boundings3D object with object properties, such as radius, dimensions, etc.

firstIndex property  

public var firstIndex:int = 0

The index of the first vertex index selected to render.

indexBuffer property  

public var indexBuffer:IndexBuffer3D

Buffer of indices that reference to a vertex buffers of the Surface3D.

 

indexVector property  

public var indexVector:Vector.<uint>

Vector of indices that reference to a vertex buffers of the Surface3D.

material property  

material:Material3D

Material instance to render the surface.

Implementation

    public function get material():Material3D

    public function set material(value:Material3D):void

name property  

public var name:String

The name of the surface.

numTriangles property  

public var numTriangles:int = -1

Number of triangles that will be drawn.

offset property  

public var offset:Vector.<int>

The offset of data index in the vertexVector.

scene property  

scene:Scene3D  [read-only]

Implementation

    public function get scene():Scene3D

sizePerVertex property  

public var sizePerVertex:int = 0

The number of data values associated with each vertex

vertexBuffer property  

public var vertexBuffer:VertexBuffer3D

Buffer of vertices that reference to a vertex buffers of the Surface3D.

vertexVector property  

public var vertexVector:Vector.<Number>

Vector of vertices that reference to a vertex buffers of the Surface3D.

Constructor Detail

Surface3D () Constructor

public function Surface3D(name:String = null)

Creates a new Surface3D object.

Parameters  name:String (default = null)

Method Detail

addVertexData () method

public function addVertexData(dataIndex:uint, size:int = -1, vector:Vector.<Number> = null):int

Define a new attribute for each vertex. Each attribute can be a vector of 1-4 values (flotas) associated to each vertex.

The vertexVector can be for example: x,y,z,nx,ny,nz,u,v, x,y,z,nx,ny,nz,u,v, x,y,z,nx,ny,nz,u,v...

Parameters

dataIndex:uint — A value from 0 to 7 that define the type of data to be assocciated. The common values may be one of the POSITION, NORMALS, UV0, UV1, etc. constans of the Surface3D class. 

size:int (default = -1) — The size of data associated to the attribute for each vertex (1 to 4). 

vector:Vector.<Number> (default = null)

Returns int — 

dispose () method  

public function dispose():void

download () method  

public function download():void

updateBoundings () method  

public function updateBoundings():Boundings3D

Returns Boundings3D

upload () method  

public function upload(scene:Scene3D = null, force:Boolean = false):Boolean

Parameters

scene:Scene3D (default = null)

force:Boolean (default = false)

Returns Boolean

 

Constant Detail

BITANGENT Constant

public static const BITANGENT:int = 5

Vertex bi-tangents attribute (float3).

COLOR0 Constant  

public static const COLOR0:int = 9

Vertex color attribute (float3).

COLOR1 Constant  

public static const COLOR1:int = 10

Vertex color attribute (float3).

COLOR2 Constant  

public static const COLOR2:int = 11

Vertex color attribute (float3).

NORMAL Constant  

public static const NORMAL:int = 3

Vertex normals attribute (float3).

PARTICLE Constant  

public static const PARTICLE:int = 6

Vertex particles attribute (float4). Life (0-1), rotation in radians and size x and y (-1 to 1).

POSITION Constant  

public static const POSITION:int = 0

Vertex position attribute (float3).

SKIN_INDICES Constant  

public static const SKIN_INDICES:int = 8

Vertex skin indices attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).

SKIN_WEIGHTS Constant  

public static const SKIN_WEIGHTS:int = 7

Vertex skin weights attribute (could be float1 to float4 depending of the Device3D.maxBonesPerVertex property).

TANGENT Constant  

public static const TANGENT:int = 4

Vertex tangents attribute (float3).

UV0 Constant  

public static const UV0:int = 1

Vertex primary uv channel attribute (flaot2).

UV1 Constant  

public static const UV1:int = 2

Vertex secondary uv channel attribute (float2).

 

类:Texture3D

Package: flare.core

Class: public class Texture3D

Inheritance: Texture3Dàflash.events.EventDispatcher

Implements: ILibraryExternalItem

The Textrue3D class contains information on material textures.

 

Property Detail

bitmapData property

public var bitmapData:BitmapData

BitmapData object that contains the texture data.

bytesLoaded property  

bytesLoaded:uint  [read-only]

Implementation

    public function get bytesLoaded():uint

bytesTotal property  

bytesTotal:uint  [read-only]

Implementation

    public function get bytesTotal():uint

filterMode property  

public var filterMode:String = linear

Defines how the texture will be sampled when it needs to be streched on the screen. This property should be defined before the shader compilation. Setting to Texture3D.FILTER_NEAREST will take the nearest pixel. Setting to Texture3D.FILTER_LINEAR will take an interpolation between the nearest pixels.

loaded property  

loaded:Boolean

Returns if the texture was succesfull loaded.

Implementation

    public function get loaded():Boolean

    public function set loaded(value:Boolean):void

mipLevelsCallback property  

public var mipLevelsCallback:Function

Allow you to define a custom function to generate and upload the MIP levels.

mipMode property  

public var mipMode:String = miplinear

Defines if the texture will use mip mapping and how it will be applyied. This property should be defined before the shader compilation. Setting to Texture3D.MIP_NEAREST, uses the pixel from the nearest mipmap level. Setting to Texture3D.MIP_LINEAR uses the pixel from two nearest mipmap levels, and interpolates linearly. Setting to Texture3D.MIP_NONE will disable mip mode for the texture.

name property  

public var name:String

The name of the texture.

optimizeForRenderToTexture property  

optimizeForRenderToTexture:Boolean  [read-only]

Returns whatever the texture is optimized for dynamic rendering.

Implementation

    public function get optimizeForRenderToTexture():Boolean

request property  

request:*

Gets a reference to the request object.

Implementation

    public function get request():*

    public function set request(value:any):void

scene property  

scene:Scene3D

Returns a reference where the texture context is.

Implementation

    public function get scene():Scene3D

    public function set scene(value:Scene3D):void

texture property  

public var texture:TextureBase

Texture object that contains the texture data on graphics card.

typeMode property  

public var typeMode:String = 2d

Defines the type of the texture.

wrapMode property  

public var wrapMode:String = repeat

Defines how the texture will be sampled outside the normalized coordinates (0-1). This property should be defined before the shader compilation. Setting to WRAP_REPEAT, the texture will repeat to the infinity. Setting to WRAP_CLAMP, the last pixel of the texture image stretches to the infinity.

Constructor Detail

Texture3D () Constructor

public function Texture3D(request:*, optimizeForRenderToTexture:Boolean = false, format:String)

Creates a new texture. The 'request' parameter can be a url string path, URLRequest, or BitmapData. If a path is set for the texture, the Texture3D object will start its loading process. If no path is set for the texture, a BitmapData object that has been directly loaded can be specified.

Parameters 

request:* — It can be texture file path or BitmapData object. 

optimizeForRenderToTexture:Boolean (default = false)

format:String (default = NaN)

Method Detail

close () method

public function close():void

Terminates the loading proccess.

dispose () method  

public function dispose():void

Eliminates all the resources associated to the texture. The texture will be unusable after dispose.

download () method  

public function download():void

Download the texture from the graphics card.

load () method  

public function load():void

Loads the texture if it is an external resource..

upload () method  

public function upload(scene:Scene3D = null):Boolean

Upload the texture to the graphics card.

Parameters

 scene:Scene3D (default = null) — The scene to use as a context. 

Returns Boolean — true if was uploaded, false otherwise. 

Constant Detail

FILTER_LINEAR Constant

public static const FILTER_LINEAR:String = linear

FILTER_NEAREST Constant  

public static const FILTER_NEAREST:String = nearest

FORMAT_CUBEMAP Constant  

public static const FORMAT_CUBEMAP:String = cubemap

FORMAT_RGBA Constant  

public static const FORMAT_RGBA:String = rgba

MIP_LINEAR Constant  

public static const MIP_LINEAR:String = miplinear

MIP_NEAREST Constant  

public static const MIP_NEAREST:String = mipnearest

MIP_NONE Constant  

public static const MIP_NONE:String = mipnone

TYPE_2D Constant  

public static const TYPE_2D:String = 2d

TYPE_CUBE Constant  

public static const TYPE_CUBE:String = cube

WRAP_CLAMP Constant  

public static const WRAP_CLAMP:String = clamp

WRAP_REPEAT Constant  

public static const WRAP_REPEAT:String = repeat

 

posted on 2012-05-16 15:56  尔冬橙  阅读(613)  评论(0编辑  收藏  举报