AsImpL 1.0
Asynchronous Importer and run-time Loader for Unity
AsImpL.ObjectBuilder Class Reference

Build the game object hierarchy with meshes and materials from a DataSet and a MaterialData list. More...

Classes

class  ProgressInfo
 

Public Member Functions

void InitBuildMaterials (List< MaterialData > materialData, bool hasColors, ModelReferences modelRefs)
 Initialize the importing of materials More...
 
bool BuildMaterials (ProgressInfo info, ModelReferences modelRefs)
 Import materials step by step. More...
 
void StartBuildObjectAsync (DataSet dataSet, GameObject parentObj, Dictionary< string, Material > materials=null)
 Initialize the asynchronous objects building. More...
 
bool BuildObjectAsync (ref ProgressInfo info)
 Build an object in more steps, one game object at a time. More...
 

Static Public Member Functions

static void Solve (Mesh origMesh)
 Calculate tangent space vectors for a mesh. More...
 
static void BuildMeshCollider (GameObject targetObject, bool convex=false, bool isTrigger=false, bool inflateMesh=false, float skinWidth=0.01f)
 Build mesh colliders for objects with a mesh filter. More...
 

Public Attributes

ImportOptions buildOptions = null
 Optional build options More...
 

Protected Member Functions

bool BuildNextObject (GameObject parentObj, Dictionary< string, Material > mats)
 Build an object once at a time, to be reiterated until false is returned. More...
 

Properties

Dictionary< string, Material > ImportedMaterials [get]
 Get the indexed list of imported materials More...
 
int? NumImportedMaterials [get]
 Get the number of imported materials or 0 if nothing has been imported. More...
 
IShaderSelector?? ShaderSelector [getset]
 
IMaterialFactory?? MaterialFactory [getset]
 

Detailed Description

Build the game object hierarchy with meshes and materials from a DataSet and a MaterialData list.

Member Function Documentation

◆ BuildMaterials()

bool AsImpL.ObjectBuilder.BuildMaterials ( ProgressInfo  info,
ModelReferences  modelRefs 
)

Import materials step by step.

Call this until it returns false.

Parameters
infoProgress information to be updated
Returns
Return true if in progress, false otherwise.

◆ BuildMeshCollider()

static void AsImpL.ObjectBuilder.BuildMeshCollider ( GameObject  targetObject,
bool  convex = false,
bool  isTrigger = false,
bool  inflateMesh = false,
float  skinWidth = 0.01f 
)
static

Build mesh colliders for objects with a mesh filter.

Parameters
targetObjectGame object to process (if it hasn't a mesh filter nothing happens)
convexBuild a convex mesh collider.
isTriggerSet collider as "trigger"
inflateMeshInflate the convex mesh
skinWidthAmout to be inflated

◆ BuildNextObject()

bool AsImpL.ObjectBuilder.BuildNextObject ( GameObject  parentObj,
Dictionary< string, Material >  mats 
)
protected

Build an object once at a time, to be reiterated until false is returned.

Parameters
parentObjGame object to which the new objects will be attached
matsMaterials from the previously loaded library
Returns
Return true until no more objects can be added, then false.

◆ BuildObjectAsync()

bool AsImpL.ObjectBuilder.BuildObjectAsync ( ref ProgressInfo  info)

Build an object in more steps, one game object at a time.

Call StartBuildObjectAsync() once, then call this until it returns true.

Parameters
infoprogress information data updated on each call
Returns

◆ InitBuildMaterials()

void AsImpL.ObjectBuilder.InitBuildMaterials ( List< MaterialData materialData,
bool  hasColors,
ModelReferences  modelRefs 
)

Initialize the importing of materials

Parameters
materialDataList of material data
hasColorsIf true and materialData is null and vertex colors are available, then use them

◆ Solve()

static void AsImpL.ObjectBuilder.Solve ( Mesh  origMesh)
static

Calculate tangent space vectors for a mesh.

http://forum.unity3d.com/threads/how-to-calculate-mesh-tangents.38984/

Parameters
origMeshMesh to be filled with tangents

TODO: move this to a general utility class?

◆ StartBuildObjectAsync()

void AsImpL.ObjectBuilder.StartBuildObjectAsync ( DataSet  dataSet,
GameObject  parentObj,
Dictionary< string, Material >  materials = null 
)

Initialize the asynchronous objects building.

Call this once before calling StartBuildObjectAsync().

Parameters
dataSetdata set used to build the object
parentObjgame object to which the object will be attached
materialsdictionary mapping from materil name to material

Member Data Documentation

◆ buildOptions

ImportOptions AsImpL.ObjectBuilder.buildOptions = null

Optional build options

Property Documentation

◆ ImportedMaterials

Dictionary<string, Material> AsImpL.ObjectBuilder.ImportedMaterials
get

Get the indexed list of imported materials

◆ MaterialFactory

IMaterialFactory?? AsImpL.ObjectBuilder.MaterialFactory
getset

◆ NumImportedMaterials

int? AsImpL.ObjectBuilder.NumImportedMaterials
get

Get the number of imported materials or 0 if nothing has been imported.

◆ ShaderSelector

IShaderSelector?? AsImpL.ObjectBuilder.ShaderSelector
getset

The documentation for this class was generated from the following file: