17#ifndef _FGE_C_OBJLIGHT_HPP_INCLUDED
18#define _FGE_C_OBJLIGHT_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
21#include "C_lightSystem.hpp"
22#include "C_objRenderMap.hpp"
23#include "C_object.hpp"
24#include "FastEngine/C_scene.hpp"
25#include "FastEngine/accessor/C_texture.hpp"
27#define FGE_OBJLIGHT_CLASSNAME "FGE:OBJ:LIGHT"
36 explicit ObjLight(
fge::Texture const& texture, fge::Vector2f
const& position = fge::Vector2f());
38 fge::RectInt
const& rectangle,
39 fge::Vector2f
const& position = fge::Vector2f());
46 void setTexture(
fge::Texture const& texture,
bool resetRect =
false);
47 void setTextureRect(fge::RectInt
const& rectangle);
49 void setRenderObject(fge::ObjectDataShared
const& obj);
50 fge::ObjectDataShared
const& getRenderObject()
const;
55 fge::RectInt
const& getTextureRect()
const;
60 FGE_OBJ_UPDATE_DECLARE
63 void save(nlohmann::json& jsonObject)
override;
64 void load(nlohmann::json& jsonObject, std::filesystem::path
const& filePath)
override;
75 void updatePositions();
76 void updateTexCoords();
80 fge::RectInt g_textureRect;
82 fge::ObjectDataShared g_renderObject;
84 mutable std::vector<fge::vulkan::VertexBuffer> g_obstacleHulls;
Definition C_color.hpp:35
A base class that define a light component.
Definition C_lightSystem.hpp:56
Definition C_objLight.hpp:33
void unpack(fge::net::Packet const &pck) override
Unpack the object from a packet.
void save(nlohmann::json &jsonObject) override
Save the object to a json object.
char const * getReadableClassName() const override
Get a readable version of the class name.
fge::RectFloat getGlobalBounds() const override
Get the global bounds of the object.
void pack(fge::net::Packet &pck) override
Pack the object into a packet.
void first(fge::Scene &scene) override
Method called when the object is added to a scene for initialization purposes.
void load(nlohmann::json &jsonObject, std::filesystem::path const &filePath) override
Load the object from a json object.
fge::RectFloat getLocalBounds() const override
Get the local bounds of the object (without any transformations)
char const * getClassName() const override
Get the unique class name of the object.
Definition C_objRenderMap.hpp:31
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
A scene contain a collection of object and handle them.
Definition C_scene.hpp:465
This class is a wrapper for the texture manager to allow easy manipulation.
Definition C_texture.hpp:36
Definition C_packet.hpp:52
Definition C_vertexBuffer.hpp:45
This is a simple abstraction class for VkBlendFactor, VkBlendOp.
Definition C_blendMode.hpp:37