struct MAGES::MeshDeformations::PreSolveJob¶
Overview¶
Applies External Forces.(Gravity, etc)
Applies Mass Scaling. Predicts Positions. More…
struct PreSolveJob: public IJobParallelFor
{
// fields
float TimeStep;
float FloorHeight;
float ParticleRadius;
float3 Gravity;
float MaxVelocitySquared;
NativeArray ParticlesEnabled;
NativeArray ParticlesSimulationMeshDescriptorIndex;
NativeArray ParticlesPhysicsMaterialIndex;
NativeArray ParticlesOriginalInverseMass;
NativeArray ParticlesAdjustedInverseMass;
NativeArray ContainsParticlesWithInfiniteMass;
NativeArray ParticlesPosition;
NativeArray ParticlesPredictedPosition;
NativeArray ParticlesVelocity;
NativeArray SimulationMeshDescriptors;
NativeArray<PhysicsMaterial> PhysicsMaterials;
// methods
void Execute(int particleIndex);
};
Detailed Documentation¶
Applies External Forces.(Gravity, etc)
Applies Mass Scaling. Predicts Positions.
Fields¶
float TimeStep
The simulation time step.
float FloorHeight
The floor height.
float ParticleRadius
The particle radius.
float3 Gravity
The external gravity force.
float MaxVelocitySquared
The maximum velocity squared for particles to prevent tunelling.
NativeArrayParticlesEnabled
The enabled state of the particles.
NativeArrayParticlesSimulationMeshDescriptorIndex
The index of the simulation mesh descriptor for each particle.
NativeArrayParticlesPhysicsMaterialIndex
The index of the physics material for each particle.
NativeArrayParticlesOriginalInverseMass
The original inverse mass of the particles.
NativeArrayParticlesAdjustedInverseMass
The adjusted inverse mass of the particles. Adjusted based on the height of the particles to improve stacking stability.
NativeArrayContainsParticlesWithInfiniteMass
Flag for each simulation mesh to indicate if it contains any particles with infinite mass.
NativeArrayParticlesPosition
The position of the particles.
NativeArrayParticlesPredictedPosition
The predicted position of the particles.
NativeArrayParticlesVelocity
The velocity of the particles.
NativeArraySimulationMeshDescriptors
The simulation mesh descriptors.
NativeArray<PhysicsMaterial> PhysicsMaterials
The physics materials.