mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-09 21:18:16 +02:00
fixing derived classes to use new EntityItem API
remove 'forceCopy' argument in EntityItem::setProperties()
This commit is contained in:
parent
28381a3b70
commit
b03e6c53e1
12 changed files with 23 additions and 23 deletions
|
@ -34,9 +34,9 @@ RenderableModelEntityItem::~RenderableModelEntityItem() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderableModelEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool RenderableModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
QString oldModelURL = getModelURL();
|
QString oldModelURL = getModelURL();
|
||||||
bool somethingChanged = ModelEntityItem::setProperties(properties, forceCopy);
|
bool somethingChanged = ModelEntityItem::setProperties(properties);
|
||||||
if (somethingChanged && oldModelURL != getModelURL()) {
|
if (somethingChanged && oldModelURL != getModelURL()) {
|
||||||
_needsModelReload = true;
|
_needsModelReload = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
virtual ~RenderableModelEntityItem();
|
virtual ~RenderableModelEntityItem();
|
||||||
|
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
ReadBitstreamToTreeParams& args,
|
ReadBitstreamToTreeParams& args,
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData);
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData);
|
||||||
|
|
|
@ -29,7 +29,7 @@ BoxEntityItem::BoxEntityItem(const EntityItemID& entityItemID, const EntityItemP
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Box;
|
_type = EntityTypes::Box;
|
||||||
_created = properties.getCreated();
|
_created = properties.getCreated();
|
||||||
setProperties(properties, true);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemProperties BoxEntityItem::getProperties() const {
|
EntityItemProperties BoxEntityItem::getProperties() const {
|
||||||
|
@ -44,9 +44,9 @@ EntityItemProperties BoxEntityItem::getProperties() const {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BoxEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool BoxEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties, forceCopy); // set the properties in our base class
|
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
|
|
||||||
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||||
|
|
|
@ -41,7 +41,7 @@ LightEntityItem::LightEntityItem(const EntityItemID& entityItemID, const EntityI
|
||||||
_exponent = 0.0f;
|
_exponent = 0.0f;
|
||||||
_cutoff = PI;
|
_cutoff = PI;
|
||||||
|
|
||||||
setProperties(properties, true);
|
setProperties(properties);
|
||||||
|
|
||||||
// a light is not collide-able so we make it's shape be a tiny sphere at origin
|
// a light is not collide-able so we make it's shape be a tiny sphere at origin
|
||||||
_emptyShape.setTranslation(glm::vec3(0.0f, 0.0f, 0.0f));
|
_emptyShape.setTranslation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
@ -71,8 +71,8 @@ EntityItemProperties LightEntityItem::getProperties() const {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LightEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool LightEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties, forceCopy); // set the properties in our base class
|
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(isSpotlight, setIsSpotlight);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(isSpotlight, setIsSpotlight);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(diffuseColor, setDiffuseColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(diffuseColor, setDiffuseColor);
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID, const EntityI
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID, properties)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Model;
|
_type = EntityTypes::Model;
|
||||||
setProperties(properties, true);
|
setProperties(properties);
|
||||||
_lastAnimated = usecTimestampNow();
|
_lastAnimated = usecTimestampNow();
|
||||||
_jointMappingCompleted = false;
|
_jointMappingCompleted = false;
|
||||||
_color[0] = _color[1] = _color[2] = 0;
|
_color[0] = _color[1] = _color[2] = 0;
|
||||||
|
@ -55,9 +55,9 @@ EntityItemProperties ModelEntityItem::getProperties() const {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties, forceCopy); // set the properties in our base class
|
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
|
|
||||||
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||||
|
|
|
@ -31,7 +31,7 @@ SphereEntityItem::SphereEntityItem(const EntityItemID& entityItemID, const Entit
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID, properties)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Sphere;
|
_type = EntityTypes::Sphere;
|
||||||
setProperties(properties, true);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemProperties SphereEntityItem::getProperties() const {
|
EntityItemProperties SphereEntityItem::getProperties() const {
|
||||||
|
@ -40,8 +40,8 @@ EntityItemProperties SphereEntityItem::getProperties() const {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SphereEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool SphereEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties, forceCopy); // set the properties in our base class
|
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ TextEntityItem::TextEntityItem(const EntityItemID& entityItemID, const EntityIte
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Text;
|
_type = EntityTypes::Text;
|
||||||
_created = properties.getCreated();
|
_created = properties.getCreated();
|
||||||
setProperties(properties, true);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEntityItem::setDimensions(const glm::vec3& value) {
|
void TextEntityItem::setDimensions(const glm::vec3& value) {
|
||||||
|
@ -57,9 +57,9 @@ EntityItemProperties TextEntityItem::getProperties() const {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEntityItem::setProperties(const EntityItemProperties& properties, bool forceCopy) {
|
bool TextEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties, forceCopy); // set the properties in our base class
|
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(text, setText);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(text, setText);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lineHeight, setLineHeight);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lineHeight, setLineHeight);
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties() const;
|
virtual EntityItemProperties getProperties() const;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties, bool forceCopy = false);
|
virtual bool setProperties(const EntityItemProperties& properties);
|
||||||
|
|
||||||
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
// TODO: eventually only include properties changed since the params.lastViewFrustumSent time
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||||
|
|
Loading…
Reference in a new issue