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.

NativeArray ParticlesEnabled

The enabled state of the particles.

NativeArray ParticlesSimulationMeshDescriptorIndex

The index of the simulation mesh descriptor for each particle.

NativeArray ParticlesPhysicsMaterialIndex

The index of the physics material for each particle.

NativeArray ParticlesOriginalInverseMass

The original inverse mass of the particles.

NativeArray ParticlesAdjustedInverseMass

The adjusted inverse mass of the particles. Adjusted based on the height of the particles to improve stacking stability.

NativeArray ContainsParticlesWithInfiniteMass

Flag for each simulation mesh to indicate if it contains any particles with infinite mass.

NativeArray ParticlesPosition

The position of the particles.

NativeArray ParticlesPredictedPosition

The predicted position of the particles.

NativeArray ParticlesVelocity

The velocity of the particles.

NativeArray SimulationMeshDescriptors

The simulation mesh descriptors.

NativeArray<PhysicsMaterial> PhysicsMaterials

The physics materials.