Program Listing for File point_light_component.h

Return to documentation for file (rootex/framework/components/visual/light/point_light_component.h)

#pragma once

#include "common/common.h"
#include "core/renderer/point_light.h"
#include "component.h"
#include "components/space/transform_component.h"

class PointLightComponent : public Component
{
    COMPONENT(PointLightComponent, Category::Light);
    DEPENDS_ON(TransformComponent);

    PointLight m_PointLight;

public:
    PointLightComponent::PointLightComponent(Entity& owner, const JSON::json& data);
    ~PointLightComponent() = default;

    Matrix getAbsoluteTransform() { return getTransformComponent()->getAbsoluteTransform(); }
    const PointLight& getPointLight() const { return m_PointLight; }

    JSON::json getJSON() const override;
    void draw() override;
};

DECLARE_COMPONENT(PointLightComponent);