From 673a7fbade325a75a45aa574d33738498b74fa86 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 12 Dec 2014 23:53:00 +0100 Subject: [PATCH] [DEV] update ray --- ege/Environement.cpp | 2 +- ege/Ray.cpp | 7 +++++++ ege/Ray.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ege/Environement.cpp b/ege/Environement.cpp index 69da525..cc07d10 100644 --- a/ege/Environement.cpp +++ b/ege/Environement.cpp @@ -339,7 +339,7 @@ void ege::Environement::periodicCall(const ewol::event::Time& _event) { //EGE_DEBUG("stepSimulation (start)"); ///step the simulation if (m_physicEngine.getDynamicWorld() != nullptr) { - EGE_ERROR(" step simulation : " << curentDelta); + EGE_VERBOSE(" step simulation : " << curentDelta); m_physicEngine.getDynamicWorld()->stepSimulation(curentDelta); //optional but useful: debug drawing m_physicEngine.getDynamicWorld()->debugDrawWorld(); diff --git a/ege/Ray.cpp b/ege/Ray.cpp index 439a023..b06a771 100644 --- a/ege/Ray.cpp +++ b/ege/Ray.cpp @@ -84,3 +84,10 @@ std::pair, std::pair> ege::Ray::testRay } return std::pair, std::pair>(nullptr, std::pair(vec3(0,0,0),vec3(0,0,0))); } + +vec3 ege::Ray::testRayZeroPlane() { + float coef = m_origin.z() / m_direction.z(); + EGE_INFO("RAY : " << *this << " coef=" << coef); + return m_origin - coef*m_direction; +} + diff --git a/ege/Ray.h b/ege/Ray.h index bc34106..e38d2f0 100644 --- a/ege/Ray.h +++ b/ege/Ray.h @@ -70,6 +70,7 @@ namespace ege { public: std::pair testRay(ege::physics::Engine& _engine); std::pair, std::pair> testRayObject(ege::physics::Engine& _engine); + vec3 testRayZeroPlane(); }; std::ostream& operator <<(std::ostream& _os, const ege::Ray& _obj); };