ezEngine  Milestone 9
DeviceTrackingComponent.h
1 #pragma once
2 
3 #include <Core/World/Component.h>
4 #include <Core/World/World.h>
5 #include <GameEngine/GameEngineDLL.h>
6 #include <GameEngine/Interfaces/VRInterface.h>
7 
9 {
10  typedef ezUInt8 StorageType;
11  enum Enum : ezUInt8
12  {
15  Default = Local,
16  };
17 };
19 
21 
23 
25 class EZ_GAMEENGINE_DLL ezDeviceTrackingComponent : public ezComponent
26 {
28 
29 public:
32 
34  void SetDeviceType(ezEnum<ezVRDeviceType> type);
35  ezEnum<ezVRDeviceType> GetDeviceType() const;
36 
38  void SetTransformSpace(ezEnum<ezVRTransformSpace> space);
39  ezEnum<ezVRTransformSpace> GetTransformSpace() const;
40 
41  //
42  // ezComponent Interface
43  //
44 
45 protected:
46  virtual void SerializeComponent(ezWorldWriter& stream) const override;
47  virtual void DeserializeComponent(ezWorldReader& stream) override;
48 
49 protected:
50  void Update();
51 
52  ezEnum<ezVRDeviceType> m_deviceType;
54 };
55 
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition: WorldReader.h:12
Enum
Definition: DeviceTrackingComponent.h:11
Definition: DeviceTrackingComponent.h:8
Base class of all component types.
Definition: Component.h:19
virtual void DeserializeComponent(ezWorldReader &stream)
Override this to load the current state of the component from the given stream.
Definition: Component.cpp:71
virtual void SerializeComponent(ezWorldWriter &stream) const
Override this to save the current state of the component to the given stream.
Definition: Component.cpp:69
Sets the local transform to the pose in stage space. Use if owner is direct child of ezStageSpaceComp...
Definition: DeviceTrackingComponent.h:13
Simple component manager implementation that calls an update method on all components every frame...
Definition: ComponentManager.h:134
Tracks the position of a VR device and applies it to the owner.
Definition: DeviceTrackingComponent.h:25
#define EZ_DECLARE_REFLECTABLE_TYPE(Linkage, TYPE)
Declares a type to be statically reflectable. Insert this into the header of a type to enable reflect...
Definition: StaticRTTI.h:123
Uses the global transform of the device in world space.
Definition: DeviceTrackingComponent.h:14
Stores an entire ezWorld in a stream.
Definition: WorldWriter.h:15