Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
Torchlight Class Reference

#include <torchlight.hpp>

Inheritance diagram for Torchlight:
Object

Public Member Functions

 Torchlight (glm::vec3 corner, float dist_orb, float dist_exit)
 
 Torchlight (glm::vec3 corner, const PointLightProperties &properties)
 
 ~Torchlight ()
 
SharedObject toShared () override
 Generates a SharedObject representation of this object. More...
 
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 More...
 
void overrideIntensity (float val)
 manually set torchlight intensity, for use in intro cutscene More...
 
float getIntensity () const
 get current intensity of torch from 0-1 More...
 
- Public Member Functions inherited from Object
 Object (ObjectType type, Physics physics, ModelType modelType)
 
virtual ~Object ()
 
void setModel (ModelType type)
 Sets this Object's model and initializes its dimensions to the given model's default dimensions. More...
 
virtual SharedObject toShared ()
 Generates a SharedObject representation of this object. More...
 
virtual void doCollision (Object *other, ServerGameState &state)
 Code to run when this object collides with another. More...
 
std::string to_string (unsigned int tab_offset)
 
std::string to_string ()
 

Data Fields

bool is_cut
 
- Data Fields inherited from Object
EntityID globalID {}
 Unique object ID (used to index into the ServerGameState::objects vector) More...
 
SpecificID typeID {}
 Type-specific Object ID (used to index into the type-specific objects vector in ServerGameState) More...
 
MovableID movableID {}
 Movable ID (used to index into the movable objects vector in ServerGameState) More...
 
ObjectType type
 Identifies this object's type (derived class) More...
 
Physics physics
 Object's Physics-related properties. More...
 
ModelType modelType
 Object's render model type (specifies this Object's render model to the client) More...
 
AnimState animState
 Object's animation state and current action. For non-animated objects, this defaults as AnimState::IdleAnim. More...
 
bool is_sprinting
 used to determine if the player is sprinting for animation purposes More...
 
std::vector< glm::ivec2 > gridCellPositions
 Vector of (x, y) positions of GridCells currently occupied by this object. More...
 
float distance_moved
 Distance moved, for use in deciding when to play footsteps IMPORTANT: reset every time a footstep sound is performed for objects that play foosteps. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Object
static std::unordered_map< ModelType, glm::vec3 > models
 Maps from ModelType to a model's dimensions as read from the model files. (At present, these values are hard-coded in object.cpp) More...
 

Constructor & Destructor Documentation

◆ Torchlight() [1/2]

Torchlight::Torchlight ( glm::vec3  corner,
float  dist_orb,
float  dist_exit 
)
explicit

Creates a torchight with default lighting properties.

Parameters
cornerCorner position of the surface
dist_orbdistance to orb, to see if it should be shaded blue
dist_exitdistance to the exit, to see if it should be shaded white

◆ Torchlight() [2/2]

Torchlight::Torchlight ( glm::vec3  corner,
const PointLightProperties properties 
)
Parameters
cornerCorner position of the surface
propertiesallows for customization of lighting and flickering properties

◆ ~Torchlight()

Torchlight::~Torchlight ( )

Member Function Documentation

◆ doTick()

bool Torchlight::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

Parameters
theposition the lightning hit (if exists)
theposition of the light cut action (if exists)

◆ getIntensity()

float Torchlight::getIntensity ( ) const

get current intensity of torch from 0-1

◆ overrideIntensity()

void Torchlight::overrideIntensity ( float  val)

manually set torchlight intensity, for use in intro cutscene

◆ toShared()

SharedObject Torchlight::toShared ( )
overridevirtual

Generates a SharedObject representation of this object.

Returns
A SharedObject representation of this object.

Reimplemented from Object.

Field Documentation

◆ is_cut

bool Torchlight::is_cut

The documentation for this class was generated from the following files: