Packageaway3d.loaders
Classpublic class AC3D
InheritanceAC3D Inheritance AbstractParser Inheritance flash.events.EventDispatcher

File loader for the AC3D file format (.ac). This parser was written from AC3D 6.715 outputs. .ac file format version 11. Untested in prior versions Note: the "texture" tag url's might require some edits as AC3D doesn't offer a relative export If all textures are set into same folder, the parser supports a sourcespath variable. url textures becomes then "sourcesPath/+[skiped part url found in file]filename.jpg" example: private function loadACFile():void { var loader:Loader3D = new Loader3D(); loader.addOnSuccess(onLoaderSuccess); loader.addOnError(onLoaderError); var ACParser:AC3D = new AC3D({scaling:100, sourcesPath:"myImages"}); loader.loadGeometry("exportedACfiles/bigroom.ac", ACParser); } private function onLoaderSuccess(e:Loader3DEvent):void { var obj:Object3D = e.loader.handle; _scene.addChild(obj); } private function onLoaderError(e:Event):void { trace("Error loading .ac file"); } unsupported tags: "MATERIAL", "numsurf","kids","crease","texrep","refs lines of","url","data" and "numvert lines of":



Public Properties
 PropertyDefined By
 InheritedcenterMeshes : Boolean
Controls the automatic centering of geometry data in the model, improving culling and the accuracy of bounding dimension values.
AbstractParser
 Inheritedcontainer : Object3D
[read-only] Retuns a 3d container object used for storing the parsed 3d object.
AbstractParser
 InheritedgeometryLibrary : GeometryLibrary
[read-only] Retuns a geometryLibrary object used for storing the parsed geometry data.
AbstractParser
 Inheritedmaterial : Material
Overrides all materials in the model.
AbstractParser
 InheritedmaterialLibrary : MaterialLibrary
[read-only] Retuns a materialLibrary object used for storing the parsed material objects.
AbstractParser
 Inheritedmaterials : Object
Overides materials in the model using name:value pairs.
AbstractParser
 InheritedparsedChunks : int
[read-only] Returns the total number of data chunks parsed
AbstractParser
 InheritedparseTimeout : int
Defines a timeout period for file parsing (in milliseconds).
AbstractParser
  scaling : Number
A scaling factor for all geometry in the model.
AC3D
  sourcesPath : String
An optional unique location url for sources.
AC3D
 InheritedtotalChunks : int
[read-only] Returns the total number of data chunks available
AbstractParser
Protected Properties
 PropertyDefined By
 Inheritedini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the parser constructor.
AbstractParser
 Inherited_symbolLibrary : Dictionary
AbstractParser
Public Methods
 MethodDefined By
  
AC3D(init:Object = null)
Creates a new AC3D object.
AC3D
 Inherited
addOnError(listener:Function):void
Default method for adding a parseError event listener
AbstractParser
 Inherited
addOnProgress(listener:Function):void
Default method for adding a parseProgress event listener
AbstractParser
 Inherited
addOnSuccess(listener:Function):void
Default method for adding a parseSuccess event listener
AbstractParser
  
getVersionFromHex(char:String):int
AC3D
  
load(url:String, init:Object = null):Loader3D
[static] Loads and parses a .ac file into an Object3D object.
AC3D
  
parse(data:*, init:Object = null):Object3D
[static] Creates a 3d mesh object from the raw ascii data of a .ac file (AC3D).
AC3D
 Inherited
Parses 3d file data.
AbstractParser
 Inherited
removeOnError(listener:Function):void
Default method for removing a parseError event listener
AbstractParser
 Inherited
removeOnProgress(listener:Function):void
Default method for removing a parseProgress event listener
AbstractParser
 Inherited
removeOnSuccess(listener:Function):void
Default method for removing a parseSuccess event listener
AbstractParser
Protected Methods
 MethodDefined By
 Inherited
buildContainers(containerData:ContainerData, parent:ObjectContainer3D):void
AbstractParser
 Inherited
AbstractParser
 Inherited
AbstractParser
Events
 Event Summary Defined By
 InheritedDispatched when the 3d object parser fails to parse a file.AbstractParser
 InheritedDispatched when the 3d object parser progresses by one chunk.AbstractParser
 InheritedDispatched when the 3d object parser completes a file parse successfully.AbstractParser
Property Detail
scalingproperty
public var scaling:Number

A scaling factor for all geometry in the model. Defaults to 1.

sourcesPathproperty 
public var sourcesPath:String

An optional unique location url for sources. url textures becomes composed with "sourcesPath/+[skiped url in file]filename.jpg"

Constructor Detail
AC3D()Constructor
public function AC3D(init:Object = null)

Creates a new AC3D object.

Parameters
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

See also

####INIT####
Method Detail
getVersionFromHex()method
public function getVersionFromHex(char:String):int

Parameters

char:String

Returns
int
load()method 
public static function load(url:String, init:Object = null):Loader3D

Loads and parses a .ac file into an Object3D object.

Parameters

url:String — The url location of the file to load.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

Returns
Loader3D — A 3d loader object that can be used as a placeholder in a scene while the file is loading.
parse()method 
public static function parse(data:*, init:Object = null):Object3D

Creates a 3d mesh object from the raw ascii data of a .ac file (AC3D).

Parameters

data:* — The ascii data of a loaded file.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

Returns
Object3D — An Object3D representating the ac file.