kevinmoran / gjk Goto Github PK
View Code? Open in Web Editor NEWBasic 3D collision detection implementation using the Gilbert–Johnson–Keerthi distance algorithm along with the Expanding Polytope Algorithm
License: Other
Basic 3D collision detection implementation using the Gilbert–Johnson–Keerthi distance algorithm along with the Expanding Polytope Algorithm
License: Other
Nice demo. This is the most straightforward implementation I've seen, so thanks for sharing :). I'm using it as reference for my current game engine project. Built the project on Linux with the following patch.
diff --git a/Makefile b/Makefile
index fc91c36..ad6d07b 100644
--- a/Makefile
+++ b/Makefile
@@ -59,8 +59,8 @@ else
PREBUILD = @mkdir -p $(BUILD_DIR)
endif
else
- #--- LINUX --- TODO?
- $(error ERROR: Unsupported build platform)
+ #--- LINUX ---
+ SYS_LIBS=-lGLEW -lGL -ldl -lglfw
endif
endif
diff --git a/gl_lite.h b/gl_lite.h
index dbd95d4..5c4554c 100644
--- a/gl_lite.h
+++ b/gl_lite.h
@@ -34,6 +34,8 @@
#include <OpenGL/gl3.h>
#else //LINUX & WIN32
+#include <cstdio>
+
#include <stddef.h>
//This doesn't work for some reason :/
Hi there~
Are you planing to add a license to this project so others might can use your code for their own project?
Personally I would appreciate a very liberal license like MIT :)
when the cylinder pos.y is not zero, the real collision model is higher than it should be in Y derection.
such as I set the Y as
const vec3 cylinder_pos[NUM_CYLINDERS] = {
vec3( 6, 3, 0),
vec3(-6, 0, 0),
vec3( 0, 0,-6)
};
the player capsule can get through the first Cylinder[0], but can not get through a space higher than the mesh.
Hi, nice code, I am using it as reference for my game engine. I saw same cases where the GJK implementation use a while(true) but you are limiting the number of iterations instead:
I would like to know what is the purpouse of that. Could the algorithm run forever if we use while(true)?
Thank you for your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.