Overte C++ Documentation
Transition.h
1 //
2 // Transition.h
3 
4 // Created by Olivier Prat on 07/07/2017.
5 // Copyright 2017 High Fidelity, Inc.
6 //
7 // Distributed under the Apache License, Version 2.0.
8 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
9 //
10 
11 #ifndef hifi_render_Transition_h
12 #define hifi_render_Transition_h
13 
14 #include "Item.h"
15 
16 namespace render {
17 
18  // This holds the current state for all transition event types applied to a render item
19  class Transition {
20  public:
21 
22  enum Type {
23  ELEMENT_ENTER_DOMAIN = 0,
24  ELEMENT_LEAVE_DOMAIN,
25  BUBBLE_ISECT_OWNER,
26  BUBBLE_ISECT_TRESPASSER,
27  USER_ENTER_DOMAIN,
28  USER_LEAVE_DOMAIN,
29  AVATAR_CHANGE,
30 
31  // Don't forget to modify Fade.slh to reflect the change in number of categories
32  TYPE_COUNT,
33  NONE = TYPE_COUNT
34  };
35 
36  Type eventType{ ELEMENT_ENTER_DOMAIN };
37  ItemID itemId{ Item::INVALID_ITEM_ID };
38  ItemID boundItemId{ Item::INVALID_ITEM_ID };
39  double time{ 0.0 };
40  glm::vec3 noiseOffset{ 0.f, 0.f, 0.f };
41  glm::vec3 baseOffset{ 0.f, 0.f, 0.f };
42  glm::vec3 baseInvSize{ 1.f, 1.f, 1.f };
43  float threshold{ 0.f };
44  uint8_t isFinished{ 0 };
45 
46  mutable gpu::BufferView paramsBuffer;
47  };
48 
49  typedef std::shared_ptr<Transition> TransitionPointer;
50  typedef std::vector<Transition::Type> TransitionTypes;
51 }
52 
53 #endif // hifi_render_Transition_h