DirectionalLight
Namespace:
namespace Lenga\Engine\Core;
class DirectionalLight
Methods
getColor
public function getColor()
Example
use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Core\DirectionalLight;
class LightController extends Behaviour
{
public function start(): void
{
$light = $this->getComponent(DirectionalLight::class);
$light->intensity = 1.0;
$light->setColor(255, 255, 255, 255); // White light
}
public function update(): void
{
$light = $this->getComponent(DirectionalLight::class);
// Rotate the light source
$this->transform->rotateY(10 * Time::deltaTime());
}
}