A node of this type is created automatically at the root of each model file that is loaded. It may eventually contain some information about the contents of the model; at the moment, it contains no special information, but can be used as a flag to indicate the presence of a loaded model file.
This class is used to unify references to the same model.
explicit ModelRoot(std::string const &name)
Filename const &get_fullpath(void) const
int get_model_ref_count(void) const
Returns the number of copies that exist of this particular
ModelRootnode. Each time
make_copy()is called (or some other copying mechanism, such as
NodePath.copy_to(), is used), this count will increment by one in all copies; when one of the copies is destructed, this count will decrement.
ModelReference *get_reference(void) const
Returns the pointer that represents the object shared between all copies of this
ModelRoot. Since there’s not much associated with this object other than a reference count, normally there’s not much reason to get the pointer (though it may be compared pointerwise with other
time_t get_timestamp(void) const
Returns the timestamp of the file on disk that was read for this model, at the time it was read, if it is known. Returns 0 if the timestamp is not known or could not be provided. This can be used as a quick (but fallible) check to verify whether the file might have changed since the model was read.
void set_fullpath(Filename const &fullpath)
This is normally set automatically when a model is loaded, and should not be set directly by the user. If you change this on a loaded model, then
void set_reference(ModelRoot::ModelReference *ref)
void set_timestamp(time_t timestamp)
Sets the timestamp of the file on disk that was read for this model. This is normally set automatically when a model is loaded, and should not be set directly by the user.
- class ModelReference