[Java 3D Physics] from scratch - Level(Mesh Collider) vs Player(Sphere Collider) Collision Detection

preview_player
Показать описание
It took a long time, but i think this is one of those important parts that was missing and was preventing me from progressing in the development of a 3d game from scratch and i'm very happy that it's finally starting to work :D !

Now it just needs an optimization, i tried to implement the octree spacial partition but unfortunately it didn't work, so i'll leave it for a next opportunity xD

Controls:
'Up' arrow key: move forward
'Down' arrow key: move back
'Left' arrow key: rotate left
'Right' arrow key: rotate right
'A' key: strafe left
'D' key: strafe right

References:

Other references:
Рекомендации по теме
Комментарии
Автор

Hi Leo, another sample of your creativity!! Well done and very interesting. Every video = lot of thing to learn!

Thepantino
Автор

Hi Leo! This is such a cool demo! I have been reading your code to learn, and there's one thing that I wanted to ask you. In this method for closing a face:

public void close() {
Vec3 v1 = new Vec3(points.get(0));
v1.sub(points.get(1));
Vec3 v2 = new Vec3(points.get(2));
v2.sub(points.get(1));
normal.set(v1);
normal.cross(v2);
normal.normalize();

for (int i = 0; i < points.size(); i++) {
Vec3 a = points.get(i);
Vec3 b = points.get((i + 1) % points.size());
Edge edge = new Edge(this, a, b);
edges.add(edge);
//System.out.println("edge: " + edge);
}
}

If points 0, 1 and 2 are specified in counter-clockwise order, won't the normal point inwards?

The only way for it to point outwards is if they are specified in clockwise order, but you are reading those values from the .obj file, so they are in counter-clockwise order, right?

Thank you for sharing your knowledge on this topic!

rockclimbermaca
Автор

Caraca! muito maneiro, leo! Tu tá fazendo algum tipo de partition space pra diminuir o número de teste de colisão ? parabéns, cara! ficou irado!

brunoandradebr
Автор

Awesome example! Leo, can you do a tutorial on this? I am sure it will help many of us trying to learn to make this :)

dapoint
Автор

awesome! are you working up to a full game with this?

ImmortalityYT
Автор

ono leo i think you need to make an operating system

matttherat