Packagecom.mousman.as3.agal.parser.objs
Classpublic class MObjParser
InheritanceMObjParser Inheritance Object
Implements IDestroyable

create a set of vertex buffers and index buffers based on a .obj and .mtl file



Public Properties
 PropertyDefined By
  mesh : MObjMesh
[read-only] the object containing mesh datas
MObjParser
  mirrorUV : Boolean
[write-only] some exporters mirror the UV texture coordinates
MObjParser
Public Methods
 MethodDefined By
  
MObjParser(context:Context3D, scale:Number, shaderStore:ShaderStore, dataIsZxy:Boolean = false, mirrorUV:Boolean = true)
Constructor.
MObjParser
  
destroy():void
delete datas
MObjParser
  
log(txt:String):void
MObjParser
  
parse(objfile:String, mtlfile:String = null, writerParams:MBuffersWriterDTO = null):MObjMesh
Parse the obj and mtl file and create the mesh datas
MObjParser
Property Detail
meshproperty
mesh:MObjMesh  [read-only]

the object containing mesh datas


Implementation
    public function get mesh():MObjMesh
mirrorUVproperty 
mirrorUV:Boolean  [write-only]

some exporters mirror the UV texture coordinates

The default value is true.


Implementation
    public function set mirrorUV(value:Boolean):void
Constructor Detail
MObjParser()Constructor
public function MObjParser(context:Context3D, scale:Number, shaderStore:ShaderStore, dataIsZxy:Boolean = false, mirrorUV:Boolean = true)

Constructor. Creates a new MObjParser instance.

After you create the MObjParser instance, call the parse method to create the mesh datas.

Parameters
context:Context3D — : Context3D.

Used to create and upload VertexBuffers and IndexBuffers

 
scale:Number — : Number.

Used to resize the object

 
shaderStore:ShaderStore — : ShaderStore.

Contains all the shaders used for the mesh

 
dataIsZxy:Boolean (default = false) — : Boolean.

Older versions of 3dsmax use an invalid vertex order

 
mirrorUV:Boolean (default = true) — : Boolean.

Some exporters mirror the UV texture coordinates

Method Detail
destroy()method
public function destroy():void

delete datas

log()method 
public function log(txt:String):void

Parameters

txt:String

parse()method 
public function parse(objfile:String, mtlfile:String = null, writerParams:MBuffersWriterDTO = null):MObjMesh

Parse the obj and mtl file and create the mesh datas

Parameters

objfile:String — : String.

Contains the obj file datas

 
mtlfile:String (default = null) — : String.

Contains the mtl file datas

 
writerParams:MBuffersWriterDTO (default = null) — : MBuffersWriterDTO

used to force color on the mesh.

Returns
MObjMesh — the datas of the mesh