Download code/validation/C++/0049079_Model.cpp from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 973 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/code/validation/C%2B%2B/0049079_Model.cpp
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/code/validation/C++/0049079_Model.cpp
-
curl -L -o 0049079_Model.cpp https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/code/validation/C%2B%2B/0049079_Model.cpp
973 Bytes
| Model::Geometry::Geometry() | |
| : flags(0) | |
| { | |
| } | |
| Model::Geometry::~Geometry() | |
| { | |
| } | |
| ModelFrame::ModelFrame(unsigned int index, ModelFrame* parent, glm::mat3 dR, glm::vec3 dT) | |
| : index(index), defaultRotation(dR), defaultTranslation(dT), parentFrame(parent) | |
| { | |
| if(parent != nullptr) { | |
| parent->childs.push_back(this); | |
| } | |
| reset(); | |
| } | |
| void ModelFrame::reset() | |
| { | |
| matrix = glm::translate(glm::mat4(), defaultTranslation) * glm::mat4(defaultRotation); | |
| } | |
| void ModelFrame::addGeometry(size_t idx) | |
| { | |
| geometries.push_back(idx); | |
| } | |
| Model::~Model() | |
| { | |
| for(auto mf : frames) { | |
| delete mf; | |
| } | |
| } | |
| void Model::recalculateMetrics() | |
| { | |
| boundingRadius = std::numeric_limits<float>::min(); | |
| for (size_t g = 0; g < geometries.size(); g++) | |
| { | |
| RW::BSGeometryBounds& bounds = geometries[g]->geometryBounds; | |
| boundingRadius = std::max(boundingRadius, glm::length(bounds.center) + bounds.radius); | |
| } | |
| } | |