mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 14:09:01 +02:00
Merge pull request #5353 from AndrewMeadows/beryllium
cleanup of EntityItem ctors and friends
This commit is contained in:
commit
7accc53c0e
13 changed files with 13 additions and 20 deletions
|
@ -29,7 +29,6 @@ BoxEntityItem::BoxEntityItem(const EntityItemID& entityItemID, const EntityItemP
|
||||||
EntityItem(entityItemID)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Box;
|
_type = EntityTypes::Box;
|
||||||
_created = properties.getCreated();
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,7 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) :
|
||||||
_lastEditedFromRemoteInRemoteTime(0),
|
_lastEditedFromRemoteInRemoteTime(0),
|
||||||
_created(UNKNOWN_CREATED_TIME),
|
_created(UNKNOWN_CREATED_TIME),
|
||||||
_changedOnServer(0),
|
_changedOnServer(0),
|
||||||
_transform(ENTITY_ITEM_DEFAULT_ROTATION,
|
_transform(),
|
||||||
ENTITY_ITEM_DEFAULT_DIMENSIONS,
|
|
||||||
ENTITY_ITEM_DEFAULT_POSITION),
|
|
||||||
_glowLevel(ENTITY_ITEM_DEFAULT_GLOW_LEVEL),
|
_glowLevel(ENTITY_ITEM_DEFAULT_GLOW_LEVEL),
|
||||||
_localRenderAlpha(ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA),
|
_localRenderAlpha(ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA),
|
||||||
_density(ENTITY_ITEM_DEFAULT_DENSITY),
|
_density(ENTITY_ITEM_DEFAULT_DENSITY),
|
||||||
|
@ -80,16 +78,15 @@ EntityItem::EntityItem(const EntityItemID& entityItemID) :
|
||||||
_physicsInfo(nullptr),
|
_physicsInfo(nullptr),
|
||||||
_simulated(false)
|
_simulated(false)
|
||||||
{
|
{
|
||||||
|
// explicitly set transform parts to set dirty flags used by batch rendering
|
||||||
|
_transform.setTranslation(ENTITY_ITEM_DEFAULT_POSITION);
|
||||||
|
_transform.setRotation(ENTITY_ITEM_DEFAULT_ROTATION);
|
||||||
|
_transform.setScale(ENTITY_ITEM_DEFAULT_DIMENSIONS);
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
_lastSimulated = now;
|
_lastSimulated = now;
|
||||||
_lastUpdated = now;
|
_lastUpdated = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItem::EntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : EntityItem(entityItemID)
|
|
||||||
{
|
|
||||||
setProperties(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityItem::~EntityItem() {
|
EntityItem::~EntityItem() {
|
||||||
// clear out any left-over actions
|
// clear out any left-over actions
|
||||||
EntityTree* entityTree = _element ? _element->getTree() : nullptr;
|
EntityTree* entityTree = _element ? _element->getTree() : nullptr;
|
||||||
|
|
|
@ -119,7 +119,6 @@ public:
|
||||||
DONT_ALLOW_INSTANTIATION // This class can not be instantiated directly
|
DONT_ALLOW_INSTANTIATION // This class can not be instantiated directly
|
||||||
|
|
||||||
EntityItem(const EntityItemID& entityItemID);
|
EntityItem(const EntityItemID& entityItemID);
|
||||||
EntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties);
|
|
||||||
virtual ~EntityItem();
|
virtual ~EntityItem();
|
||||||
|
|
||||||
// ID and EntityItemID related methods
|
// ID and EntityItemID related methods
|
||||||
|
|
|
@ -772,6 +772,9 @@ int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int
|
||||||
entityItemID = entityItem->getEntityItemID();
|
entityItemID = entityItem->getEntityItemID();
|
||||||
_myTree->setContainingElement(entityItemID, this);
|
_myTree->setContainingElement(entityItemID, this);
|
||||||
_myTree->postAddEntity(entityItem);
|
_myTree->postAddEntity(entityItem);
|
||||||
|
if (entityItem->getCreated() == UNKNOWN_CREATED_TIME) {
|
||||||
|
entityItem->recordCreationTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Move the buffer forward to read more entities
|
// Move the buffer forward to read more entities
|
||||||
|
|
|
@ -29,7 +29,7 @@ EntityItemPointer LightEntityItem::factory(const EntityItemID& entityID, const E
|
||||||
|
|
||||||
// our non-pure virtual subclass for now...
|
// our non-pure virtual subclass for now...
|
||||||
LightEntityItem::LightEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
LightEntityItem::LightEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Light;
|
_type = EntityTypes::Light;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ LineEntityItem::LineEntityItem(const EntityItemID& entityItemID, const EntityIte
|
||||||
_points(QVector<glm::vec3>(0))
|
_points(QVector<glm::vec3>(0))
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Line;
|
_type = EntityTypes::Line;
|
||||||
_created = properties.getCreated();
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ EntityItemPointer ModelEntityItem::factory(const EntityItemID& entityID, const E
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Model;
|
_type = EntityTypes::Model;
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
|
|
|
@ -61,7 +61,7 @@ EntityItemPointer ParticleEffectEntityItem::factory(const EntityItemID& entityID
|
||||||
|
|
||||||
// our non-pure virtual subclass for now...
|
// our non-pure virtual subclass for now...
|
||||||
ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||||
EntityItem(entityItemID, properties),
|
EntityItem(entityItemID),
|
||||||
_maxParticles(DEFAULT_MAX_PARTICLES),
|
_maxParticles(DEFAULT_MAX_PARTICLES),
|
||||||
_lifespan(DEFAULT_LIFESPAN),
|
_lifespan(DEFAULT_LIFESPAN),
|
||||||
_emitRate(DEFAULT_EMIT_RATE),
|
_emitRate(DEFAULT_EMIT_RATE),
|
||||||
|
|
|
@ -57,7 +57,6 @@ PolyVoxEntityItem::PolyVoxEntityItem(const EntityItemID& entityItemID, const Ent
|
||||||
_voxelSurfaceStyle(PolyVoxEntityItem::DEFAULT_VOXEL_SURFACE_STYLE)
|
_voxelSurfaceStyle(PolyVoxEntityItem::DEFAULT_VOXEL_SURFACE_STYLE)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::PolyVox;
|
_type = EntityTypes::PolyVox;
|
||||||
_created = properties.getCreated();
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ EntityItemPointer SphereEntityItem::factory(const EntityItemID& entityID, const
|
||||||
|
|
||||||
// our non-pure virtual subclass for now...
|
// our non-pure virtual subclass for now...
|
||||||
SphereEntityItem::SphereEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
SphereEntityItem::SphereEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Sphere;
|
_type = EntityTypes::Sphere;
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
|
|
|
@ -37,7 +37,6 @@ TextEntityItem::TextEntityItem(const EntityItemID& entityItemID, const EntityIte
|
||||||
EntityItem(entityItemID)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Text;
|
_type = EntityTypes::Text;
|
||||||
_created = properties.getCreated();
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ WebEntityItem::WebEntityItem(const EntityItemID& entityItemID, const EntityItemP
|
||||||
EntityItem(entityItemID)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Web;
|
_type = EntityTypes::Web;
|
||||||
_created = properties.getCreated();
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,4 +148,4 @@ void WebEntityItem::setSourceUrl(const QString& value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString& WebEntityItem::getSourceUrl() const { return _sourceUrl; }
|
const QString& WebEntityItem::getSourceUrl() const { return _sourceUrl; }
|
||||||
|
|
|
@ -37,7 +37,6 @@ ZoneEntityItem::ZoneEntityItem(const EntityItemID& entityItemID, const EntityIte
|
||||||
EntityItem(entityItemID)
|
EntityItem(entityItemID)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Zone;
|
_type = EntityTypes::Zone;
|
||||||
_created = properties.getCreated();
|
|
||||||
|
|
||||||
_keyLightColor[RED_INDEX] = DEFAULT_KEYLIGHT_COLOR.red;
|
_keyLightColor[RED_INDEX] = DEFAULT_KEYLIGHT_COLOR.red;
|
||||||
_keyLightColor[GREEN_INDEX] = DEFAULT_KEYLIGHT_COLOR.green;
|
_keyLightColor[GREEN_INDEX] = DEFAULT_KEYLIGHT_COLOR.green;
|
||||||
|
|
Loading…
Reference in a new issue