Class WebSceneSpotLight#

Inheritance Relationships#

Base Type#

Class Documentation#

class WebSceneSpotLight : public Karana::Scene::WebSceneNode#

Specialized node to provide a viewpoint for the WebScene.

See Scene layer for more discussion on the scene layer.

Public Functions

WebSceneSpotLight(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene, const Karana::Core::ks_ptr<Karana::WebUI::Server> &server, bool *batching, const Color &color, float intensity, float angle)#

WebSceneSpotLight constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:
  • name – Name for the WebSceneSpotLight

  • scene – WebScene to add the camera to.

  • server – Server to communicate with frontends

  • batching – Whether transform updates are being batched.

  • color – Color of the light.

  • intensity – Intensity of the light.

  • angle – Angle of cone from center line in radians.

const Color &getColor()#

Get the light color.

Returns:

The light color

void setColor(const Color &color)#

Set the light color.

Parameters:

color – The light color

float getIntensity()#

Get the light intensity.

Returns:

The light intensity

void setIntensity(float intensity)#

Set the light intensity.

Parameters:

intensity – The light intensity

float getAngle()#

Get the cone angle from center line.

Returns:

The angle

void setAngle(float angle)#

Set the cone angle from center line.

Parameters:

angle – The angle

void setTarget(const Karana::Core::ks_ptr<WebSceneNode> &target)#

Set a target node to point the light at.

Parameters:

target – The target node

Public Static Functions

static Karana::Core::ks_ptr<WebSceneSpotLight> create(std::string_view name, const Karana::Core::ks_ptr<WebScene> &scene, const Color &color = Color::WHITE, float intensity = 1, float angle = M_PI / 3)#

Create a new WebSceneSpotLight.

Parameters:
  • name – Name for the WebSceneSpotLight

  • scene – WebScene to add the camera to.

  • color – Color of the light.

  • intensity – Intensity of the light.

  • angle – Angle of cone from center line in radians.

Returns:

A pointer to the new light.

Protected Functions

virtual void _discard(Karana::Core::ks_ptr<Karana::Core::Base> &base) override#

Discard the provided WebSceneSpotLight.

Parameters:

base – - Base pointer to the WebSceneSpotLight.