Centralizing and unifying the generator of object identifiers.

This commit is contained in:
brunoherbelin
2020-10-03 14:05:28 +02:00
parent 61e5c046c0
commit f32b85a656
12 changed files with 44 additions and 19 deletions

View File

@@ -15,16 +15,13 @@
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/random.hpp>
#include <chrono>
#include <ctime>
#include <algorithm>
// Node
Node::Node() : initialized_(false), visible_(true), refcount_(0)
{
// create unique id
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 100000000;
id_ = GlmToolkit::uniqueId();
transform_ = glm::identity<glm::mat4>();
scale_ = glm::vec3(1.f);