Packagecom.mousman.as3.agal.parser.objs
Classpublic class MObjExportParser
InheritanceMObjExportParser Inheritance flash.events.EventDispatcher
Implements IDestroyable

creates a set of vertex buffers and index buffers based on a .obj and .mtl file and exports them in a binary file



Public Properties
 PropertyDefined By
  context3D : Context3D
[write-only] context3D used for creating and uploading vertex3Ds and index3Ds
MObjExportParser
Public Methods
 MethodDefined By
  
MObjExportParser(writerStore:WriterStore, dataIsZxy:Boolean = false, mirrorUV:Boolean = true)
Constructor.
MObjExportParser
  
callNext():void
MObjExportParser
  
destroy():void
delete datas
MObjExportParser
  
export():ByteArray
create a binary file containing the obj and mtl datas
MObjExportParser
  
parse(objfile:String, mtlfile:String = null, scale:Number = 1, writerParams:MBuffersWriterDTO = null):MObjMesh
Parse the obj and mtl file and create the mesh datas
MObjExportParser
Property Detail
context3Dproperty
context3D:Context3D  [write-only]

context3D used for creating and uploading vertex3Ds and index3Ds


Implementation
    public function set context3D(value:Context3D):void
Constructor Detail
MObjExportParser()Constructor
public function MObjExportParser(writerStore:WriterStore, 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. And then the export method

Parameters
writerStore:WriterStore — : WriterStore.

Used to resize the object

 
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
callNext()method
public function callNext():void

destroy()method 
public function destroy():void

delete datas

export()method 
public function export():ByteArray

create a binary file containing the obj and mtl datas

Returns
ByteArray — object containing mesh datas in a binary format
parse()method 
public function parse(objfile:String, mtlfile:String = null, scale:Number = 1, 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

 
scale:Number (default = 1) — : Number.

Used to resize the 3D model

 
writerParams:MBuffersWriterDTO (default = null) — : used to force color on the mesh.

Returns
MObjMesh — the datas of the mesh