Plasma Engine  2.0
Loading...
Searching...
No Matches
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/XR/XRInputDevice.h>
7#include <GameEngine/XR/XRInterface.h>
8
10{
11 using StorageType = plUInt8;
12 enum Enum : plUInt8
13 {
14 Grip,
15 Aim,
16 Default = Grip,
17 };
18};
19PL_DECLARE_REFLECTABLE_TYPE(PL_GAMEENGINE_DLL, plXRPoseLocation);
20
22
23
25
27class PL_GAMEENGINE_DLL plDeviceTrackingComponent : public plComponent
28{
30
31public:
34
36 void SetDeviceType(plEnum<plXRDeviceType> type);
37 plEnum<plXRDeviceType> GetDeviceType() const;
38
39 void SetPoseLocation(plEnum<plXRPoseLocation> poseLocation);
40 plEnum<plXRPoseLocation> GetPoseLocation() const;
41
43 void SetTransformSpace(plEnum<plXRTransformSpace> space);
44 plEnum<plXRTransformSpace> GetTransformSpace() const;
45
46 //
47 // plComponent Interface
48 //
49
50protected:
51 virtual void SerializeComponent(plWorldWriter& stream) const override;
52 virtual void DeserializeComponent(plWorldReader& stream) override;
53
54protected:
55 void Update();
56
57 plEnum<plXRDeviceType> m_DeviceType;
58 plEnum<plXRPoseLocation> m_PoseLocation;
60 bool m_bRotation = true;
61 bool m_bScale = true;
62};
Base class of all component types.
Definition Component.h:25
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
Tracks the position of a XR device and applies it to the owner.
Definition DeviceTrackingComponent.h:28
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition DeviceTrackingComponent.h:10