From 92b75d29cff1d340366c6aec6c0428b9cbc3ecd7 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 30 Jul 2014 14:18:55 -0700 Subject: [PATCH] Added referentials base class --- libraries/avatars/src/Referential.cpp | 18 +++++++++++++ libraries/avatars/src/Referential.h | 38 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 libraries/avatars/src/Referential.cpp create mode 100644 libraries/avatars/src/Referential.h diff --git a/libraries/avatars/src/Referential.cpp b/libraries/avatars/src/Referential.cpp new file mode 100644 index 0000000000..c929e2701f --- /dev/null +++ b/libraries/avatars/src/Referential.cpp @@ -0,0 +1,18 @@ +// +// Referential.cpp +// +// +// Created by Clement on 7/30/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "Referential.h" + +Referential::Referential(AvatarData* avatar) : + _isValid(true), + _avatar(avatar) +{ +} diff --git a/libraries/avatars/src/Referential.h b/libraries/avatars/src/Referential.h new file mode 100644 index 0000000000..d125819edc --- /dev/null +++ b/libraries/avatars/src/Referential.h @@ -0,0 +1,38 @@ +// +// Referential.h +// +// +// Created by Clement on 7/30/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_Referential_h +#define hifi_Referential_h + +#include "AvatarData.h" + +class Referential { +public: + virtual bool isValid() { return _isValid; } + virtual void update() = 0; + +protected: + Referential(AvatarData* avatar); + + bool _isValid; + AvatarData* _avatar; + + glm::vec3 _refPosition; + glm::quat _refRotation; + float _refScale; + + glm::vec3 _translation; + glm::quat _rotation; + float _scale; +}; + + +#endif // hifi_Referential_h \ No newline at end of file