Packageaway3d.modifiers
Classpublic class HeightMapModifier
InheritanceHeightMapModifier Inheritance Object



Public Properties
 PropertyDefined By
  channel : uint
The channel used to extract the height values from the height map.
HeightMapModifier
  heightMap : BitmapData
The BitmapData object to be used as the height map of the modifier.
HeightMapModifier
  maxLevel : uint
Defines a maximum level of influence.
HeightMapModifier
  mesh : Mesh
The Mesh object to be modified.
HeightMapModifier
  offset : Number
The offset addded to the height values of the height map.
HeightMapModifier
  scale : Number
The scale multiplier applied to the height values of the height map.
HeightMapModifier
Public Methods
 MethodDefined By
  
HeightMapModifier(mesh:Mesh = null, heightMap:BitmapData = null, channel:uint = 1, maxLevel:uint = 255, scale:Number = 1, offset:Number = 0)
Creates a new HeightMapModifier object.
HeightMapModifier
  
execute():void
Updates the position of vertices in the mesh with the color value found at the uv's coordinates multiplied by a scale factor along the normal vector.
HeightMapModifier
  
HeightMapModifier
  
Apply the actual displacement and sets it as new base for further displacements.
HeightMapModifier
  
reset():void
Resets the verticies to their original values
HeightMapModifier
Property Detail
channelproperty
channel:uint

The channel used to extract the height values from the height map. Takes the static values available in the HeightMapDataChannel class. Defaults to RED.


Implementation
    public function get channel():uint
    public function set channel(value:uint):void

See also

heightMapproperty 
heightMap:BitmapData

The BitmapData object to be used as the height map of the modifier.


Implementation
    public function get heightMap():BitmapData
    public function set heightMap(value:BitmapData):void
maxLevelproperty 
maxLevel:uint

Defines a maximum level of influence. Values required are 0 to 1. If above or equal that level the influence is not applyed.


Implementation
    public function get maxLevel():uint
    public function set maxLevel(value:uint):void
meshproperty 
mesh:Mesh

The Mesh object to be modified.


Implementation
    public function get mesh():Mesh
    public function set mesh(value:Mesh):void
offsetproperty 
public var offset:Number

The offset addded to the height values of the height map. Defaults to 0.

scaleproperty 
public var scale:Number

The scale multiplier applied to the height values of the height map. Defaults to 1.

Constructor Detail
HeightMapModifier()Constructor
public function HeightMapModifier(mesh:Mesh = null, heightMap:BitmapData = null, channel:uint = 1, maxLevel:uint = 255, scale:Number = 1, offset:Number = 0)

Creates a new HeightMapModifier object. Modifies the position of vertices in a mesh along their normal vectors, using the height map imformation stored in a bitmap texture.

Parameters
mesh:Mesh (default = null) — [optional] The Mesh object to be modified.
 
heightMap:BitmapData (default = null) — [optional] The BitmapData object to be used as the height map of the modifier.
 
channel:uint (default = 1)
 
maxLevel:uint (default = 255)
 
scale:Number (default = 1)
 
offset:Number (default = 0)
####INIT####
Method Detail
execute()method
public function execute():void

Updates the position of vertices in the mesh with the color value found at the uv's coordinates multiplied by a scale factor along the normal vector.

See also

refreshNormals()method 
public function refreshNormals():void

refreshPositions()method 
public function refreshPositions():void

Apply the actual displacement and sets it as new base for further displacements.

reset()method 
public function reset():void

Resets the verticies to their original values