akosgarai / go_opengl_playground

learn glfw & gl
3 stars 1 forks source link

Implement 3d collision detection #77

Closed akosgarai closed 4 years ago

akosgarai commented 4 years ago

https://learnopengl.com/In-Practice/2D-Game/Collisions/Collision-detection

Also an example application needs to be implemented as POC. The house application could be a base of this.

akosgarai commented 4 years ago

Other interesting tutorial: https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_collision_detection

akosgarai commented 4 years ago

Currently, the meshes only stores the vertices, indices, center point, etc. But i haven't got information about the object itself. It makes the collusion detection hard. To be able to handle this, i will define bouncing objects, that could be used for collision detection.

akosgarai commented 4 years ago

I have written an application for supporting the collision detection.

akosgarai commented 4 years ago

First collision detection that i should implement: between the camera and a ground / grass whatever floor. The ground in general a textured rectangle. It has to contain a bounding box. The center point of the box is the center point of the plane. The size is plane's size, except the height. It has to be an acceptable small number. The camera could be represented with a sphere.

akosgarai commented 4 years ago

I think, i should implement #98 first. Now the camera movement is handled in the update function in the applications. It makes the collision detection difficult. I have to put it in the application before doing the hard part of the detections.

akosgarai commented 4 years ago

Next steps for the implementation:

akosgarai commented 4 years ago

The POC is done. The camera movement is tested against the other meshes. The movement is skipped if it leads collision.