Apply this component to any game object you wish to pre-fracture. Pre-fracturing is a way of baking fracture pieces into the scene. Each time the object is fractured, the same set of pieces will activate. This is very useful when creating a large number of pieces or high poly meshes, which would be too slow to create at runtime. The pieces will be in the scene as a disabled root object with piece children. When the object is fractured, those pieces will activate.
More...
|
void | Prime () |
| Primes the pre-fractured pieces when the game starts by activating them and then deactivating them. This avoids a large delay on fracture if there are a lot of rigid bodies.
|
|
void | FractureAndForget () |
| Initiate a fracture at the origin and does not return a handle to the async operation.
|
|
void | FractureAndForget (Vector3 localPos) |
| Initiate a fracture at the specified position relative to this object and does not return a handle to the async operation.
|
|
AsyncFractureResult | Fracture () |
| Initiate a fracture at the origin.
|
|
AsyncFractureResult | Fracture (Vector3 localPos) |
| Initiate a fracture at the specified position relative to this object.
|
|
OnFractureEventArgs | CreateEmptyFractureEventArgs () |
| Creates an empty set of OnFractureEventArgs that can be used to manually fracture completed handler in the event that calling Fracture() returns no async fracture result to attach to.
|
|
MeshTopologyError | CheckMeshValidity () |
| This is called automatically when viewing the component in the inspector. However, it should be called whenever the mesh changes through other means.
|
|
void | ForceValidGeometry () |
| This will force the geometry to pass all validity checks.
|
|
List< EdgeError > | GetMeshEdgeErrors () |
| Returns any bad mesh edges. Used by the editor script for debugging.
|
|
|
GameObject | GeneratedPieces |
| A reference to the root of the pre-fractured pieces. This is not normally set manually. Instead, you press the “Create Fractures” button in the inspector window to generate the fracture immediately.
|
|
Bounds | EntireMeshBounds |
| The encapsulating bounds of the entire set of pieces. In local space.
|
|
Material | InsideMaterial |
| The material assigned to the “inside” triangles of the fracture pieces. These are the triangles that DinoFracture creates. The surface triangles of the original mesh retain their materials.
|
|
bool | OptimizeMaterialUsage = true |
| If true, newly generated triangles using the "InsideMaterial" will attempt to be part of the same existing material in th mesh.
|
|
GameObject | FractureTemplate |
| This game object will be cloned for each facture piece. It is required to have a MeshFilter component. If a MeshCollider component is added, it will be assigned the fracture mesh.
|
|
Transform | PiecesParent |
| The parent of the generated pieces. Each fracture produces a root object with fracture pieces (clones of FractureTemplate) as children. The root object is parented to PiecesParent.
|
|
FractureType | FractureType = FractureType.Shatter |
| The type of fracture to produce when Fracture() is called.
|
|
SlicePlaneSerializable[] | SlicePlanes |
| The planes to use when slicing the mesh. Not used when fracturing into pieces.
|
|
int | NumFracturePieces = 5 |
| The number of fracture pieces generated per iteration. Fault lines are spread evenly around the fracture point. The number of total pieces generated is NumFracturePieces ^ NumIterations.
|
|
int | NumIterations = 2 |
| The number of passes of fracturing. Using lower piece count with a higher iteration count is computationally faster than a higher piece count with a lower iteration count. Ex: 5 pieces with 2 iterations is faster than 25 pieces and 1 iteration. The downside to using more iterations is fractures can become less uniform. In general, keep this number below 4. The number of total pieces generated is NumFracturePieces ^ NumIterations.
|
|
bool | EvenlySizedPieces = true |
| If true, the engine will attempt to make all the randomly generated pieces roughly the same size. This adds a little processing time to the fracture.
|
|
int | NumGenerations = 1 |
| To allow for fracture pieces to be further fractured, the FractureTemplate should have a FractureGeometry component. NumGenerations dictates how many times the geometry can be re-fractured. The count is decremented and passed on to the component in each generated piece. Ex: A value of 2 means this piece can be fractured and each generated piece can be fractured. The second generation of fractures cannot be fractured further.
|
|
float | FractureRadius |
| A value between 0 and 1 that indicates how clustered the fracture lines are. A value of 0 or 1 means fractures are evenly distributed across the mesh. A value between means they are clustered within a percentage of the mesh bounds. Ex: a value of 0.3 means fractures are clustered around the fracture point in a volume 30% the size of the mesh. Pre-fracture geometry typically has this value set to 0 or 1 because there isn’t always a pre-determined point of fracture.
|
|
SizeSerializable | FractureSize |
| The approximate size of fractures to create during shatter. When combined with a position through a call to Fracture(), the shatter planes will be clustered within this bounds.
|
|
FractureUVScale | UVScale = FractureUVScale.Piece |
| If set to EntireMesh, the UV map for each inside triangle will be mapped to a box the size of the original mesh. If set to piece, inside triangles will be mapped to a box the size of the individual fracture piece.
|
|
UVBoundsSerializable | UVBounds = new UVBoundsSerializable(Vector2.zero, Vector2.one) |
| Final 'inside' triangles will be remapped to be within this range. This does not affect the UVs on the incoming mesh and works with any value set for the UVScale.
|
|
bool | DistributeMass = true |
| If true and both this game object and the FractureTemplate have a RigidBody component, each fracture piece will have a mass set to a value proportional to its volume. That is, the density of the fracture piece will equal the density of the original mesh. If false, the mass property goes untouched.
|
|
bool | SeparateDisjointPieces = false |
| If true, a final pass will be done to separate out meshes that are not physically connected. This can only happen when the mesh has concave parts.
|
|
VertexMergingPolicy | VertexMergingPolicy = VertexMergingPolicy.Default |
| Defines how aggressively to merge the vertices of this fracture. More aggressive merging will result in meshes that have a reduced number of vertices and triangles at the cost of more computation time during fracture.
|
|
int | RandomSeed = 0 |
| The random seed to use when initiating the fracture. If set to zero, then the system clock will be used to create a random seed.
|
|
OnFractureEvent | OnFractureCompleted |
| Unity event that fires whenever a fracture on this object completes.
|
|
bool | SkipMeshCleaning = false |
| Not recommended to be set. But if set to true, no mesh cleaning will occur during the fracture process. This has no effect if the mesh is already clean.
|
|
Apply this component to any game object you wish to pre-fracture. Pre-fracturing is a way of baking fracture pieces into the scene. Each time the object is fractured, the same set of pieces will activate. This is very useful when creating a large number of pieces or high poly meshes, which would be too slow to create at runtime. The pieces will be in the scene as a disabled root object with piece children. When the object is fractured, those pieces will activate.