openGPMP
Open Source Mathematics Package
Public Member Functions | Private Attributes | List of all members
Camera Class Reference

Public Member Functions

 Camera ()
 
double getX ()
 
double getY ()
 
double getZ ()
 
void moveRight ()
 
void moveLeft ()
 
void moveUp ()
 
void moveDown ()
 

Private Attributes

double theta
 
double y
 
double dTheta
 
double dy
 

Detailed Description

Definition at line 19 of file openGL_bounce.c.

Constructor & Destructor Documentation

◆ Camera()

Camera::Camera ( )
inline

Definition at line 26 of file openGL_bounce.c.

26  : theta(0), y(3), dTheta(0.04), dy(0.2) {
27  }
double dy
Definition: openGL_bounce.c:23
double y
Definition: openGL_bounce.c:21
double theta
Definition: openGL_bounce.c:20
double dTheta
Definition: openGL_bounce.c:22

Member Function Documentation

◆ getX()

double Camera::getX ( )
inline

Definition at line 29 of file openGL_bounce.c.

29  {
30  return 10 * cos(theta);
31  }

References theta.

Referenced by display().

◆ getY()

double Camera::getY ( )
inline

Definition at line 33 of file openGL_bounce.c.

33  {
34  return y;
35  }

References y.

Referenced by display().

◆ getZ()

double Camera::getZ ( )
inline

Definition at line 37 of file openGL_bounce.c.

37  {
38  return 10 * sin(theta);
39  }

References theta.

Referenced by display().

◆ moveDown()

void Camera::moveDown ( )
inline

Definition at line 53 of file openGL_bounce.c.

53  {
54  if (y > dy)
55  y -= dy;
56  }

References dy, and y.

Referenced by special().

◆ moveLeft()

void Camera::moveLeft ( )
inline

Definition at line 45 of file openGL_bounce.c.

45  {
46  theta -= dTheta;
47  }

References dTheta, and theta.

Referenced by special().

◆ moveRight()

void Camera::moveRight ( )
inline

Definition at line 41 of file openGL_bounce.c.

41  {
42  theta += dTheta;
43  }

References dTheta, and theta.

Referenced by special().

◆ moveUp()

void Camera::moveUp ( )
inline

Definition at line 49 of file openGL_bounce.c.

49  {
50  y += dy;
51  }

References dy, and y.

Referenced by special().

Member Data Documentation

◆ dTheta

double Camera::dTheta
private

Definition at line 22 of file openGL_bounce.c.

Referenced by moveLeft(), and moveRight().

◆ dy

double Camera::dy
private

Definition at line 23 of file openGL_bounce.c.

Referenced by moveDown(), and moveUp().

◆ theta

double Camera::theta
private

Definition at line 20 of file openGL_bounce.c.

Referenced by getX(), getZ(), moveLeft(), and moveRight().

◆ y

double Camera::y
private

Definition at line 21 of file openGL_bounce.c.

Referenced by getY(), moveDown(), and moveUp().


The documentation for this class was generated from the following file: