Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed May 14, 2020
1 parent 4f2c40b commit fcb20a8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Geometry/Ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,14 @@ void Ray::ProjectToAxis(const vec &direction, float &outMin, float &outMax) cons
}

#if defined(MATH_ENABLE_STL_SUPPORT) || defined(MATH_CONTAINERLIB_SUPPORT)
String Ray::ToString() const
StringT Ray::ToString() const
{
char str[256];
sprintf(str, "Ray(Pos:(%.2f, %.2f, %.2f) Dir:(%.3f, %.3f, %.3f))", pos.x, pos.y, pos.z, dir.x, dir.y, dir.z);
return str;
}

String Ray::SerializeToString() const
StringT Ray::SerializeToString() const
{
char str[256];
char *s = SerializeFloat(pos.x, str); *s = ','; ++s;
Expand All @@ -383,7 +383,7 @@ String Ray::SerializeToString() const
return str;
}

String Ray::SerializeToCodeString() const
StringT Ray::SerializeToCodeString() const
{
return "Ray(" + pos.SerializeToCodeString() + "," + dir.SerializeToCodeString() + ")";
}
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Quat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void Quat::Set(float x_, float y_, float z_, float w_)
void Quat::Set(const Quat &q)
{
#ifdef MATH_AUTOMATIC_SSE
v = q.v;
this->q = q.q;
#else
x = q.x;
y = q.y;
Expand All @@ -606,7 +606,7 @@ void Quat::Set(const Quat &q)
void Quat::Set(const float4 &vec)
{
#ifdef MATH_AUTOMATIC_SSE
v = vec.v;
q = vec.v;
#else
x = vec.x;
y = vec.y;
Expand Down
1 change: 1 addition & 0 deletions src/Math/grisu3_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
http://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf */

#include "grisu3.h"
#include "../MathBuildConfig.h"
#ifdef MATH_ENABLE_STL_SUPPORT
#include <string>
#include <assert.h>
Expand Down
4 changes: 2 additions & 2 deletions src/MathBuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// features requiring STL are disabled (but the library can still be built).
// Due to large increase in code size, when building for HTML5 platform, do not automatically
// enable STL support
#if !defined(MATH_ENABLE_STL_SUPPORT) && !defined(__EMSCRIPTEN__)
#if !defined(MATH_ENABLE_STL_SUPPORT) && !defined(MATH_DISABLE_STL_SUPPORT)
#define MATH_ENABLE_STL_SUPPORT
#endif

Expand Down Expand Up @@ -126,7 +126,7 @@
// If MATH_COLMAJOR_MATRICES is defined, matrices use a column-major memory layout. If undefined, matrices
// use a row-major memory layout.
#ifndef MATH_COLMAJOR_MATRICES
#define MATH_COLMAJOR_MATRICES
// #define MATH_COLMAJOR_MATRICES
#endif

#if defined(MATH_USE_DIRECT3D) && defined(MATH_USE_OPENGL)
Expand Down
6 changes: 3 additions & 3 deletions tests/KdTreeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ UNIQUE_TEST(KdTree_SingleTriangle_AABBQuery)
// Build the tree
KdTree<Triangle> tree;

Triangle triangle(float3::zero, float3::unitX, float3::unitY);
Triangle triangle(POINT_VEC_SCALAR(0.f), POINT_VEC(1.f, 0.f, 0.f), POINT_VEC(0.f, 1.f, 0.f));

tree.AddObjects(&triangle, 1);
tree.Build();

// Query
AABB bbox(float3::one * -10, float3::one * 10);
AABB bbox(POINT_VEC_SCALAR(-10.f), POINT_VEC_SCALAR(10.f));

bool intersected = false;
auto callback = [&](const KdTree<Triangle>& tree, const KdTreeNode& leaf, const AABB& aabb)
auto callback = [&](const KdTree<Triangle>& tree, const KdTreeNode& leaf, const AABB& /*aabb*/)
{
auto bucket = tree.Bucket(leaf.bucketIndex);
auto triangle = tree.Object(*bucket);
Expand Down

0 comments on commit fcb20a8

Please sign in to comment.