Overte C++ Documentation
AvatarActionFarGrab.h
1 //
2 // AvatarActionFarGrab.h
3 // interface/src/avatar/
4 //
5 // Created by Seth Alves 2017-4-14
6 // Copyright 2017 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_AvatarActionFarGrab_h
13 #define hifi_AvatarActionFarGrab_h
14 
15 #include <EntityItem.h>
16 #include <ObjectActionTractor.h>
17 
18 /*@jsdoc
19  * The <code>"far-grab"</code> {@link Entities.ActionType|ActionType} moves and rotates an entity to a target position and
20  * orientation, optionally relative to another entity. Collisions between the entity and the user's avatar are disabled during
21  * the far-grab.
22  * It has arguments in addition to the common {@link Entities.ActionArguments|ActionArguments}:
23  *
24  * @typedef {object} Entities.ActionArguments-FarGrab
25  * @property {Uuid} otherID=null - If an entity ID, the <code>targetPosition</code> and <code>targetRotation</code> are
26  * relative to the entity's position and rotation.
27  * @property {Uuid} otherJointIndex=null - If a joint index in the <code>otherID</code> entity, the <code>targetPosition</code>
28  * and <code>targetRotation</code> are relative to the entity joint's position and rotation.
29  * @property {Vec3} targetPosition=0,0,0 - The target position.
30  * @property {Quat} targetRotation=0,0,0,1 - The target rotation.
31  * @property {number} linearTimeScale=3.4e+38 - Controls how long it takes for the entity's position to catch up with the
32  * target position. The value is the time for the action to catch up to 1/e = 0.368 of the target value, where the action
33  * is applied using an exponential decay.
34  * @property {number} angularTimeScale=3.4e+38 - Controls how long it takes for the entity's orientation to catch up with the
35  * target orientation. The value is the time for the action to catch up to 1/e = 0.368 of the target value, where the
36  * action is applied using an exponential decay.
37  */
38 // The properties are per ObjectActionTractor.
39 class AvatarActionFarGrab : public ObjectActionTractor {
40 public:
41  AvatarActionFarGrab(const QUuid& id, EntityItemPointer ownerEntity);
42  virtual ~AvatarActionFarGrab();
43 
44  QByteArray serialize() const override;
45  virtual void deserialize(QByteArray serializedArguments) override;
46 };
47 
48 #endif // hifi_AvatarActionFarGrab_h