Closed sebpouteau closed 7 years ago
Having a unique identifier makes sense, but I would do it differently:
unsigned uid
member to the PhysicalObqect
class, with no getter/setters. Ideally it should be const, but I understand that it would make the client part of your project much more painful.static unsigned uidNewObject
inside PhysicalObject.cpp
, switching to an std::atomic<unsigned>
when in the future we switch to C++11, until then just putting a comment about the lack of thread safety.PhysicalObject
, I would initialize uid
with uidNewObject++
.Hence, uid
is never uninitialized.
Hello,
During our programming with david Sherman, We had to create a remote view of a simulation.
To realize this project successfully, we were faced with a problem, which was that the objects did not have unique identification, so it was impossible for us to identify each object in the remote view.
We were therefore obliged to add an identifier to each
PhyscalObject
of the simulation.This minor modification will allow enki to add a remote view.
What do you think?