MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / SimObject

Class SimObject

Engine/source/console/simObject.h:232–973  ·  view source on GitHub ↗

Base class for objects involved in the simulation. @section simobject_intro Introduction SimObject is a base class for most of the classes you'll encounter working in Torque. It provides fundamental services allowing "smart" object referencing, creation, destruction, organization, and location. Along with SimEvent, it gives you a flexible event-scheduling system, as well as laying the foundation

Source from the content-addressed store, hash-verified

230///
231/// @nosubgrouping
232class SimObject: public ConsoleObject, public TamlCallbacks
233{
234 public:
235
236 typedef ConsoleObject Parent;
237
238 friend class SimManager;
239 friend class SimGroup;
240 friend class SimNameDictionary;
241 friend class SimManagerNameDictionary;
242 friend class SimIdDictionary;
243
244 /// @name Notification
245 /// @{
246
247 struct Notify
248 {
249 enum Type
250 {
251 ClearNotify, ///< Notified when the object is cleared.
252 DeleteNotify, ///< Notified when the object is deleted.
253 ObjectRef, ///< Cleverness to allow tracking of references.
254 Invalid ///< Mark this notification as unused (used in freeNotify).
255 } type;
256
257 void *ptr; ///< Data (typically referencing or interested object).
258 Notify *next; ///< Next notification in the linked list.
259 };
260
261 /// @}
262
263 /// Flags passed to SimObject::write
264 enum WriteFlags
265 {
266 SelectedOnly = BIT( 0 ), ///< Indicates that only objects marked as selected should be outputted. Used in SimSet.
267 NoName = BIT( 1 ), ///< Indicates that the object name should not be saved.
268 IgnoreCanSave = BIT( 2 ), ///< Write out even if CannotSave=true.
269 };
270
271 private:
272
273 /// Flags for use in mFlags
274 enum
275 {
276 Deleted = BIT( 0 ), ///< This object is marked for deletion.
277 Removed = BIT( 1 ), ///< This object has been unregistered from the object system.
278 Added = BIT( 3 ), ///< This object has been registered with the object system.
279 Selected = BIT( 4 ), ///< This object has been marked as selected. (in editor)
280 Expanded = BIT( 5 ), ///< This object has been marked as expanded. (in editor)
281 ModStaticFields = BIT( 6 ), ///< The object allows you to read/modify static fields
282 ModDynamicFields = BIT( 7 ), ///< The object allows you to read/modify dynamic fields
283 AutoDelete = BIT( 8 ), ///< Delete this object when the last ObjectRef is gone.
284 CannotSave = BIT( 9 ), ///< Object should not be saved.
285 EditorOnly = BIT( 10 ), ///< This object is for use by the editor only.
286 NoNameChange = BIT( 11 ), ///< Whether changing the name of this object is allowed.
287 Hidden = BIT( 12 ), ///< Object is hidden in editors.
288 Locked = BIT( 13 ), ///< Object is locked in editors.
289 };

Callers

nothing calls this directly

Calls 2

incRefCountMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected