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
ToyMaker::StaticMeshCuboidDimensions Class Reference

Constructs a cuboid mesh based on its dimensions. More...

#include <shapegen.hpp>

Inheritance diagram for ToyMaker::StaticMeshCuboidDimensions:
ToyMaker::ResourceConstructor< StaticMesh, StaticMeshCuboidDimensions > ToyMaker::IResourceConstructor

Static Public Member Functions

static std::string getResourceConstructorName ()
 

Private Member Functions

std::shared_ptr< IResourcecreateResource (const nlohmann::json &methodParameters) override
 Creates a resource object using the parameters specified in methodParameters.
 

Additional Inherited Members

- Public Member Functions inherited from ToyMaker::ResourceConstructor< StaticMesh, StaticMeshCuboidDimensions >
std::string getResourceConstructorName_ () const override
 Gets the resource constructor type string of the constructor.
 
- Public Member Functions inherited from ToyMaker::IResourceConstructor
virtual ~IResourceConstructor ()=default
 Destroys this resource constructor (when the application is terminated.)
 
- Protected Member Functions inherited from ToyMaker::ResourceConstructor< StaticMesh, StaticMeshCuboidDimensions >
 ResourceConstructor (int explicitlyInitializeMe)
 Construct a new ResourceConstructor object.
 
- Protected Member Functions inherited from ToyMaker::IResourceConstructor
 IResourceConstructor ()=default
 Construct a new IResourceConstructor object.
 
- Static Protected Member Functions inherited from ToyMaker::IResourceConstructor
template<typename TResource, typename TResourceConstructor>
static void RegisterResourceConstructor ()
 Registers this resource constructor against its respective ResourceFactory during static initialization.
 

Detailed Description

Constructs a cuboid mesh based on its dimensions.

Example:

renderSet.second.mSkyboxRenderStage->attachMesh("unitCube", ResourceDatabase::ConstructAnonymousResource<StaticMesh>({
{"method", StaticMeshCuboidDimensions::getResourceConstructorName()},
{"parameters", {
{"depth", 2.f},
{"width", 2.f},
{"height", 2.f},
{"layout", mSkyboxTexture->getColorBufferDefinition().mCubemapLayout},
{"flip_texture_y", true},
}},
}));
static std::shared_ptr< TResource > ConstructAnonymousResource(const nlohmann::json &resourceDescription)
Constructs a fresh anonymous resource using a registered constructor according to its description in ...
Definition resource_database.hpp:570
static std::string getResourceTypeName()
Gets the resource type string for this object.
Definition mesh.hpp:123

Member Function Documentation

◆ createResource()

std::shared_ptr< IResource > StaticMeshCuboidDimensions::createResource ( const nlohmann::json & methodParameters)
overrideprivatevirtual

Creates a resource object using the parameters specified in methodParameters.

Parameters
methodParametersThe parameters used to construct an object via this constructor.
Returns
std::shared_ptr<IResource> A reference to the created resource.

Implements ToyMaker::IResourceConstructor.


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