MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / Model

Method Model

src/Scene/Model.cpp:9–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <utility>
8
9Model::Model(std::string name, std::vector<glm::vec3> verts, std::vector<glm::vec2> uvs, std::vector<glm::vec3> norms, std::vector<unsigned int> indices, bool removeVertexIndexing, glm::vec3 center_position) {
10 m_name = std::move(name);
11 m_uvs = std::move(uvs);
12 m_vertex_indices = std::move(indices);
13 m_normals = std::move(norms);
14
15 if (removeVertexIndexing) {
16 for (unsigned int m_vertex_index : m_vertex_indices) {
17 m_vertices.push_back(verts[m_vertex_index]);
18 }
19 } else {
20 m_vertices = std::move(verts);
21 }
22
23 position = center_position;
24 initialPosition = center_position;
25 orientation_vec = glm::vec3(0,0,0);
26 orientation = glm::normalize(glm::quat(orientation_vec));
27}
28
29void Model::enable() {
30 enabled = true;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected