mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
updated with master
This commit is contained in:
parent
3d000d3d01
commit
6f76650789
2 changed files with 11 additions and 2 deletions
|
@ -38,6 +38,8 @@ ImageEntityItem::ImageEntityItem(const EntityItemID& entityItemID) : EntityItem(
|
||||||
|
|
||||||
EntityItemProperties ImageEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
EntityItemProperties ImageEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
||||||
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
|
||||||
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(imageURL, getImageURL);
|
||||||
|
// Using "Quad" shape as defined in ShapeEntityItem.cpp
|
||||||
properties.setShape("Quad");
|
properties.setShape("Quad");
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +47,7 @@ EntityItemProperties ImageEntityItem::getProperties(EntityPropertyFlags desiredP
|
||||||
bool ImageEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool ImageEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
||||||
|
|
||||||
//SET_ENTITY_PROPERTY_FROM_PROPERTIES(shape, setShape);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(imageURL, setImageURL);
|
||||||
|
|
||||||
if (somethingChanged) {
|
if (somethingChanged) {
|
||||||
bool wantDebug = false;
|
bool wantDebug = false;
|
||||||
|
@ -63,7 +65,7 @@ bool ImageEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
// TODO: eventually only include properties changed since the params.nodeData->getLastTimeBagEmpty() time
|
// TODO: eventually only include properties changed since the params.nodeData->getLastTimeBagEmpty() time
|
||||||
EntityPropertyFlags ImageEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
|
EntityPropertyFlags ImageEntityItem::getEntityProperties(EncodeBitstreamParams& params) const {
|
||||||
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
|
EntityPropertyFlags requestedProperties = EntityItem::getEntityProperties(params);
|
||||||
|
requestedProperties += PROP_IMAGE_URL;
|
||||||
return requestedProperties;
|
return requestedProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +80,7 @@ void ImageEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
bool successPropertyFits = true;
|
bool successPropertyFits = true;
|
||||||
// Using "Quad" shape as defined in ShapeEntityItem.cpp
|
// Using "Quad" shape as defined in ShapeEntityItem.cpp
|
||||||
APPEND_ENTITY_PROPERTY(PROP_SHAPE, "Quad");
|
APPEND_ENTITY_PROPERTY(PROP_SHAPE, "Quad");
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_IMAGE_URL, _imageURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ImageEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
int ImageEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
|
@ -88,6 +91,8 @@ int ImageEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
const unsigned char* dataAt = data;
|
const unsigned char* dataAt = data;
|
||||||
|
|
||||||
|
READ_ENTITY_PROPERTY(PROP_IMAGE_URL, QString, setImageURL);
|
||||||
|
|
||||||
return bytesRead;
|
return bytesRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#define hifi_ImageEntityItem_h
|
#define hifi_ImageEntityItem_h
|
||||||
|
|
||||||
#include "EntityItem.h"
|
#include "EntityItem.h"
|
||||||
|
#include "ShapeEntityItem.h"
|
||||||
|
|
||||||
class ImageEntityItem : public EntityItem {
|
class ImageEntityItem : public EntityItem {
|
||||||
public:
|
public:
|
||||||
|
@ -49,6 +50,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
QString _imageURL;
|
QString _imageURL;
|
||||||
|
|
||||||
|
entity::Shape _shape{ entity::Shape::Quad };
|
||||||
|
ShapeType _collisionShapeType{ ShapeType::SHAPE_TYPE_BOX };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ImageEntityItem_h
|
#endif // hifi_ImageEntityItem_h
|
||||||
|
|
Loading…
Reference in a new issue