9 #ifndef hifi_ShapeEntityItem_h
10 #define hifi_ShapeEntityItem_h
12 #include "EntityItem.h"
14 #include "PulsePropertyGroup.h"
35 Shape shapeFromString(const ::QString& shapeString);
36 QString stringFromShape(Shape shape);
40 using Pointer = std::shared_ptr<ShapeEntityItem>;
47 using ShapeInfoCalculator = std::function<void(
const ShapeEntityItem *
const shapeEntity, ShapeInfo& info)>;
48 static void setShapeInfoCalulator(ShapeInfoCalculator callback);
52 void pureVirtualFunctionPlaceHolder()
override { };
57 EntityItemProperties getProperties(
const EntityPropertyFlags& desiredProperties,
bool allowEmptyDesiredProperties)
const override;
60 EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params)
const override;
62 void appendSubclassData(
OctreePacketData* packetData, EncodeBitstreamParams& params,
63 EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
64 EntityPropertyFlags& requestedProperties,
65 EntityPropertyFlags& propertyFlags,
66 EntityPropertyFlags& propertiesDidntFit,
68 OctreeElement::AppendState& appendState)
const override;
70 int readEntitySubclassDataFromBuffer(
const unsigned char* data,
int bytesLeftToRead,
71 ReadBitstreamToTreeParams& args,
72 EntityPropertyFlags& propertyFlags,
bool overwriteLocalData,
73 bool& somethingChanged)
override;
75 entity::Shape getShape()
const;
76 void setShape(
const entity::Shape& shape);
77 void setShape(
const QString& shape) { setShape(entity::shapeFromString(shape)); }
79 float getAlpha()
const;
80 void setAlpha(
float alpha);
82 glm::u8vec3 getColor()
const;
83 void setColor(
const glm::u8vec3& value);
85 void setUnscaledDimensions(
const glm::vec3& value)
override;
87 bool supportsDetailedIntersection()
const override;
88 bool findDetailedRayIntersection(
const glm::vec3& origin,
const glm::vec3& direction,
89 const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
90 float& distance, BoxFace& face, glm::vec3& surfaceNormal,
91 QVariantMap& extraInfo,
bool precisionPicking)
const override;
92 bool findDetailedParabolaIntersection(
const glm::vec3& origin,
const glm::vec3& velocity,
93 const glm::vec3& acceleration,
const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
94 float& parabolicDistance, BoxFace& face, glm::vec3& surfaceNormal,
95 QVariantMap& extraInfo,
bool precisionPicking)
const override;
96 bool getRotateForPicking()
const override;
98 void debugDump()
const override;
100 virtual void computeShapeInfo(ShapeInfo& info)
override;
101 virtual ShapeType getShapeType()
const override;
103 PulsePropertyGroup getPulseProperties()
const;
105 void setUserData(
const QString& value)
override;
109 float _alpha { 1.0f };
110 PulsePropertyGroup _pulseProperties;
111 entity::Shape _shape { entity::Shape::Sphere };
116 ShapeType _collisionShapeType { ShapeType::SHAPE_TYPE_ELLIPSOID };
Definition: EntityItem.h:82
Abstract ID for editing model items. Used in EntityItem JS API.
Definition: EntityItemID.h:28
Definition: EntityItemProperties.h:106
Handles packing of the data portion of PacketType_OCTREE_DATA messages.
Definition: OctreePacketData.h:93