mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Unified identifyer mechanism (tested and confirmed to produce unique
integer < MAX_INT)
This commit is contained in:
@@ -19,15 +19,12 @@
|
||||
#include <ctime>
|
||||
#include <algorithm>
|
||||
|
||||
int Node::node_counter = 0;
|
||||
|
||||
// Node
|
||||
Node::Node() : initialized_(false), visible_(true), refcount_(0)
|
||||
{
|
||||
// create unique id
|
||||
id_ = ++node_counter;
|
||||
// auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
|
||||
// id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 100000000;
|
||||
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
|
||||
id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 1000000000;
|
||||
|
||||
transform_ = glm::identity<glm::mat4>();
|
||||
scale_ = glm::vec3(1.f);
|
||||
|
||||
Reference in New Issue
Block a user