3D City v-1.0
Computer Graphics Project
application.cpp File Reference
#include <iostream>
#include <vector>
#include <chrono>
#include <thread>
#include "core.h"
#include "transformations.h"
#include "camera.h"
#include "engine.h"
#include "model.h"

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES
 

Functions

void key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
void processHoldEvent (GLFWwindow *window)
 
void mouse_button_callback (GLFWwindow *window, int button, int action, int mods)
 
void scroll_callback (GLFWwindow *window, double xoffset, double yoffset)
 
vec3 getCenterOfMass (const Vertex *vertices, const unsigned int size)
 
int main (int argc, char **argv)
 

Variables

mat4f translate3d
 
mat4f scale3d
 
camera cam1
 
uint32_t deltatime
 
const std::vector< vec4 > cube = {{0, 0, 0, 1}, {0, 0, 50, 1}, {0, 50, 50, 1}, {0, 50, 0, 1}, {50, 0, 0, 1}, {50, 0, 50, 1}, {50, 50, 50, 1}, {50, 50, 0, 1}}
 
const std::vector< Vertex > square = {Vertex(vec3(0, 0, 0), vec3(0, 0, 1)), Vertex(vec3(5, 0, 0), vec3(0, 0, 1)), Vertex(vec3(5, 5, 0), vec3(0, 0, 1)), Vertex(vec3(0, 5, 0), vec3(0, 0, 1))}
 
const std::vector< uint32_t > square_indices = {0, 1, 2, 0, 2, 3}
 
const std::vector< uint32_t > cube_indices = {0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7}
 
const std::vector< uint32_t > cube_indices_triangles = {0, 1, 2, 2, 3, 0, 4, 5, 6, 6, 7, 4}
 
const std::vector< vec4 > axes_endpoints
 
float zvp = 50
 
float zprp = 200
 
engine * graphicsEngine
 
int window_width
 
int window_height
 
float gameTime = 12.f
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 1 of file application.cpp.

Function Documentation

◆ getCenterOfMass()

vec3 getCenterOfMass ( const Vertex *  vertices,
const unsigned int  size 
)

Definition at line 213 of file application.cpp.

◆ key_callback()

void key_callback ( GLFWwindow *  window,
int  key,
int  scancode,
int  action,
int  mods 
)

Definition at line 43 of file application.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 221 of file application.cpp.

◆ mouse_button_callback()

void mouse_button_callback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)

Definition at line 196 of file application.cpp.

◆ processHoldEvent()

void processHoldEvent ( GLFWwindow *  window)

Definition at line 72 of file application.cpp.

◆ scroll_callback()

void scroll_callback ( GLFWwindow *  window,
double  xoffset,
double  yoffset 
)

Definition at line 207 of file application.cpp.

Variable Documentation

◆ axes_endpoints

const std::vector<vec4> axes_endpoints
Initial value:
= {
{-100, 0, 0, 1},
{100, 0, 0, 1},
{0, 100, 0, 1},
{0, -100, 0, 1},
{0, 0, 100, 1},
{0, 0, -100, 1}}

Definition at line 25 of file application.cpp.

◆ cam1

camera cam1

Definition at line 15 of file application.cpp.

◆ cube

const std::vector<vec4> cube = {{0, 0, 0, 1}, {0, 0, 50, 1}, {0, 50, 50, 1}, {0, 50, 0, 1}, {50, 0, 0, 1}, {50, 0, 50, 1}, {50, 50, 50, 1}, {50, 50, 0, 1}}

Definition at line 18 of file application.cpp.

◆ cube_indices

const std::vector<uint32_t> cube_indices = {0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7}

Definition at line 22 of file application.cpp.

◆ cube_indices_triangles

const std::vector<uint32_t> cube_indices_triangles = {0, 1, 2, 2, 3, 0, 4, 5, 6, 6, 7, 4}

Definition at line 23 of file application.cpp.

◆ deltatime

uint32_t deltatime

Definition at line 16 of file application.cpp.

◆ gameTime

float gameTime = 12.f

Definition at line 205 of file application.cpp.

◆ graphicsEngine

engine* graphicsEngine

Definition at line 41 of file application.cpp.

◆ scale3d

mat4f scale3d

Definition at line 14 of file application.cpp.

◆ square

const std::vector<Vertex> square = {Vertex(vec3(0, 0, 0), vec3(0, 0, 1)), Vertex(vec3(5, 0, 0), vec3(0, 0, 1)), Vertex(vec3(5, 5, 0), vec3(0, 0, 1)), Vertex(vec3(0, 5, 0), vec3(0, 0, 1))}

Definition at line 19 of file application.cpp.

◆ square_indices

const std::vector<uint32_t> square_indices = {0, 1, 2, 0, 2, 3}

Definition at line 20 of file application.cpp.

◆ translate3d

mat4f translate3d

Definition at line 13 of file application.cpp.

◆ window_height

int window_height

Definition at line 175 of file application.cpp.

◆ window_width

int window_width

Definition at line 175 of file application.cpp.

◆ zprp

float zprp = 200

Definition at line 33 of file application.cpp.

◆ zvp

float zvp = 50

Definition at line 33 of file application.cpp.