class MAGES::Interaction::FixedJointTransformProvider

Overview

Will use fixed joints to try to match the gameobject this component is attached to, to the target. It initially will move the gamobject closer to the target using Rigidbody.MovePosition and Rigidbody.MoveRotation. More…

class FixedJointTransformProvider: public MAGES::Interaction::BaseTransformProvider
{
public:
    // classes

    class InteractorData;

    // properties

    float MoveCloserTime;

    // methods

    virtual override void Attach(IInteractor interactor);

    void Attach(
        IInteractor interactor,
        float jointBreakForce = 200f,
        Action<IInteractor, IInteractable> onJointBreak = null
    );

    virtual override void Detach(IInteractor interactor);
    virtual override void Process(UpdatePhase updatePhase);
};

Inherited Members

public:
    // properties

    IInteractable Interactable;

    // methods

    virtual void Attach(IInteractor interactor);
    virtual void Detach(IInteractor interactor);
    virtual void DetachCompletely();
    virtual bool IsAttachedTo(IInteractor interactor);
    virtual void Process(UpdatePhase updatePhase);

Detailed Documentation

Will use fixed joints to try to match the gameobject this component is attached to, to the target. It initially will move the gamobject closer to the target using Rigidbody.MovePosition and Rigidbody.MoveRotation.

Properties

float MoveCloserTime

Gets or sets a value betwen 0 and 1, for the time it takes to initially move the object closer to the target, before applying velocity.

Methods

virtual override void Attach(IInteractor interactor)

Attach the object to the AttachedTransform.

Parameters:

interactor

The interactor to attach to.

void Attach(
    IInteractor interactor,
    float jointBreakForce = 200f,
    Action<IInteractor, IInteractable> onJointBreak = null
)

Parameters:

onMovedCloser

A callback that will be called when the interactable has moved closer to the interactor, and the fixed joint has been created.

jointBreakForce

The force at which the fixed joint will break.

onJointBreak

Action to be called after the fixed joint breaks.

virtual override void Detach(IInteractor interactor)

Detach the interactable from the interactor.

Parameters:

interactor

The interactor to detach from.

virtual override void Process(UpdatePhase updatePhase)

Called by the master to update the TransformProvider in the given updatePhase.

Parameters:

updatePhase

The update phase this is called.