Classes | Macros | Enumerations | Functions | Variables
boing.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <linmath.h>
Include dependency graph for boing.c:

Go to the source code of this file.

Classes

struct  vertex_t
 

Macros

#define ANIMATION_SPEED   50.f
 
#define BOING_DEBUG   0
 
#define BOUNCE_HEIGHT   (RADIUS * 2.1f)
 
#define BOUNCE_WIDTH   (RADIUS * 2.1f)
 
#define DIST_BALL   (RADIUS * 2.f + RADIUS * 0.1f)
 
#define GRID_SIZE   (RADIUS * 4.5f) /* length (width) of grid */
 
#define MAX_DELTA_T   0.02f
 
#define RADIUS   70.f
 
#define RAND_MAX   4095
 
#define SHADOW_OFFSET_X   -20.f
 
#define SHADOW_OFFSET_Y   10.f
 
#define SHADOW_OFFSET_Z   0.f
 
#define STEP_LATITUDE   22.5f
 
#define STEP_LONGITUDE   22.5f /* 22.5 makes 8 bands like original Boing */
 
#define VIEW_SCENE_DIST   (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */
 
#define WALL_L_OFFSET   0.f
 
#define WALL_R_OFFSET   5.f
 

Enumerations

enum  DRAW_BALL_ENUM { DRAW_BALL, DRAW_BALL_SHADOW }
 

Functions

void BounceBall (double dt)
 
double cos_deg (double deg)
 
void CrossProduct (vertex_t a, vertex_t b, vertex_t c, vertex_t *n)
 
void cursor_position_callback (GLFWwindow *window, double x, double y)
 
double deg2rad (double deg)
 
void display (void)
 
void DrawBoingBall (void)
 
void DrawBoingBallBand (GLfloat long_lo, GLfloat long_hi)
 
void DrawGrid (void)
 
void init (void)
 
void key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
int main (void)
 
void mouse_button_callback (GLFWwindow *window, int button, int action, int mods)
 
void reshape (GLFWwindow *window, int w, int h)
 
static void set_ball_pos (GLfloat x, GLfloat y)
 
double sin_deg (double deg)
 
GLfloat TruncateDeg (GLfloat deg)
 

Variables

GLfloat ball_x = -RADIUS
 
GLfloat ball_x_inc = 1.f
 
GLfloat ball_y = -RADIUS
 
GLfloat ball_y_inc = 2.f
 
GLfloat cursor_x = 0.f
 
GLfloat cursor_y = 0.f
 
GLfloat deg_rot_y = 0.f
 
GLfloat deg_rot_y_inc = 2.f
 
DRAW_BALL_ENUM drawBallHow
 
double dt
 
int height
 
int override_pos = GLFW_FALSE
 
double t
 
double t_old = 0.f
 
int width
 
int windowed_height
 
int windowed_width
 
int windowed_xpos
 
int windowed_ypos
 

Macro Definition Documentation

#define ANIMATION_SPEED   50.f

Definition at line 80 of file boing.c.

#define BOING_DEBUG   0

Definition at line 174 of file boing.c.

#define BOUNCE_HEIGHT   (RADIUS * 2.1f)

Definition at line 69 of file boing.c.

#define BOUNCE_WIDTH   (RADIUS * 2.1f)

Definition at line 70 of file boing.c.

#define DIST_BALL   (RADIUS * 2.f + RADIUS * 0.1f)

Definition at line 65 of file boing.c.

#define GRID_SIZE   (RADIUS * 4.5f) /* length (width) of grid */

Definition at line 68 of file boing.c.

#define MAX_DELTA_T   0.02f

Definition at line 83 of file boing.c.

#define RADIUS   70.f

Definition at line 61 of file boing.c.

#define RAND_MAX   4095

Definition at line 110 of file boing.c.

#define SHADOW_OFFSET_X   -20.f

Definition at line 72 of file boing.c.

#define SHADOW_OFFSET_Y   10.f

Definition at line 73 of file boing.c.

#define SHADOW_OFFSET_Z   0.f

Definition at line 74 of file boing.c.

#define STEP_LATITUDE   22.5f

Definition at line 63 of file boing.c.

#define STEP_LONGITUDE   22.5f /* 22.5 makes 8 bands like original Boing */

Definition at line 62 of file boing.c.

#define VIEW_SCENE_DIST   (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */

Definition at line 67 of file boing.c.

#define WALL_L_OFFSET   0.f

Definition at line 76 of file boing.c.

#define WALL_R_OFFSET   5.f

Definition at line 77 of file boing.c.

Enumeration Type Documentation

Enumerator
DRAW_BALL 
DRAW_BALL_SHADOW 

Definition at line 86 of file boing.c.

Function Documentation

void BounceBall ( double  dt)

Definition at line 384 of file boing.c.

double cos_deg ( double  deg)

Definition at line 145 of file boing.c.

void CrossProduct ( vertex_t  a,
vertex_t  b,
vertex_t  c,
vertex_t n 
)

Definition at line 155 of file boing.c.

void cursor_position_callback ( GLFWwindow window,
double  x,
double  y 
)

Definition at line 290 of file boing.c.

double deg2rad ( double  deg)

Definition at line 129 of file boing.c.

void display ( void  )

Definition at line 194 of file boing.c.

void DrawBoingBall ( void  )

Definition at line 307 of file boing.c.

void DrawBoingBallBand ( GLfloat  long_lo,
GLfloat  long_hi 
)

Definition at line 437 of file boing.c.

void DrawGrid ( void  )

Definition at line 541 of file boing.c.

void init ( void  )

Definition at line 180 of file boing.c.

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

Definition at line 238 of file boing.c.

int main ( void  )

Definition at line 622 of file boing.c.

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

Definition at line 274 of file boing.c.

void reshape ( GLFWwindow window,
int  w,
int  h 
)

Definition at line 215 of file boing.c.

static void set_ball_pos ( GLfloat  x,
GLfloat  y 
)
static

Definition at line 268 of file boing.c.

double sin_deg ( double  deg)

Definition at line 137 of file boing.c.

GLfloat TruncateDeg ( GLfloat  deg)

Definition at line 117 of file boing.c.

Variable Documentation

GLfloat ball_x = -RADIUS

Definition at line 99 of file boing.c.

GLfloat ball_x_inc = 1.f

Definition at line 101 of file boing.c.

GLfloat ball_y = -RADIUS

Definition at line 100 of file boing.c.

GLfloat ball_y_inc = 2.f

Definition at line 102 of file boing.c.

GLfloat cursor_x = 0.f

Definition at line 97 of file boing.c.

GLfloat cursor_y = 0.f

Definition at line 98 of file boing.c.

GLfloat deg_rot_y = 0.f

Definition at line 94 of file boing.c.

GLfloat deg_rot_y_inc = 2.f

Definition at line 95 of file boing.c.

DRAW_BALL_ENUM drawBallHow

Definition at line 103 of file boing.c.

double dt

Definition at line 106 of file boing.c.

int height

Definition at line 93 of file boing.c.

int override_pos = GLFW_FALSE

Definition at line 96 of file boing.c.

double t

Definition at line 104 of file boing.c.

double t_old = 0.f

Definition at line 105 of file boing.c.

int width

Definition at line 93 of file boing.c.

int windowed_height

Definition at line 92 of file boing.c.

int windowed_width

Definition at line 92 of file boing.c.

int windowed_xpos

Definition at line 92 of file boing.c.

int windowed_ypos

Definition at line 92 of file boing.c.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:24