This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| this code take as reference the algorithm SAT (Separated Axis Theorem) and tries to solve the problem of concave collisions. | |
| This algorithm i call it SEP (Shadow Edge Projection) as the name says, it uses the edges and compares them with other | |
| edges by casting a shadow defined by the normal and if the edge is inside the shadow it means that it is probably | |
| inside the shape. | |
| */ | |
| mod math { | |
| pub type Vec2 = [f32; 2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| /* | |
| C does not support OOP by default but it can be emulated obtaining | |
| similar results to other programming languages such as C++ or Rust. | |
| In this example I will emulate the Traits of Rust and the concepts | |
| used in this code are "vtable" and "virtual function" | |
| */ |