class MAGES::MeshDeformations::SimulationMesh¶
Overview¶
A simulation mesh, used with the XPBD solver. More…
class SimulationMesh: public ScriptableObject
{
public:
// fields
RuntimeParticleDataSlice RuntimeParticleData;
RuntimeDistanceConstraintDataSlice RuntimeDistanceConstraintData;
RuntimeVolumeConstraintDataSlice RuntimeVolumeConstraintData;
RuntimeShapeMatchingConstraintDataSlice RuntimeShapeMatchingConstraintData;
RuntimeCollinearConstraintDataSlice RuntimeCollinearConstraintData;
// properties
UnityEvent AddedToPhysicsWorld;
UnityEvent RemovedFromPhysicsWorld;
bool IsPartOfPhysicsWorld;
int SimulationMeshDescriptorIndex;
PhysicsWorld PhysicsWorld;
Particle[] Particles;
VolumeConstraint[] VolumeConstraints;
DistanceConstraint[] DistanceConstraints;
ShapeMatchingConstraint[] ShapeMatchingConstraints;
CollinearConstraint[] CollinearConstraints;
PhysicsMaterial[] PhysicsMaterials;
uint Phase;
bool ParticlesEnabledStateHasChanged;
bool DistanceConstraintsEnabledStateHasChanged;
bool VolumeConstraintsEnabledStateHasChanged;
bool ShapeMatchingConstraintsEnabledStateHasChanged;
bool CollinearConstraintsEnabledStateHasChanged;
// methods
SimulationMesh();
SimulationMesh(
Particle[] particles,
DistanceConstraint[] distanceConstraints,
VolumeConstraint[] volumeConstraints,
ShapeMatchingConstraint[] shapeMatchingConstraints,
CollinearConstraint[] collinearConstraints
);
void Clear();
};
Detailed Documentation¶
A simulation mesh, used with the XPBD solver.
See also:
PhysicsWorld
Fields¶
RuntimeParticleDataSlice RuntimeParticleData
Runtime Particle Data Slice.
RuntimeDistanceConstraintDataSlice RuntimeDistanceConstraintData
Runtime Distance Constraint Data Slice.
RuntimeVolumeConstraintDataSlice RuntimeVolumeConstraintData
Runtime Volume Constraint Data Slice.
RuntimeShapeMatchingConstraintDataSlice RuntimeShapeMatchingConstraintData
Runtime Shape Matching Constraint Data Slice.
RuntimeCollinearConstraintDataSlice RuntimeCollinearConstraintData
Runtime Collinear Constraint Data Slice.
Properties¶
UnityEvent AddedToPhysicsWorld
Gets the event that is invoked when the simulation mesh is added to a physics world.
UnityEvent RemovedFromPhysicsWorld
Gets the event that is invoked when the simulation mesh is removed from a physics world.
bool IsPartOfPhysicsWorld
Gets a value indicating whether this simulation mesh is part of a physics world.
int SimulationMeshDescriptorIndex
Gets the simulation mesh descriptor index.
PhysicsWorld PhysicsWorld
Gets the physics world that the simulation mesh is part of or null if not part of any physics world.
Particle[] Particles
Gets or sets the particles of this simulation mesh.
Getting the particles involves memory allocation and is typically a slow operation.
VolumeConstraint[] VolumeConstraints
Gets or sets the volume constraints of this simulation mesh.
Getting the constraints involves memory allocation and is typically a slow operation.
DistanceConstraint[] DistanceConstraints
Gets or sets the distance constraints of the simulation mesh.
Getting the constraints involves memory allocation and is typically a slow operation.
ShapeMatchingConstraint[] ShapeMatchingConstraints
Gets or sets the shape matching constraints of the simulation mesh.
CollinearConstraint[] CollinearConstraints
Gets or sets the collinear constraints of the simulation mesh.
PhysicsMaterial[] PhysicsMaterials
Gets or sets the physics materials.
uint Phase
Gets the phase assigned to the particles by the physics world, -1 if not part of any physics world.
bool ParticlesEnabledStateHasChanged
Gets or sets a value indicating whether there was a change in some of the Particle.Enabled state in the last frame.
bool DistanceConstraintsEnabledStateHasChanged
Gets or sets a value indicating whether that there was a change in some of the DistanceConstraint.Enabled state in the last frame.
bool VolumeConstraintsEnabledStateHasChanged
Gets or sets a value indicating whether that there was a change in some of the VolumeConstraint.Enabled state in the last frame.
bool ShapeMatchingConstraintsEnabledStateHasChanged
Gets or sets a value indicating whether that there was a change in some of the ShapeMatchingConstraint.Enabled state in the last frame.
bool CollinearConstraintsEnabledStateHasChanged
Gets or sets a value indicating whether that there was a change in some of the ShapeMatchingConstraint.Enabled state in the last frame.
Methods¶
SimulationMesh()
Initializes a new instance of the SimulationMesh class.
SimulationMesh(
Particle[] particles,
DistanceConstraint[] distanceConstraints,
VolumeConstraint[] volumeConstraints,
ShapeMatchingConstraint[] shapeMatchingConstraints,
CollinearConstraint[] collinearConstraints
)
Initializes a new instance of the SimulationMesh class.
Parameters:
particles |
The particles of the simulation mesh. |
distanceConstraints |
The distance constraints of the simulation mesh. |
volumeConstraints |
The volume constraints of the simulation mesh. |
shapeMatchingConstraints |
The shape matching constraints of the simulation mesh. |
collinearConstraints |
The collinear constraints of the simulation mesh. |
void Clear()
Clears the simulation mesh of all data.