16#include "background.h"
25#define CAMERA_DIR (M_PI/2.)
35static double camera_VX = 0.;
36static double camera_VY = 0.;
265 if ((p==NULL) || !SOUND_PILOT_RELATIVE) {
272 p->solid.pos.x, p->solid.pos.y,
273 p->solid.vel.x, p->solid.vel.y );
290 double k, dx,dy, max;
297 double a = atan2( dy, dx );
321 double x,y, dx,dy, mx,my, targ_x,targ_y, bias_x,bias_y, vx,vy;
324 if (!pilot_isFlag(follow, PILOT_HYPERSPACE) && (follow->
target != follow->
id))
333 const double diag2 = 100*100;
352 if (target != NULL) {
360 dir = angle_diff( atan2(vy,vx), follow->
solid.
dir);
361 dir = (M_PI -
FABS(dir)) / M_PI;
368 if (
pow2(bias_x)+
pow2(bias_y) > diag2/2.) {
369 double a = atan2( bias_y, bias_x );
370 double r = sqrt(diag2)/2.;
416 double d, x,y, z,tz, dx, dy;
435 d = sqrt(SCREEN_W*SCREEN_H);
440 c =
MIN( SCREEN_W, SCREEN_H ) / 2;
445 znear =
MAX( znear, zfar );
451 if (pilot_isFlag( follow, PILOT_STEALTH )) {
455 if (target != NULL) {
void background_moveDust(double x, double y)
Displaces the dust, useful with camera.
void cam_getDPos(double *dx, double *dy)
Gets the camera position differential (change in last frame).
void cam_setZoom(double zoom)
Sets the camera zoom.
void cam_zoomOverride(int enable)
Overrides the zoom system.
void cam_setTargetPilot(unsigned int follow, int soft_over)
Sets the target to follow.
void cam_getVel(double *vx, double *vy)
Gets the camera velocity.
void cam_setTargetPos(double x, double y, int soft_over)
Sets the camera target to a position.
static void cam_updatePilot(Pilot *follow, double dt)
Updates a camera following a pilot.
void cam_getPos(double *x, double *y)
Gets the camera position.
double cam_getZoomTarget(void)
Gets the camera zoom.
double cam_getZoom(void)
Gets the camera zoom.
static double camera_flyspeed
static unsigned int camera_followpilot
static void cam_updateFly(double x, double y, double dt)
Updates the camera flying to a position.
void cam_setZoomTarget(double zoom, double speed)
Sets the camera zoom target.
static double camera_zoomspeed
void cam_update(double dt)
Updates the camera.
static void cam_updatePilotZoom(const Pilot *follow, const Pilot *target, double dt)
Updates the camera zoom.
int cam_getTarget(void)
Returns the camera's current target.
static void cam_updateManualZoom(double dt)
Updates the manual zoom target.
void gui_getOffset(double *x, double *y)
Gets the GUI offset.
Header file with generic functions and naev-specifics.
double nebu_getSightRadius(void)
Gets the nebula view radius.
Pilot * pilot_getTarget(Pilot *p)
Gets the target of a pilot using a fancy caching system.
Pilot * pilot_get(unsigned int id)
Pulls a pilot out of the pilot_stack based on ID.
int sound_updateListener(double dir, double px, double py, double vx, double vy)
Updates the sound listener.
The representation of an in-game pilot.