Skip to content
Snippets Groups Projects
Commit c1abeac4 authored by Christian Mattes's avatar Christian Mattes
Browse files

Renamed FootElevation to FeetElevation to be more consistent with FeetPlacer

parent 25d2da36
Branches
Tags
No related merge requests found
#include "FootElevation.hh" #include "FeetElevation.hh"
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtx/transform.hpp> #include <glm/gtx/transform.hpp>
#include <lava/common/log.hh> #include <lava/common/log.hh>
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
namespace lava { namespace lava {
namespace vr { namespace vr {
FootElevation::Tri::Tri(glm::vec3 _a, glm::vec3 _b, glm::vec3 _c) FeetElevation::Tri::Tri(glm::vec3 _a, glm::vec3 _b, glm::vec3 _c)
: a(_a), b(_b), c(_c) { : a(_a), b(_b), c(_c) {
// bbmin = glm::min(a, glm::min(b, c)); // bbmin = glm::min(a, glm::min(b, c));
// bbmax = glm::max(a, glm::min(b, c)); // bbmax = glm::max(a, glm::min(b, c));
} }
FootElevation::Tri transform(FootElevation::Tri const &orig, FeetElevation::Tri transform(FeetElevation::Tri const &orig,
glm::mat4 const &xf) { glm::mat4 const &xf) {
const auto nt = glm::mat3x4(xf); const auto nt = glm::mat3x4(xf);
const auto t = xf[3]; const auto t = xf[3];
return FootElevation::Tri(nt * orig.a + t, // return FeetElevation::Tri(nt * orig.a + t, //
nt * orig.b + t, // nt * orig.b + t, //
nt * orig.c + t); nt * orig.c + t);
} }
FootElevation::FootElevation( FeetElevation::FeetElevation(
const VRMesh &mesh, const VRMesh &mesh,
std::array<lava::openvr::OpenVRController *, 2> feet) std::array<lava::openvr::OpenVRController *, 2> feet)
: mFeet(feet) { : mFeet(feet) {
...@@ -60,7 +60,7 @@ glm::vec3 bary(glm::vec2 p, glm::vec2 a, glm::vec2 b, glm::vec2 c) { ...@@ -60,7 +60,7 @@ glm::vec3 bary(glm::vec2 p, glm::vec2 a, glm::vec2 b, glm::vec2 c) {
glm::vec2 projy(glm::vec3 const &x) { return {x.x, x.z}; } glm::vec2 projy(glm::vec3 const &x) { return {x.x, x.z}; }
glm::mat4 FootElevation::apply(glm::mat4 oldMatrix) { glm::mat4 FeetElevation::apply(glm::mat4 oldMatrix) {
std::array<glm::vec3, 2> feet = {{{mFeet[0]->pose()[3]}, // std::array<glm::vec3, 2> feet = {{{mFeet[0]->pose()[3]}, //
{mFeet[1]->pose()[3]}}}; {mFeet[1]->pose()[3]}}};
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
namespace lava { namespace lava {
namespace vr { namespace vr {
class FootElevation { class FeetElevation {
public: public:
FootElevation(VRMesh const &mesh, FeetElevation(VRMesh const &mesh,
std::array<openvr::OpenVRController *, 2> feet); std::array<openvr::OpenVRController *, 2> feet);
/// set the distance of the tracker from the floor when it's attached to a /// set the distance of the tracker from the floor when it's attached to a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment