class MAGES::MeshDeformations::Puncturable

Overview

A Puncturable object that can be punctured by a MeshDeformations.NeedleActor. More…

class Puncturable: public MAGES::MeshDeformations::BaseConstraintSolver
{
public:
    // structs

    struct InsertionConstraint;
    struct PunctureData;
    struct SolveInsertionConstraintsJob;
    struct SolveInsertionFrictionConstraintsJob;
    struct UpdateConstraintsJob;

    // classes

    class ObservedTriangle;

    // properties

    BasePhysicsActor PuncturingActor;
    int InsertionConstraintsSubSteps;
    float InsertionConstraintsRelaxationFactor;
    float StaticFriction;
    float KineticFriction;
    float FrictionRelaxationFactor;
    bool IsInitialized;
    unsafe bool IsPunctured;
    int PuncturableTriangleCount;
    List<ObservedTriangle> ObservedTriangles;
    UnityEvent OnPunctured;
    UnityEvent OnUnpunctured;

    // methods

    override JobHandle DispatchSolveJob(in float timeStep, JobHandle dependsOn);
    virtual override void RegisterSolver();
    virtual override void DeregisterSolver();

    bool TryGetPuncturableTriangleParticleIndices(
        int triangleIndex,
        out int particleAIndex,
        out int particleBIndex,
        out int particleCIndex
    );
};

Inherited Members

public:
    // properties

    PhysicsWorld PhysicsWorld;
    int ExecutionOrder;

    // methods

    virtual void RegisterSolver();
    virtual void DeregisterSolver();
    JobHandle DispatchSolveJob(in float timeStep, JobHandle dependsOn);

Detailed Documentation

A Puncturable object that can be punctured by a MeshDeformations.NeedleActor.

See also:

MeshDeformations.NeedleActor

Properties

BasePhysicsActor PuncturingActor

Gets or sets the needle actor that will be used to puncture the puncturable.

int InsertionConstraintsSubSteps

Gets or sets the substeps used for simulating Insertion Constraints.

float InsertionConstraintsRelaxationFactor

Gets or sets the relaxation factor used for solving the insertion constraints.

float StaticFriction

Gets or sets the static friction of the needle - puncturable interaction.

float KineticFriction

Gets or sets the kinetic friction of the needle - puncturable interaction.

float FrictionRelaxationFactor

Gets or sets the friction relaxation factor.

bool IsInitialized

Gets a value indicating whether the puncturable is initialized.

unsafe bool IsPunctured

Gets a value indicating whether this puncturable is punctured by a needle.

int PuncturableTriangleCount

Gets the number of puncturable triangles available for selection.

List<ObservedTriangle> ObservedTriangles

Gets or sets a list of triangles to check for punctures.

UnityEvent OnPunctured

Gets or sets the event called once, when the puncturable is first punctured. This is evaluated after evaluating all observed triangles.

UnityEvent OnUnpunctured

Gets or sets the event called once, when the puncturable is unpunctured. This is evaluated after evaluating all observed triangles.

Methods

bool TryGetPuncturableTriangleParticleIndices(
    int triangleIndex,
    out int particleAIndex,
    out int particleBIndex,
    out int particleCIndex
)

Tries to resolve the particle indices for a puncturable triangle.

Parameters:

triangleIndex

The puncturable triangle index.

particleAIndex

The first particle index.

particleBIndex

The second particle index.

particleCIndex

The third particle index.

Returns:

true if the triangle exists; otherwise false.