14 #ifndef hifi_GrabPropertyGroup_h
15 #define hifi_GrabPropertyGroup_h
19 #include <glm/glm.hpp>
21 #include "PropertyGroup.h"
22 #include "EntityItemPropertiesMacros.h"
25 class EncodeBitstreamParams;
27 class ReadBitstreamToTreeParams;
30 static const bool INITIAL_GRABBABLE {
true };
31 static const bool INITIAL_KINEMATIC {
true };
32 static const bool INITIAL_FOLLOWS_CONTROLLER {
true };
33 static const bool INITIAL_TRIGGERABLE {
false };
34 static const bool INITIAL_EQUIPPABLE {
false };
35 static const bool INITIAL_GRAB_DELEGATE_TO_PARENT {
true };
36 static const glm::vec3 INITIAL_LEFT_EQUIPPABLE_POSITION { glm::vec3(0.0f) };
37 static const glm::quat INITIAL_LEFT_EQUIPPABLE_ROTATION { glm::quat() };
38 static const glm::vec3 INITIAL_RIGHT_EQUIPPABLE_POSITION { glm::vec3(0.0f) };
39 static const glm::quat INITIAL_RIGHT_EQUIPPABLE_ROTATION { glm::quat() };
40 static const glm::vec3 INITIAL_EQUIPPABLE_INDICATOR_SCALE { glm::vec3(1.0f) };
41 static const glm::vec3 INITIAL_EQUIPPABLE_INDICATOR_OFFSET { glm::vec3(0.0f) };
73 class GrabPropertyGroup :
public PropertyGroup {
76 virtual void copyToScriptValue(
const EntityPropertyFlags& desiredProperties,
ScriptValue& properties,
79 bool isMyOwnAvatarEntity)
const override;
80 virtual void copyFromScriptValue(
const ScriptValue&
object,
const QSet<QString> &namesSet,
bool& _defaultSettings)
override;
82 void merge(
const GrabPropertyGroup& other);
84 virtual void debugDump()
const override;
85 virtual void listChangedProperties(QList<QString>& out)
override;
88 EntityPropertyFlags& requestedProperties,
89 EntityPropertyFlags& propertyFlags,
90 EntityPropertyFlags& propertiesDidntFit,
92 OctreeElement::AppendState& appendState)
const override;
94 virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags,
95 const unsigned char*& dataAt,
int& processedBytes)
override;
96 virtual void markAllChanged()
override;
97 virtual EntityPropertyFlags getChangedProperties()
const override;
106 virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params)
const override;
108 virtual void appendSubclassData(
OctreePacketData* packetData, EncodeBitstreamParams& params,
109 EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
110 EntityPropertyFlags& requestedProperties,
111 EntityPropertyFlags& propertyFlags,
112 EntityPropertyFlags& propertiesDidntFit,
114 OctreeElement::AppendState& appendState)
const override;
116 virtual int readEntitySubclassDataFromBuffer(
const unsigned char* data,
int bytesLeftToRead,
117 ReadBitstreamToTreeParams& args,
118 EntityPropertyFlags& propertyFlags,
bool overwriteLocalData,
119 bool& somethingChanged)
override;
122 DEFINE_PROPERTY(PROP_GRAB_GRABBABLE, Grabbable, grabbable,
bool, INITIAL_GRABBABLE);
123 DEFINE_PROPERTY(PROP_GRAB_KINEMATIC, GrabKinematic, grabKinematic,
bool, INITIAL_KINEMATIC);
124 DEFINE_PROPERTY(PROP_GRAB_FOLLOWS_CONTROLLER, GrabFollowsController, grabFollowsController,
bool,
125 INITIAL_FOLLOWS_CONTROLLER);
126 DEFINE_PROPERTY(PROP_GRAB_TRIGGERABLE, Triggerable, triggerable,
bool, INITIAL_TRIGGERABLE);
127 DEFINE_PROPERTY(PROP_GRAB_EQUIPPABLE, Equippable, equippable,
bool, INITIAL_EQUIPPABLE);
128 DEFINE_PROPERTY(PROP_GRAB_DELEGATE_TO_PARENT, GrabDelegateToParent, grabDelegateToParent,
bool,
129 INITIAL_GRAB_DELEGATE_TO_PARENT);
130 DEFINE_PROPERTY_REF(PROP_GRAB_LEFT_EQUIPPABLE_POSITION_OFFSET, EquippableLeftPosition, equippableLeftPosition,
131 glm::vec3, INITIAL_LEFT_EQUIPPABLE_POSITION);
132 DEFINE_PROPERTY_REF(PROP_GRAB_LEFT_EQUIPPABLE_ROTATION_OFFSET, EquippableLeftRotation, equippableLeftRotation,
133 glm::quat, INITIAL_LEFT_EQUIPPABLE_ROTATION);
134 DEFINE_PROPERTY_REF(PROP_GRAB_RIGHT_EQUIPPABLE_POSITION_OFFSET, EquippableRightPosition, equippableRightPosition,
135 glm::vec3, INITIAL_RIGHT_EQUIPPABLE_POSITION);
136 DEFINE_PROPERTY_REF(PROP_GRAB_RIGHT_EQUIPPABLE_ROTATION_OFFSET, EquippableRightRotation, equippableRightRotation,
137 glm::quat, INITIAL_RIGHT_EQUIPPABLE_ROTATION);
138 DEFINE_PROPERTY_REF(PROP_GRAB_EQUIPPABLE_INDICATOR_URL, EquippableIndicatorURL, equippableIndicatorURL, QString,
"");
139 DEFINE_PROPERTY_REF(PROP_GRAB_EQUIPPABLE_INDICATOR_SCALE, EquippableIndicatorScale, equippableIndicatorScale,
140 glm::vec3, INITIAL_EQUIPPABLE_INDICATOR_SCALE);
141 DEFINE_PROPERTY_REF(PROP_GRAB_EQUIPPABLE_INDICATOR_OFFSET, EquippableIndicatorOffset, equippableIndicatorOffset,
142 glm::vec3, INITIAL_EQUIPPABLE_INDICATOR_OFFSET);
Definition: EntityItemProperties.h:106
Handles packing of the data portion of PacketType_OCTREE_DATA messages.
Definition: OctreePacketData.h:93
Provides an engine-independent interface for a scripting engine.
Definition: ScriptEngine.h:93
[ScriptInterface] Provides an engine-independent interface for QScriptValue
Definition: ScriptValue.h:40