Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
Scene System

Topics

 User Object-Oriented Logic
 

Files

file  scene_components.hpp
 Stores structs and classes for common components used by the SceneSystem and other related Systems.
 
file  scene_loading.hpp
 A collection of ResourceConstructor classes responsible for loading a scene into the engine.
 
file  scene_system.hpp
 System classes relating to the SceneSystem, which in some ways lies at the heart of the engine.
 
file  sim_system.hpp
 Classes and structs relating to the SimSystem, the system responsible for providing some level of general scriptability to scene nodes from a game developer's point-of-view.
 

Classes

struct  ToyMaker::Placement
 A component representing the position, rotation, and scale of an entity. More...
 
struct  ToyMaker::Transform
 The transform component, which moves the vertices of a model to their world space coordinates during rendering. More...
 
struct  ToyMaker::SceneHierarchyData
 Component representing hierarchical information related to this entity. More...
 
class  ToyMaker::SceneFromFile
 Constructs a scene tree from a file containing its JSON description. More...
 
class  ToyMaker::SceneFromDescription
 Constructs a scene tree (separate from the scene tree) based on its description in JSON. More...
 
class  ToyMaker::SceneNodeFromDescription
 Constructs a scene node based on its description in JSON. More...
 
class  ToyMaker::SimObjectFromDescription
 Constructs a SimObject from its description in JSON. More...
 
class  ToyMaker::ViewportNodeFromDescription
 Constructs a ViewportNode from its description in JSON. More...
 
class  ToyMaker::SceneNodeCore
 The core of a node in the SceneSystem, a set of components and methods overridable or usable by all types of scene nodes. More...
 
class  ToyMaker::BaseSceneNode< TSceneNode >
 A CRTP template for all the scene node types present in the project. More...
 
class  ToyMaker::SceneNode
 The most basic vanilla flavour of scene node comprised of no more than a name and some components. More...
 
class  ToyMaker::ViewportNode
 A type of node capable of and responsible for interacting sensibly with the engine's RenderSystem and ECSWorlds. More...
 
class  ToyMaker::SceneSystem
 The SceneSystem, a singleton System, responsible for tracking all objects in the scene, computing their Transforms, and maintaining hierarchical relationships between scene nodes. More...
 
class  ToyMaker::SceneSystem::SceneSubworld
 A subsystem of the SceneSystem which tracks, per world, which objects have had their Placement components updated. More...
 
class  ToyMaker::SimObject
 A wrapper on entity that allows objects in the Scene to be scriptable. More...
 

Enumerations

enum class  ToyMaker::RelativeTo : uint8_t { PARENT =0 }
 (Presently unused) A marker to indicate how transforms should be computed for a given scene node. More...
 
enum  ToyMaker::SpecialEntity : EntityID { ENTITY_NULL = kMaxEntities }
 (Perhaps unused) Special "reserved" entity IDs which the scene system might use. More...
 

Functions

void ToyMaker::from_json (const nlohmann::json &json, Placement &placement)
 
void ToyMaker::to_json (nlohmann::json &json, const Placement &placement)
 
void ToyMaker::to_json (nlohmann::json &json, const SceneHierarchyData &sceneHierarchyData)
 
void ToyMaker::from_json (const nlohmann::json &json, SceneHierarchyData &sceneHierarchyData)
 
void ToyMaker::to_json (nlohmann::json &json, const Transform &transform)
 
void ToyMaker::from_json (const nlohmann::json &json, Transform &transform)
 
 ToyMaker::NLOHMANN_JSON_SERIALIZE_ENUM (RelativeTo, { {RelativeTo::PARENT, "parent"}, })
 
glm::mat4 ToyMaker::buildModelMatrix (glm::vec4 position, glm::quat orientation, glm::vec3 scale=glm::vec3{1.f, 1.f, 1.f})
 Converts a position, orientation and scale into its model matrix equivalent.
 

Variables

const std::string ToyMaker::kSceneRootName { "" }
 Special name for the scene root, unusable by any other scene object.
 

Detailed Description

Enumeration Type Documentation

◆ RelativeTo

enum class ToyMaker::RelativeTo : uint8_t
strong

(Presently unused) A marker to indicate how transforms should be computed for a given scene node.

Currently all scene nodes are computed relative to their parent (even if they shouldn't be).

Todo
Make this feature actually work.

◆ SpecialEntity

(Perhaps unused) Special "reserved" entity IDs which the scene system might use.

Todo
Figure out if there's actual any use for this or if my brain farted when I was writing the scene system.

Function Documentation

◆ buildModelMatrix()

glm::mat4 ToyMaker::buildModelMatrix ( glm::vec4 position,
glm::quat orientation,
glm::vec3 scale = glm::vec3{1.f, 1.f, 1.f} )

Converts a position, orientation and scale into its model matrix equivalent.

Parameters
positionThe position offset to apply to a mesh.
orientationThe rotation applied to a mesh, expressed as a quaternion.
scaleThe factor along each direction by which to scale a mesh.
Returns
glm::mat4 The matrix representation of the argument values.