Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Model Class Reference

#include <Model.hpp>

Public Member Functions

 Model ()
 
Modeloperator+= (const Model &m)
 
bool IsSame (const Model &other) const
 Compare two models.
 
const std::set< AABB > & GetColliders () const
 
void SetColliders (const std::set< AABB > &colliders_)
 
const std::vector< FaceDescriptor > & GetFaces () const
 
std::vector< FaceDescriptor > & GetFaces ()
 

Static Public Member Functions

static const ModelGetModel (const std::string &filepath, const bool custom)
 
static Model GetModel (const double height, const std::string &texture)
 
static void ClearCache ()
 

Private Member Functions

 Model (const std::string &filepath, const bool custom)
 
 Model (const double height, const std::string &texture)
 

Private Attributes

bool ambient_occlusion
 
std::map< std::string, std::string > textures_variables
 
std::map< std::string, std::pair< int, int > > textures_base_size
 
std::vector< FaceDescriptorfaces
 
std::set< AABBcolliders
 

Static Private Attributes

static std::unordered_map< std::string, Modelcached_models
 

Friends

Model operator+ (Model m1, const Model &m2)
 

Detailed Description

Definition at line 37 of file Model.hpp.

Constructor & Destructor Documentation

◆ Model() [1/3]

◆ Model() [2/3]

Botcraft::Model::Model ( const double  height,
const std::string &  texture 
)
private

◆ Model() [3/3]

Botcraft::Model::Model ( )

Definition at line 16 of file Model.cpp.

References ambient_occlusion.

Referenced by GetModel(), and GetModel().

Member Function Documentation

◆ ClearCache()

void Botcraft::Model::ClearCache ( )
static

Definition at line 595 of file Model.cpp.

References cached_models.

Referenced by Botcraft::AssetsManager::ClearCaches().

◆ GetColliders()

const std::set< AABB > & Botcraft::Model::GetColliders ( ) const

Definition at line 585 of file Model.cpp.

References colliders.

Referenced by Botcraft::Blockstate::GetCollidersAtPos(), and Botcraft::ModelModificationFromJson().

◆ GetFaces() [1/2]

std::vector< FaceDescriptor > & Botcraft::Model::GetFaces ( )

Definition at line 606 of file Model.cpp.

References faces.

◆ GetFaces() [2/2]

const std::vector< FaceDescriptor > & Botcraft::Model::GetFaces ( ) const

◆ GetModel() [1/2]

Model Botcraft::Model::GetModel ( const double  height,
const std::string &  texture 
)
static

Definition at line 34 of file Model.cpp.

References Model().

◆ GetModel() [2/2]

const Model & Botcraft::Model::GetModel ( const std::string &  filepath,
const bool  custom 
)
static

◆ IsSame()

bool Botcraft::Model::IsSame ( const Model other) const

Compare two models.

Will never return true if compiled with GUI

Parameters
otherModel to compare to
Returns
True if both models are the same, false otherwise

Definition at line 574 of file Model.cpp.

References colliders.

Referenced by Botcraft::Blockstate::GetUniqueModelIndex().

◆ operator+=()

Model & Botcraft::Model::operator+= ( const Model m)

Definition at line 564 of file Model.cpp.

References ambient_occlusion, colliders, and faces.

◆ SetColliders()

void Botcraft::Model::SetColliders ( const std::set< AABB > &  colliders_)

Definition at line 590 of file Model.cpp.

References colliders.

Referenced by Botcraft::ModelModificationFromJson().

Friends And Related Symbol Documentation

◆ operator+

Model operator+ ( Model  m1,
const Model m2 
)
friend

Definition at line 53 of file Model.hpp.

Member Data Documentation

◆ ambient_occlusion

bool Botcraft::Model::ambient_occlusion
private

Definition at line 77 of file Model.hpp.

Referenced by Model(), Model(), Model(), and operator+=().

◆ cached_models

std::unordered_map< std::string, Model > Botcraft::Model::cached_models
staticprivate

Definition at line 74 of file Model.hpp.

Referenced by ClearCache(), and GetModel().

◆ colliders

std::set<AABB> Botcraft::Model::colliders
private

Definition at line 84 of file Model.hpp.

Referenced by GetColliders(), IsSame(), Model(), Model(), operator+=(), and SetColliders().

◆ faces

std::vector<FaceDescriptor> Botcraft::Model::faces
private

Definition at line 82 of file Model.hpp.

Referenced by GetFaces(), GetFaces(), Model(), Model(), and operator+=().

◆ textures_base_size

std::map<std::string, std::pair<int, int> > Botcraft::Model::textures_base_size
private

Definition at line 79 of file Model.hpp.

Referenced by Model().

◆ textures_variables

std::map<std::string, std::string> Botcraft::Model::textures_variables
private

Definition at line 78 of file Model.hpp.

Referenced by Model().


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