Skip to content
Snippets Groups Projects
Select Git revision
  • cc0f3d5643781d85d756e81dc58e8c2440b06846
  • 5.4 default protected
  • 5.5
  • dev/5.5
  • dev/5.4
  • dev/5.3_downgrade
  • feature/experimenttime_hack
  • 5.3 protected
  • _IntenSelect5.3
  • IntenSelect5.3
  • 4.27 protected
  • 4.26 protected
  • 5.0 protected
  • 4.22 protected
  • 4.21 protected
  • UE5.4-2024.1
  • UE5.4-2024.1-rc1
  • UE5.3-2023.1-rc3
  • UE5.3-2023.1-rc2
  • UE5.3-2023.1-rc
20 results

IA_Turn.uasset

Blame
  • 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_