class MAGES::RigidBodyAnimation::RigidbodyRotateTo

Overview

RigidbodyRotateTo: Rotates a game object to a given Vector3. More…

class RigidbodyRotateTo: public MAGES::RigidBodyAnimation::IRigidBodyAnimation
{
public:
    // properties

    Vector3 Target;
    GameObject RigidbodyTransformObj;
    float Speed;

    // methods

    RigidbodyRotateTo(
        Vector3 targetRot,
        GameObject trans,
        float speed,
        bool forceStart = false
    );

    void UpdateRigidBodyAnimation();
    void Restart(Vector3 newTargetPos, Quaternion newTargetRot);
    bool IsFinished();
    void Stop();
    void Pause();
    void Start();
};

Inherited Members

public:
    // properties

    GameObject RigidbodyTransformObj;
    float Speed;

    // methods

    void UpdateRigidBodyAnimation();
    void Stop();
    void Start();
    void Restart(Vector3 newTargetPos, Quaternion newTargetRot);
    bool IsFinished();

Detailed Documentation

RigidbodyRotateTo: Rotates a game object to a given Vector3.

Properties

Vector3 Target

Gets or sets Roation target.

GameObject RigidbodyTransformObj

Gets or sets game object with will apply rotation.

float Speed

Gets or sets rotaion speed.

Methods

RigidbodyRotateTo(
    Vector3 targetRot,
    GameObject trans,
    float speed,
    bool forceStart = false
)

Initializes a new instance of the RigidbodyRotateTo class.

Parameters:

targetRot

Rotation target.

trans

Object to interpolate.

speed

Interpolation speed.

forceStart

Start immediately.

void UpdateRigidBodyAnimation()

Updates the rigid body animation.

void Restart(Vector3 newTargetPos, Quaternion newTargetRot)

Restarts the animation.

Parameters:

newTargetPos

Target position.

newTargetRot

Target rotation.

bool IsFinished()

Checks if the animation has finished.

Returns:

True if the animation has finished, false otherwise.

void Stop()

Stops the animation.

void Pause()

Pause the interpolation.

void Start()

Starts the animation.