Packagealternativa.engine3d.loaders
Classpublic class Parser3DS

The parser of binary 3DS data.

Creates a tree of 3d objects and a list of textures, which are used by the objects. Unsupported objects are represented by instances of Object3D. 3DS materials which have a diffuse texture are represented by TextureMaterial with null texture, which has to be set later. Information about textures is stored in the textureMaterials property. The names of the texture files are converted to lowercase. 3DS materials which have no diffuse texture are represented as FillMaterial. All faces with the same material are put into one surface which has the identifier as the name of the material. If an object has no materials, all its faces are put into default surface. This surface receives WireMaterial with gray lines.

The class has properties which affect created objects.



Public Properties
 PropertyDefined by
  blendMode : String
Color blending mode for texture materials.
Parser3DS
  content : Object3D
[read-only] object containing all loaded objects
Parser3DS
  mobility : int
The value of the mobility property of 3d objects.
Parser3DS
  precision : Number
The value of the precision property of texture materials which are created during parsing process.
Parser3DS
  repeat : Boolean
The value of the repeat property of texture materials which are created during parsing process.
Parser3DS
  scale : Number
The scaling coefficient wich is applied to all parsed objects.
Parser3DS
  smooth : Boolean
The value of the smooth property of texture materials which are created during parsing process.
Parser3DS
  textureMaterials : Map
[read-only] The property contains information about textures used by the parsed objects.
Parser3DS
Public Methods
 MethodDefined by
  
parse(data:ByteArray):Boolean
The method parses 3DS data.
Parser3DS
  
unload():void
Clears internal references to the loaded data.
Parser3DS
Property detail
blendModeproperty
blendMode:String  [read-write]

Color blending mode for texture materials.

The default value is BlendMode.NORMAL.

Implementation
    public function get blendMode():String
    public function set blendMode(value:String):void

See also

contentproperty 
content:Object3D  [read-only]

object containing all loaded objects

Implementation
    public function get content():Object3D
mobilityproperty 
mobility:int  [read-write]

The value of the mobility property of 3d objects.

The default value is 0.

Implementation
    public function get mobility():int
    public function set mobility(value:int):void

See also

precisionproperty 
precision:Number  [read-write]

The value of the precision property of texture materials which are created during parsing process.

The default value is TextureMaterialPrecision.MEDIUM.

Implementation
    public function get precision():Number
    public function set precision(value:Number):void

See also

repeatproperty 
repeat:Boolean  [read-write]

The value of the repeat property of texture materials which are created during parsing process.

The default value is true.

Implementation
    public function get repeat():Boolean
    public function set repeat(value:Boolean):void

See also

scaleproperty 
scale:Number  [read-write]

The scaling coefficient wich is applied to all parsed objects.

The default value is 1.

Implementation
    public function get scale():Number
    public function set scale(value:Number):void
smoothproperty 
smooth:Boolean  [read-write]

The value of the smooth property of texture materials which are created during parsing process.

The default value is false.

Implementation
    public function get smooth():Boolean
    public function set smooth(value:Boolean):void

See also

textureMaterialsproperty 
textureMaterials:Map  [read-only]

The property contains information about textures used by the parsed objects. Keys of the map are names of texture materials, values are instances of TextureMapsInfo class.

Implementation
    public function get textureMaterials():Map

See also

Method detail
parse()method
public function parse(data:ByteArray):Boolean

The method parses 3DS data. The data is read starting from the current position in the specified byte array. After data has been parsed, the object tree is available via content property. The textureMaterials property will contain information about texture materials used by the objects or will be null if there are no texture materials.

Parameters
data:ByteArray3DS data

Returns
Booleantrue if the data has been successfully parsed, otherwise false

See also

unload()method 
public function unload():void

Clears internal references to the loaded data. The method doesn't work during loading process.