Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
torchlight.hpp
Go to the documentation of this file.
1#pragma once
2
7
8class Torchlight : public Object {
9public:
16 explicit Torchlight(glm::vec3 corner, float dist_orb, float dist_exit);
17
23 Torchlight(glm::vec3 corner, const PointLightProperties& properties);
25
26 SharedObject toShared() override;
27
35 bool doTick(ServerGameState& state, std::optional<glm::vec3> lightning_light_cut_pos, std::optional<glm::vec3> action_light_cut_pos);
36
40 void overrideIntensity(float val);
41
45 float getIntensity() const;
46
47 bool is_cut;
48private:
49 PointLightProperties properties;
50
51
52 // current intensity from 0-1 that gets
53 // sent to client
54 float curr_intensity;
55
56 // state needed for animated flickering
57
58 // curr_step from 0-1 in flickering animation
59 float curr_step;
60
61 // how much the intensity should change on every server tick
62 float flickering_speed;
63
64 // if the flickering animation is inceasing in
65 // intensity or decreasing
66 bool inc_intensity;
67
68 // shared initialization between multiple constructors
69 void init();
70};
Definition: object.hpp:95
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43
Representation of the Object class used by ServerGameState, containing exactly the subset of Object d...
Definition: sharedobject.hpp:302
Definition: torchlight.hpp:8
float getIntensity() const
get current intensity of torch from 0-1
Definition: torchlight.cpp:194
bool doTick(ServerGameState &state, std::optional< glm::vec3 > lightning_light_cut_pos, std::optional< glm::vec3 > action_light_cut_pos)
runs on every server tick to update torchlight flickering animations @parm current ServerGameState
Definition: torchlight.cpp:135
bool is_cut
Definition: torchlight.hpp:47
SharedObject toShared() override
Generates a SharedObject representation of this object.
Definition: torchlight.cpp:11
void overrideIntensity(float val)
manually set torchlight intensity, for use in intro cutscene
Definition: torchlight.cpp:199
~Torchlight()
Definition: torchlight.cpp:133
GLuint GLfloat * val
Definition: glad.h:2480
Definition: point_light.hpp:5