Class WebScenePointLight#
Defined in File WebScenePointLight.h
Inheritance Relationships#
Base Type#
public Karana::Scene::WebSceneNode(Class WebSceneNode)
Class Documentation#
-
class WebScenePointLight : 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
-
WebScenePointLight(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)#
WebScenePointLight 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 WebScenePointLight
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.
-
float getIntensity()#
Get the light intensity.
- Returns:
The light intensity
-
void setIntensity(float intensity)#
Set the light intensity.
- Parameters:
intensity – The light intensity
-
void setShadows(float intensity = 1.0, int pixels = 2048, float near = 1e-3, float far = 1e11)#
Enable and configure shadow casting for this light.
- Parameters:
intensity – Shadow intensity in the range [0, 1]
pixels – Pixel dimensions of the square shadow map
near – Minimum distance to cast shadows
far – Maximum distance to cast shadows
-
void clearShadows()#
Disable shadow casting for this light.
Public Static Functions
-
static Karana::Core::ks_ptr<WebScenePointLight> create(std::string_view name, const Karana::Core::ks_ptr<WebScene> &scene, const Color &color = Color::WHITE, float intensity = 1)#
Create a new WebScenePointLight.
- Parameters:
name – Name for the WebScenePointLight
scene – WebScene to add the camera to.
color – Color of the light.
intensity – Intensity of the light.
- Returns:
A pointer to the new light.
Protected Functions
-
virtual void _discard(Karana::Core::ks_ptr<Karana::Core::Base> &base) override#
Discard the provided WebScenePointLight.
- Parameters:
base – - Base pointer to the WebScenePointLight.
-
WebScenePointLight(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)#