flCamera.c File Reference

#include "flGlobal.h"
#include <stdio.h>
#include <psprtc.h>
#include <pspkernel.h>
#include <pspgu.h>
#include <pspgum.h>

Go to the source code of this file.

Functions

void camViewCalc (Camera *inCam)
CameracamCreate ()
 Create a valid initialized Camera struct.
void camFree (Camera *inCam)
 Free a camera struct from memory.
void camReset (Camera *inCam)
 Reset the camera to its home position.
void camView (Camera *inCam)
 Set the view matrix to the cameras view.
void camMove (Camera *inCam, vect3f inMove)
 Move a Camera relative to it's current position.
void camMoveTo (Camera *inCam, vect3f inTarget)
 Move a Camera to a specific location.
void camMoveForward (Camera *inCam, float inSize)
 Move a Camera forward in the direction it is pointing in.
void camMoveStrafe (Camera *inCam, float inSize)
 Move a Camera horizontally with respect to the direction it is pointing.


Function Documentation

Camera* camCreate (  ) 

Create a valid initialized Camera struct.

Returns:
An initialized Camera struct.
See also:
camFree()
Note:
This uses memAlloc() internally so it needs to be free'd using camFree() when finished.

Definition at line 44 of file flCamera.c.

References camReset(), debugWarning, memAlloc, and NULL.

void camFree ( Camera inCam  ) 

Free a camera struct from memory.

Parameters:
inCam The camera struct to be free'd.
See also:
camCreate()
Note:
This uses memFree() internally.

Definition at line 56 of file flCamera.c.

References memFree.

void camMove ( Camera inCam,
vect3f  inMove 
)

Move a Camera relative to it's current position.

Parameters:
inCam The Camera to be moved.
inMove A vector representing the amount to be moved in each dimension relative to it's current position.

Definition at line 85 of file flCamera.c.

References Camera::camPos, and vect3f_Add.

Referenced by camMoveForward(), camMoveStrafe(), and camMoveTo().

void camMoveForward ( Camera inCam,
float  inSize 
)

Move a Camera forward in the direction it is pointing in.

Parameters:
inCam The Camera to be moved.
inSize The amount the camera should be moved forward.

Definition at line 98 of file flCamera.c.

References camMove(), Camera::camView, and camViewCalc().

void camMoveStrafe ( Camera inCam,
float  inSize 
)

Move a Camera horizontally with respect to the direction it is pointing.

Parameters:
inCam The Camera to be moved.
inSize The amount the camera should be strafed right by.
Warning:
There is an error in this function which means it may not strafe correctly when the cameras roll isn't default.

Definition at line 109 of file flCamera.c.

References camMove(), Camera::camRot, camViewCalc(), mathCosf(), and mathSinf().

void camMoveTo ( Camera inCam,
vect3f  inTarget 
)

Move a Camera to a specific location.

Parameters:
inCam The Camera to be moved.
inTarget A vector representing the destination that the Camera will be moved to.

Definition at line 91 of file flCamera.c.

References camMove(), Camera::camPos, and vect3f_Sub.

void camReset ( Camera inCam  ) 

Reset the camera to its home position.

Parameters:
inCam The Camera to be reset.
See also:
camCreate()
Note:
This resets the camera so that it looks down the Y axis with Z being up, as does camCreate().

Definition at line 64 of file flCamera.c.

References Camera::camPos, Camera::camRot, Camera::camUp, and Camera::camView.

Referenced by camCreate().

void camView ( Camera inCam  ) 

Set the view matrix to the cameras view.

Parameters:
inCam The Camera to be viewed.
Note:
This should be called every frame that the camera is in use.

Definition at line 71 of file flCamera.c.

References Camera::camPos, Camera::camUp, Camera::camView, camViewCalc(), and vect3f_Add.

void camViewCalc ( Camera inCam  ) 

Definition at line 19 of file flCamera.c.

References Camera::camRot, Camera::camUp, Camera::camView, MATH_PI, mathCosf(), and mathSinf().

Referenced by camMoveForward(), camMoveStrafe(), and camView().


Generated on Wed Sep 5 19:04:01 2007 for funcLib by  doxygen 1.5.1