Select Git revision
IA_Turn.uasset
rotation_helper.hpp 2.45 KiB
//------------------------------------------------------------------------------
// Project Phoenix
//
// Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualization Group.
//------------------------------------------------------------------------------
// License
//
// Licensed under the 3-Clause BSD License (the "License");
// you may not use this file except in compliance with the License.
// See the file LICENSE for the full text.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//------------------------------------------------------------------------------
#ifndef OPTICAL_BENCH_ROTATION_HELPER_HPP_
#define OPTICAL_BENCH_ROTATION_HELPER_HPP_
#include "object_support_rod.hpp"
#include <optixu/optixpp_namespace.h>
#include <optixu/optixu_math_stream_namespace.h>
#include <iostream>
#include "phx/suppress_warnings.hpp"
SUPPRESS_WARNINGS_BEGIN
#include "glm/glm.hpp"
SUPPRESS_WARNINGS_END
#include "phx/core/entity.hpp"
#include "phx/core/scene.hpp"
#include "phx/rendering/components/transform.hpp"
class RotationHelper {
public:
RotationHelper(phx::Scene* scene);
~RotationHelper();
void SetParent(phx::Transform* parent);
phx::Entity* GetParent() { return parent_->GetEntity(); }
bool SelectablePartOf(phx::Entity* o);
private:
phx::Entity* horizontal_disk_;
phx::Entity* vertical_disk_;
phx::Entity* horizontal_rod_;
phx::Entity* vertical_rod_;
phx::Entity* horizontal_rod_ball_;
phx::Entity* vertical_rod_ball_;
phx::Entity* vertical_text_;
phx::Entity* horizontal_text_;
phx::Entity* root_;
phx::Transform* parent_;
glm::vec3 vertical_rod_ball_color_;
glm::vec3 horizontal_rod_ball_color_;
bool vertical_rod_ball_grabbed_ = false;
bool vertical_rod_ball_hovered_ = false;
bool horizontal_rod_ball_grabbed_ = false;
bool horizontal_rod_ball_hovered_ = false;
float angle_horizontal_ = 0;
float angle_vertical_ = 0;
phx::Entity* LoadAndInsertMesh(phx::Scene* scene, std::string file,
std::string name);
};
#endif // OPTICAL_BENCH_ROTATION_HELPER_HPP_