struct MAGES::MeshDeformations::CalculateParticlesContributionToCoMsJob

Overview

Calculates the contribution of each particle’s position to the center of mass of the simulation mesh. More…

struct CalculateParticlesContributionToCoMsJob: public IJobParallelFor
{
    // fields

    NativeArray ParticlesEnabled;
    NativeArray ParticlesPredictedPosition;
    NativeArray ParticlesInverseMass;
    NativeArray ParticlesSimulationMeshDescriptorIndex;
    NativeArray SimulationMeshContainsParticlesWithInfiniteMass;
    NativeArray SimulationMeshLocks;
    NativeArray SimulationMeshTotalMass;
    NativeArray SimulationMeshCoM;

    // methods

    void Execute(int particleIndex);
};

Detailed Documentation

Calculates the contribution of each particle’s position to the center of mass of the simulation mesh.

Fields

NativeArray ParticlesEnabled

The enabled state of each particle.

NativeArray ParticlesPredictedPosition

The predicted position of each particle.

NativeArray ParticlesInverseMass

The inverse mass of each particle.

NativeArray ParticlesSimulationMeshDescriptorIndex

The index of the simulation mesh descriptor for each particle.

NativeArray SimulationMeshContainsParticlesWithInfiniteMass

Flag indicating if the simulation mesh contains any particles with infinite mass.

NativeArray SimulationMeshLocks

Locking array for Interlocked operations.

NativeArray SimulationMeshTotalMass

The total mass of each simulation mesh.

NativeArray SimulationMeshCoM

The center of mass of each simulation mesh.