Skip to content

Instantly share code, notes, and snippets.

View PaperPrototype's full-sized avatar

Abdiel Lopez PaperPrototype

  • Nytro Interactive
View GitHub Profile
@PaperPrototype
PaperPrototype / player_components.c
Last active February 7, 2021 18:38
Player "components"
struct Mesh {
int meshIndex; // the number of vertices or "size" of the mesh
float vertices[meshIndex][3]; // array of 3 dimensional floats
float normals[meshIndex][3]; // surface normals
float uvs[meshIndex][2]; // 2 dimensional floats, maps a pixel position on the texture to the corresponding vertex
int triangles[meshIndex]; // in sets of 3 gets vetices by index to make triangles bewteen the 3 vertices
}
struct BoxCollider {
@PaperPrototype
PaperPrototype / player.c
Last active February 14, 2021 16:17
player struct in C
struct Player {
float pos[3]; // array of 3 floats (aka vector3)
float rot[4]; // array of 4 floats (aka vector4, aka quaternion)
struct Mesh mesh; // if you are in third person u should see your player
struct BoxCollider collider; // collision
}