Skip to content

Instantly share code, notes, and snippets.

View Klaim's full-sized avatar

Klaim (Joël Lamotte) Klaim

View GitHub Profile
#include <type_traits>
template< class ConditionType >
class Not
{
ConditionType m_condition;
public:
using this_type = Not<ConditionType>;
@Klaim
Klaim / _description.md
Last active August 29, 2015 13:59
Code Review: AnyValueSet

Code review: AnyValueSet

I am posting this to allow anyone to review this code which is part of one of my projects. As I am developping this massive thing alone, I am looking for people to help reviewing these kind of code that are fundations and I can easily isolate and publish.

The project use C++11/14 as provided by VS2013 (no CTP) and Boost. I didn't try to compile it in other compilers yet (lack of time and resources). The tests are provided in another other file, it compiles and run for me but the tests themselves

#include "spherical.hpp"
namespace netrush {
namespace zoneview {
const SphereVector SphereVector::ZERO( 0.f, Ogre::Radian( 0.f ), Ogre::Radian( 0.f ) );
const SphereVector SphereVector::UNIT_X( Ogre::Vector3::UNIT_X );
const SphereVector SphereVector::UNIT_Y( Ogre::Vector3::UNIT_Y );
const SphereVector SphereVector::UNIT_Z( Ogre::Vector3::UNIT_Z );
@Klaim
Klaim / gist:8633937
Created January 26, 2014 14:54
SphereVector current test report (with errors)
4> [----------] 8 tests from Test_SphereVector
4> [ RUN ] Test_SphereVector.assignation_comparison
4> [ OK ] Test_SphereVector.assignation_comparison (0 ms)
4> [ RUN ] Test_SphereVector.axes_to_cartesian
4> ----
4> Checking to_cartesian with SphereVector: { radius = 1, theta = Radian(0), phi = Radian(0) }
4> Induced cartesian Vector: Vector3(0, 1, 0)
4> Comparing against Vector: Vector3(0, 1, 0)
4> ----
4> Checking to_cartesian with SphereVector: { radius = 1, theta = Radian(1.5708), phi = Radian(0) }
@Klaim
Klaim / gist:8633917
Created January 26, 2014 14:53
SphereVector tests (using GTest) - to review (not everything pass)
#include <gtest/gtest.h>
#include <iostream>
#include <netrush/zoneview/spherical.hpp>
using namespace netrush::zoneview;
TEST( Test_SphereVector, assignation_comparison )
{
@Klaim
Klaim / gist:8633895
Created January 26, 2014 14:51
SphereVector work in progress - needs check
#ifndef HGUARD_NETRUSH_ZONEVIEW_SPHERICAL_HPP__
#define HGUARD_NETRUSH_ZONEVIEW_SPHERICAL_HPP__
#include <iosfwd>
#include <OgreMath.h>
#include <OgreVector3.h>
#include <OgreQuaternion.h>
#include "api.hpp"
bool orientationEquals( Quaternion a, Quaternion b)
{
a.normalize(); b.normalize();
return a.xAxis().positionEquals( b.xAxis() )
&& a.yAxis().positionEquals( b.yAxis() )
&& a.yAxis().positionEquals( b.yAxis() )
;
}