Hydrogen Framework
1.3.1
|
A Multi-Threaded Mesh Combiner that runs in another thread. (Yes! It is just that cool!) More...
Classes | |
class | BufferedMesh |
A thread safe representation of a Mesh. More... | |
class | MeshInput |
Mesh Input Format More... | |
class | MeshObject |
Mesh Object Format More... | |
class | MeshOutput |
Mesh Output Format More... | |
class | TransitionMesh |
Transition Stage Mesh More... | |
class | TransitionMeshSorter |
A class defining how to sort TransitionMeshes. More... | |
Public Member Functions | |
int | AddMaterial (UnityEngine.Material material) |
Add a Material to the Material reference Dictionary. More... | |
int | AddMaterial (int code, UnityEngine.Material material) |
Add a Material to the Material reference Dictionary with a specific code. More... | |
int[] | AddMaterials (UnityEngine.Material[] materials) |
Add an array of Material(s) to the reference Dictionary. More... | |
bool | AddMesh (MeshFilter meshFilter, Renderer renderer, Matrix4x4 worldMatrix) |
Add a Unity based Mesh into the MeshCombiner. More... | |
bool | AddMesh (MeshInput meshInput) |
Adds an existing MeshInput into the MeshCombiner. More... | |
void | ClearMaterials () |
Clear the Material reference Dictionary. More... | |
void | ClearMeshes () |
Clear the all Mesh data inside of the MeshCombiner. More... | |
int | Combine (Action< int, MeshOutput[]> onFinished) |
Start the actual threaded process to combine MeshInput data currently added to the MeshCombiner. More... | |
MeshInput | CreateMeshInput (MeshFilter meshFilter, Renderer renderer, Matrix4x4 worldMatrix) |
Creates a MeshInput from the passed arguements. More... | |
MeshInput[] | CreateMeshInputs (MeshFilter[] meshFilters, Renderer[] renderers, Matrix4x4[] worldMatrices) |
Creates MeshInput(s) from the passed arguement arrays. More... | |
MeshObject | CreateMeshObject (MeshOutput meshOutput) |
Creates a MeshObject from the MeshOutput (Instanced Materials). More... | |
MeshObject | CreateMeshObject (MeshOutput meshOutput, bool instanceMaterials) |
Creates a MeshObject from the passed MeshOutput. More... | |
MeshObject[] | CreateMeshObjects (MeshOutput[] meshOutputs) |
Creates MeshObject(s) from the passed MeshOutput(s) (Instanced Materials). More... | |
MeshObject[] | CreateMeshObjects (MeshOutput[] meshOutputs, bool instanceMaterials) |
Creates MeshObject(s) from the passed MeshOutput(s). More... | |
UnityEngine.Material[] | GetMaterials (int[] codes) |
Gets an array of Materials. More... | |
UnityEngine.Material[] | GetMaterialInstances (int[] codes) |
Gets an array of Materials (Instanced). More... | |
bool | RemoveMaterial (UnityEngine.Material material) |
Remove a UnityEngine.Material from the Material reference Dictionary. More... | |
bool | RemoveMesh (MeshFilter meshFilter, Renderer renderer, Matrix4x4 worldMatrix) |
Removes a Unity based Mesh from the MeshInput list to be processed. More... | |
bool | RemoveMesh (MeshInput meshInput) |
Removes a MeshInput from the MeshInput list to be processed. More... | |
Public Member Functions inherited from Hydrogen.Threading.ThreadPoolJob | |
override void | Start (bool backgroundThread, System.Threading.ThreadPriority priority) |
Sends the work process to the ThreadPool for starting when resources are available, This needs to initialize the WaitCallback with the Run function. More... | |
Public Member Functions inherited from Hydrogen.Threading.JobBase | |
virtual bool | Check () |
Checks if the Job is done, and facilitates calling OnFinished when completed. More... | |
Protected Member Functions | |
sealed override void | ThreadedFunction () |
This is the main workhorse method which runs in another thread. More... | |
sealed override void | OnFinished () |
Executed when the ThreadedFunction is finished (sort of), sending our MeshOutput(s) back to Unity for our coroutine to use. More... | |
Protected Member Functions inherited from Hydrogen.Threading.JobBase | |
virtual void | Abort () |
Abort the Job (as best we can). More... | |
virtual void | Run (object state) |
The launcher of the ThreadedFunction, used to handle the state as well. More... | |
Properties | |
Dictionary< int, UnityEngine.Material > | MaterialsLookup [get] |
Gets the current Material reference Dictionary. More... | |
List< MeshInput > | MeshInputs [get] |
Gets the MeshInput(s) list to be used to create TransitionMeshes during the processing. More... | |
int | MeshInputCount [get] |
The total number of MeshInput(s) currently in the system. More... | |
List< MeshOutput > | MeshOutputs [get] |
Gets the MeshOutput(s) list, often used during post processing to create meshes. More... | |
int | MeshOutputCount [get] |
The total number of MeshOutput(s) currently generated in the system. More... | |
Properties inherited from Hydrogen.Threading.JobBase | |
bool | IsBusy [get, set] |
Is the Job busy working? More... | |
bool | IsDone [get, set] |
Is the Job done? More... | |
bool | FiredOnFinished [get, set] |
Has the OnFinished been called yet? More... | |
A Multi-Threaded Mesh Combiner that runs in another thread. (Yes! It is just that cool!)
Definition at line 38 of file MeshCombiner.cs.
int Hydrogen.Threading.Jobs.MeshCombiner.AddMaterial | ( | UnityEngine.Material | material | ) |
Add a Material to the Material reference Dictionary.
This can only be used from within Unity's main thread.
material | The UnityEngine.Material to be added. |
Definition at line 114 of file MeshCombiner.cs.
int Hydrogen.Threading.Jobs.MeshCombiner.AddMaterial | ( | int | code, |
UnityEngine.Material | material | ||
) |
Add a Material to the Material reference Dictionary with a specific code.
This can only be used from within Unity's main thread.
code | The code to store as the reference for the Material. |
material | The UnityEngine.Material to be added. |
Definition at line 127 of file MeshCombiner.cs.
int [] Hydrogen.Threading.Jobs.MeshCombiner.AddMaterials | ( | UnityEngine.Material[] | materials | ) |
Add an array of Material(s) to the reference Dictionary.
materials | The UnityEngine.Material(s) to be added.. |
Definition at line 140 of file MeshCombiner.cs.
bool Hydrogen.Threading.Jobs.MeshCombiner.AddMesh | ( | MeshFilter | meshFilter, |
Renderer | renderer, | ||
Matrix4x4 | worldMatrix | ||
) |
Add a Unity based Mesh into the MeshCombiner.
This can only be used from within Unity's main thread.
true
, if mesh was added, false
otherwise.Definition at line 155 of file MeshCombiner.cs.
bool Hydrogen.Threading.Jobs.MeshCombiner.AddMesh | ( | MeshInput | meshInput | ) |
Adds an existing MeshInput into the MeshCombiner.
This can be done without Unity's main thread, if you have access to the data already. Just need to make sure that the material codes are set correctly.
true
, if MeshInput was added, false
otherwise.meshInput | The MeshInput to add. |
Definition at line 169 of file MeshCombiner.cs.
void Hydrogen.Threading.Jobs.MeshCombiner.ClearMaterials | ( | ) |
Clear the Material reference Dictionary.
Definition at line 181 of file MeshCombiner.cs.
void Hydrogen.Threading.Jobs.MeshCombiner.ClearMeshes | ( | ) |
Clear the all Mesh data inside of the MeshCombiner.
Definition at line 189 of file MeshCombiner.cs.
int Hydrogen.Threading.Jobs.MeshCombiner.Combine | ( | Action< int, MeshOutput[]> | onFinished | ) |
Start the actual threaded process to combine MeshInput data currently added to the MeshCombiner.
onFinished | The method to call when completed inside of Unity's main thread. |
Definition at line 200 of file MeshCombiner.cs.
MeshInput Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshInput | ( | MeshFilter | meshFilter, |
Renderer | renderer, | ||
Matrix4x4 | worldMatrix | ||
) |
Creates a MeshInput from the passed arguements.
This can only be used from within Unity's main thread.
meshFilter | The source Mesh's MeshFilter. |
renderer | The source Mesh's Renderer. |
worldMatrix | The source Mesh's World Matrix |
Definition at line 224 of file MeshCombiner.cs.
MeshInput [] Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshInputs | ( | MeshFilter[] | meshFilters, |
Renderer[] | renderers, | ||
Matrix4x4[] | worldMatrices | ||
) |
Creates MeshInput(s) from the passed arguement arrays.
This can only be used from within Unity's main thread.
meshFilters | The source Meshes MeshFilters. |
renderers | The source Meshes Renderers. |
worldMatrices | The source Meshes World Matrices |
Definition at line 286 of file MeshCombiner.cs.
MeshObject Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshObject | ( | MeshOutput | meshOutput | ) |
Creates a MeshObject from the MeshOutput (Instanced Materials).
meshOutput | The source MeshOutput to use in creating the MeshObject. |
Definition at line 305 of file MeshCombiner.cs.
MeshObject Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshObject | ( | MeshOutput | meshOutput, |
bool | instanceMaterials | ||
) |
Creates a MeshObject from the passed MeshOutput.
meshOutput | The source MeshOutput to use in creating the MeshObject. |
instanceMaterials | If set to true materials will be instanced. |
Definition at line 316 of file MeshCombiner.cs.
MeshObject [] Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshObjects | ( | MeshOutput[] | meshOutputs | ) |
Creates MeshObject(s) from the passed MeshOutput(s) (Instanced Materials).
meshOutputs | The source MeshOutput(s) to use in creating the MeshObject(s). |
Definition at line 377 of file MeshCombiner.cs.
MeshObject [] Hydrogen.Threading.Jobs.MeshCombiner.CreateMeshObjects | ( | MeshOutput[] | meshOutputs, |
bool | instanceMaterials | ||
) |
Creates MeshObject(s) from the passed MeshOutput(s).
meshOutputs | The source MeshOutput(s) to use in creating the MeshObject(s). |
instanceMaterials | If set to true materials will be instanced. |
Definition at line 388 of file MeshCombiner.cs.
UnityEngine.Material [] Hydrogen.Threading.Jobs.MeshCombiner.GetMaterialInstances | ( | int[] | codes | ) |
Gets an array of Materials (Instanced).
codes | An array of Material DataHashCodes. |
Definition at line 416 of file MeshCombiner.cs.
UnityEngine.Material [] Hydrogen.Threading.Jobs.MeshCombiner.GetMaterials | ( | int[] | codes | ) |
Gets an array of Materials.
codes | An array of Material DataHashCodes. |
Definition at line 402 of file MeshCombiner.cs.
|
protectedvirtual |
Executed when the ThreadedFunction is finished (sort of), sending our MeshOutput(s) back to Unity for our coroutine to use.
Can use Unity API.
Reimplemented from Hydrogen.Threading.JobBase.
Definition at line 560 of file MeshCombiner.cs.
bool Hydrogen.Threading.Jobs.MeshCombiner.RemoveMaterial | ( | UnityEngine.Material | material | ) |
Remove a UnityEngine.Material from the Material reference Dictionary.
true
, if UnityEngine.Material was removed, false
otherwise.material | The target UnityEngine.Material to be removed. |
Definition at line 431 of file MeshCombiner.cs.
bool Hydrogen.Threading.Jobs.MeshCombiner.RemoveMesh | ( | MeshFilter | meshFilter, |
Renderer | renderer, | ||
Matrix4x4 | worldMatrix | ||
) |
Removes a Unity based Mesh from the MeshInput list to be processed.
This is useful if you are caching MeshInputs for future use, and just want to remove a mesh as its no longer being combined. Open worlds may find this very useful. This can only be used from within Unity's main thread.
true
, if the Unity based Mesh was removed, false
otherwise.meshFilter | The Mesh's MeshFilter. |
renderer | The Mesh's Renderer. |
worldMatrix | The Mesh's World Matrix |
Definition at line 453 of file MeshCombiner.cs.
bool Hydrogen.Threading.Jobs.MeshCombiner.RemoveMesh | ( | MeshInput | meshInput | ) |
Removes a MeshInput from the MeshInput list to be processed.
This is useful if you are caching MeshInputs for future use, and just want to remove a mesh as its no longer being combined. Open worlds may find this very useful.
true
, if the MeshInput was removed, false
otherwise.meshInput | The MeshInput to be removed. |
Definition at line 467 of file MeshCombiner.cs.
|
protectedvirtual |
This is the main workhorse method which runs in another thread.
Takes the MeshInput(s) and converts them to TransitionMeshes in parallel. It then creates optimized MeshOutput(s) for use later or through the callback.
Reimplemented from Hydrogen.Threading.JobBase.
Definition at line 484 of file MeshCombiner.cs.
|
get |
Gets the current Material reference Dictionary.
The Material Reference Dictionary.
Definition at line 72 of file MeshCombiner.cs.
|
get |
The total number of MeshInput(s) currently in the system.
The MeshInput(s) Count.
Definition at line 88 of file MeshCombiner.cs.
|
get |
Gets the MeshInput(s) list to be used to create TransitionMeshes during the processing.
The MeshInput(s)
Definition at line 80 of file MeshCombiner.cs.
|
get |
The total number of MeshOutput(s) currently generated in the system.
The MeshOutput(s) Count.
Definition at line 104 of file MeshCombiner.cs.
|
get |
Gets the MeshOutput(s) list, often used during post processing to create meshes.
The MeshOutput(s)
Definition at line 96 of file MeshCombiner.cs.