linux fixes, bugfixes, comments
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
#ifndef DEBUG_DRAW_H
|
||||
#define DEBUG_DRAW_H
|
||||
|
||||
#include <bounce\bounce.h>
|
||||
#include <bounce/bounce.h>
|
||||
#include "mat44.h"
|
||||
|
||||
struct DrawPoints;
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef MAT44_H
|
||||
#define MAT44_H
|
||||
|
||||
#include <bounce\bounce.h>
|
||||
#include <bounce/bounce.h>
|
||||
|
||||
struct Vec4
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
b3ShapeDef sdef;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
sdef.friction = 1.0f;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
@ -80,7 +80,7 @@ public:
|
||||
sdef.density = 0.5f;
|
||||
sdef.friction = 0.3f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef CLUSTER_H
|
||||
#define CLUSTER_H
|
||||
|
||||
#include <bounce\dynamics\contacts\contact_cluster.h>
|
||||
#include <bounce/dynamics/contacts/contact_cluster.h>
|
||||
|
||||
extern DebugDraw* g_debugDraw;
|
||||
extern Camera g_camera;
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef QUADRIC_H
|
||||
#define QUADRIC_H
|
||||
|
||||
#include <testbed\tests\quickhull_test.h>
|
||||
#include <testbed/tests/quickhull_test.h>
|
||||
|
||||
extern DebugDraw* g_debugDraw;
|
||||
extern Camera g_camera;
|
||||
@ -113,6 +113,19 @@ public:
|
||||
|
||||
~Quadric()
|
||||
{
|
||||
{
|
||||
b3Free(m_coneHull.vertices);
|
||||
b3Free(m_coneHull.edges);
|
||||
b3Free(m_coneHull.faces);
|
||||
b3Free(m_coneHull.planes);
|
||||
}
|
||||
|
||||
{
|
||||
b3Free(m_cylinderHull.vertices);
|
||||
b3Free(m_cylinderHull.edges);
|
||||
b3Free(m_cylinderHull.faces);
|
||||
b3Free(m_cylinderHull.planes);
|
||||
}
|
||||
}
|
||||
|
||||
static Test* Create()
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef QHULL_H
|
||||
#define QHULL_H
|
||||
|
||||
#include <bounce\quickhull\qh_hull.h>
|
||||
#include <bounce/quickhull/qh_hull.h>
|
||||
|
||||
extern DebugDraw* g_debugDraw;
|
||||
extern Camera g_camera;
|
||||
@ -48,7 +48,7 @@ struct Map
|
||||
return pair;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
b3StackArray<Pair, 256> m_pairs;
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -109,7 +109,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -129,7 +129,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -149,7 +149,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -169,7 +169,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -190,7 +190,7 @@ public:
|
||||
sdef.density = 0.0f;
|
||||
sdef.friction = 0.0f;
|
||||
sdef.shape = &hs;
|
||||
sdef.userData = nullptr;
|
||||
sdef.userData = NULL;
|
||||
|
||||
b3Shape* shape = body->CreateShape(sdef);
|
||||
}
|
||||
@ -206,35 +206,16 @@ public:
|
||||
{
|
||||
// Perform the ray cast
|
||||
RayCastListener listener;
|
||||
m_world.CastRay(&listener, p1, p2);
|
||||
|
||||
int hitId = listener.FindClosestHit();
|
||||
m_world.RayCast(&listener, p1, p2);
|
||||
|
||||
i32 hitId = listener.FindClosestHit();
|
||||
if (hitId >= 0)
|
||||
{
|
||||
// Hit
|
||||
// Replace current hit
|
||||
RayCastHit rayHit = listener.m_hits[hitId];
|
||||
|
||||
b3Shape* shape = rayHit.m_shape;
|
||||
|
||||
b3Body* bodyA = m_groundBody;
|
||||
b3Body* bodyB = shape->GetBody();
|
||||
|
||||
// Ray hit point in world space
|
||||
b3Vec3 worldPointA = rayHit.m_point;
|
||||
|
||||
// xf from world space to the local space of the shape
|
||||
b3Transform xf = shape->GetTransform();
|
||||
|
||||
// lp = xf^-1 * wp
|
||||
b3Vec3 localPointA = b3MulT(xf, worldPointA);
|
||||
|
||||
extern DebugDraw* g_debugDraw;
|
||||
|
||||
g_debugDraw->DrawSegment(p1, worldPointA, b3Color(0.0f, 1.0f, 0.0f));
|
||||
g_debugDraw->DrawPoint(worldPointA, b3Color(1.0f, 0.0f, 0.0f));
|
||||
g_debugDraw->DrawSegment(worldPointA, worldPointA + rayHit.m_normal, b3Color(1.0f, 1.0f, 1.0f));
|
||||
RayCastHit hit = listener.m_hits[hitId];
|
||||
g_debugDraw->DrawSegment(p1, hit.m_point, b3Color(0.0f, 1.0f, 0.0f));
|
||||
g_debugDraw->DrawPoint(hit.m_point, b3Color(1.0f, 0.0f, 0.0f));
|
||||
g_debugDraw->DrawSegment(hit.m_point, hit.m_point + hit.m_normal, b3Color(1.0f, 1.0f, 1.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -19,10 +19,10 @@
|
||||
#ifndef TEST_H
|
||||
#define TEST_H
|
||||
|
||||
#include <glfw\glfw3.h>
|
||||
#include <imgui\imgui.h>
|
||||
#include "..\framework\debug_draw.h"
|
||||
#include <bounce\bounce.h>
|
||||
#include <glfw/glfw3.h>
|
||||
#include <imgui/imgui.h>
|
||||
#include "../framework/debug_draw.h"
|
||||
#include <bounce/bounce.h>
|
||||
|
||||
struct Settings
|
||||
{
|
||||
@ -199,7 +199,6 @@ public:
|
||||
b3Profile m_maxProfile;
|
||||
|
||||
RayCastHit m_rayHit;
|
||||
b3Body* m_groundBody;
|
||||
b3BoxHull m_groundHull;
|
||||
b3BoxHull m_boxHull;
|
||||
b3BoxHull m_tallHull;
|
||||
|
Reference in New Issue
Block a user