TransformInterface

Namespace:

namespace Lenga\Engine\Interfaces;

interface TransformInterface extends ComponentInterface

Marker interface shared by all transform components. Extending ComponentInterface, it lets engine systems work with any transform implementation without coupling to the concrete Transform class.

In scripts, you typically access the transform through $this->transform rather than type-hinting against this interface directly. Use TransformInterface when writing utilities or editor extensions that must accept any transform type.

Example

use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Interfaces\TransformInterface;

/**
 * Resets position, rotation, and scale to identity for any transform.
 */
function resetTransform(TransformInterface $t): void
{
    $t->setPosition([0, 0, 0]);
    $t->setRotation([0, 0, 0]);
    $t->setLocalScale([1, 1, 1]);
}

class LevelResetHelper extends Behaviour
{
    public function resetPlayer(): void
    {
        resetTransform($this->transform);
    }
}