Hot answers tagged collision-detection
Just rotate the point at an angle of -θ around the center of the rectangle. relx = x-cx rely = y-cy rotx = relx*cos(-theta) - rely*sin(-theta) roty = relx*sin(-theta) + rely*cos(-theta) dx = max(abs(rotx) - width / 2, 0); dy = max(abs(roty) - height / 2, 0); return dx * dx + dy * dy; Also, remember this is still the distance squared, so you need to take ...
In my experience writing collision detection mesh-based collision (triangles versus other triangles) are the most expensive for of collision in physics engines (PhysX, Havok). Unity uses PhysX internally, so this is no different. Because each computer and platform perform differently, exact numbers cannot be provided, but generally speaking the relative ...
You have your thisMin and thisMax declarations reversed. Vector3f thisMin = new Vector3f(this.pos.x + this.w, this.pos.y + this.h, this.pos.z + this.d); Vector3f thisMax = new Vector3f(this.pos.x, this.pos.y, this.pos.z); should be: Vector3f thisMin = new Vector3f(this.pos.x, this.pos.y, this.pos.z); Vector3f thisMax = new Vector3f(this.pos.x + this.w, ...
Which version of PyGame were you using? An issue seems to have been fixed at some point between 1.9.1 and 1.9.2a concerning collide_circle() (see here for fix diff). It might be worth it to try 1.9.2a if possible (download/source here), which I believe isn't actually up on pygame.org. If you're on Linux or OS X you'll have to build 1.9.2a from source.
V-HACD V2.0 provides better decomposition results than HACD. Check it out! http://kmamou.blogspot.ca/2014/11/v-hacd-v20-is-here.html
Only top voted, non community-wiki answers of a minimum length are eligible