Overte C++ Documentation
EntityItem Class Reference

#include <EntityItem.h>

Inherits QObject, SpatiallyNestable, and ReadWriteLockable.

Inherited by GizmoEntityItem, GridEntityItem, ImageEntityItem, LightEntityItem, LineEntityItem, MaterialEntityItem, ModelEntityItem, ParticleEffectEntityItem, PolyLineEntityItem, PolyVoxEntityItem, ShapeEntityItem, TextEntityItem, WebEntityItem, and ZoneEntityItem.

Public Member Functions

virtual bool setProperties (const EntityItemProperties &properties)
 returns true if something changed
 
void setLastSimulated (quint64 now)
 Last simulated time of this entity universal usecs.
 
quint64 getLastEdited () const
 Last edited time of this entity universal usecs.
 
float getEditedAgo () const
 Elapsed seconds since this entity was last edited.
 
quint64 getLastBroadcast () const
 Last time we sent out an edit packet for this entity.
 
virtual glm::vec3 getScaledDimensions () const
 Dimensions in meters (0.0 - TREE_SCALE)
 
void setGravity (const glm::vec3 &value)
 get gravity in meters
 
bool hasGravity () const
 gravity in meters
 
void setAcceleration (const glm::vec3 &value)
 get acceleration in meters/second/second
 
bool hasAcceleration () const
 acceleration in meters/second/second
 
void setLifetime (float value)
 get the lifetime in seconds for the entity
 
quint64 getCreated () const
 set the lifetime in seconds for the entity
 
void setCreated (quint64 value)
 get the created-time in useconds for the entity
 
bool isImmortal () const
 set the created-time in useconds for the entity More...
 
bool isMortal () const
 is this entity mortal, in that it has a lifetime set, and will automatically be deleted when that lifetime expires
 
float getAge () const
 age of this entity in seconds
 
virtual AACube getMaximumAACube (bool &success) const override
 
AACube getMinimumAACube (bool &success) const
 
virtual void setRegistrationPoint (const glm::vec3 &value)
 registration point as ratio of entity More...
 
virtual ShapeType getShapeType () const
 return preferred shape type (actual physical shape may differ)
 
bool shouldPreloadScript () const
 

Protected Attributes

QString _loadedScript
 the value of the script property
 
quint64 _scriptTimestamp { ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP }
 the value of _script when the last preload signal was sent
 
bool _scriptPreloadFinished { false }
 the script loaded property used for forced reload
 
quint64 _serverScriptsChangedTimestamp { ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP }
 keep track of time when _serverScripts property was last changed
 
quint64 _loadedScriptTimestamp { ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP + 1 }
 the value of _scriptTimestamp when the last preload signal was sent
 
entity::HostType _hostType { entity::HostType::DOMAIN }
 the server node UUID we came from
 

Detailed Description

EntityItem class this is the base class for all entity types. It handles the basic properties and functionality available to all other entity types. In particular: postion, size, rotation, age, lifetime, velocity, gravity. You can not instantiate one directly, instead you must only construct one of it's derived classes with additional features.

Member Function Documentation

◆ getMaximumAACube()

AACube EntityItem::getMaximumAACube ( bool &  success) const
overridevirtual

The maximum bounding cube for the entity, independent of it's rotation. This accounts for the registration point (upon which rotation occurs around).

◆ getMinimumAACube()

AACube EntityItem::getMinimumAACube ( bool &  success) const

The minimum bounding cube for the entity accounting for it's rotation. This accounts for the registration point (upon which rotation occurs around).

◆ isImmortal()

bool EntityItem::isImmortal ( ) const
inline

set the created-time in useconds for the entity

is this entity immortal, in that it has no lifetime set, and will exist until manually deleted

◆ setRegistrationPoint()

void EntityItem::setRegistrationPoint ( const glm::vec3 &  value)
virtual

registration point as ratio of entity

registration point as ratio of entity

◆ shouldPreloadScript()

bool EntityItem::shouldPreloadScript ( ) const

Should the external entity script mechanism call a preload for this entity. Due to the asyncronous nature of signals for add entity and script changing it's possible for two similar signals to cross paths. This method allows the entity to definitively state if the preload signal should be sent.

We only want to preload if: there is some script, and either the script value or the scriptTimestamp value have changed since our last preload


The documentation for this class was generated from the following files: