Avara3D 0.2.0
C++ API reference
PointLight.h
1//
2// PointLight.h
3// avara3d
4//
5// Created by Morgan Davis on 7/31/2024.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_VISUAL_LIGHT_POINTLIGHT_H
10#define AVARA3D_VISUAL_LIGHT_POINTLIGHT_H
11
12#include <string>
13
14#include "a3d/Color.h"
15#include "a3d/visual/light/Attenuation.h"
16#include "a3d/visual/light/Light.h"
17
18namespace a3d {
19
26 class PointLight : public Light {
27
28 public:
29 // [Public Lifecycle Functions]
30
33
35 explicit PointLight(const std::string& name);
36
38 explicit PointLight(const Color& color);
39
41 PointLight(const std::string& name, const Color& color);
42
43 PointLight(const PointLight&) = default;
44 PointLight& operator=(const PointLight&) = default;
45
46 PointLight(PointLight&&) noexcept = default;
47 PointLight& operator=(PointLight&&) noexcept = default;
48
49 // [Public Member Functions]
50
52 const Attenuation& attenuation() const;
53
56
57 private:
58 // [Private Member Variables]
59
60 Attenuation _attenuation;
61 };
62
63}
64
65#endif // AVARA3D_VISUAL_LIGHT_POINTLIGHT_H
Represents a normalized RGBA color.
Definition: Color.h:27
Base class for light sources attached to Scene Nodes.
Definition: Light.h:32
const std::optional< std::string > & name() const
Returns the optional light name.
const Color & color() const
Returns the light color.
Omnidirectional light located at its containing Node's world position.
Definition: PointLight.h:26
const Attenuation & attenuation() const
Returns the distance-attenuation coefficients.
PointLight(const std::string &name)
Creates a named white PointLight.
PointLight(const std::string &name, const Color &color)
Creates a PointLight with name and color.
PointLight(const Color &color)
Creates an unnamed PointLight with color.
PointLight()
Creates an unnamed white PointLight.
Distance-attenuation coefficients for point and spot lights.
Definition: Attenuation.h:20