CapsuleRenderer

Namespace:

namespace Lenga\Engine\Core;

class CapsuleRenderer

Properties

center

public Vector3 $center

radius

public float $radius

height

public float $height

totalSlices

public int $totalSlices

totalRings

public int $totalRings

materialPath

public string $materialPath

Methods

getColor

public function getColor()

setColor

public function setColor(int $red, int $green, int $blue, int $alpha = 255): void

Example

use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Core\CapsuleRenderer;

class CapsuleVisual extends Behaviour
{
    public function start(): void
    {
        $renderer = $this->getComponent(CapsuleRenderer::class);
        $renderer->radius = 0.5;
        $renderer->height = 2.0;
        $renderer->setColor(0, 200, 255, 255);
    }
}