15#include "nlua_camera.h"
19#include "nlua_pilot.h"
99 else if ( lua_isnoneornil( L, 1 ) ) {
102 vec = &
player.p->solid.pos;
105 NLUA_INVALID_PARAMETER( L, 1 );
106 hard_over = !lua_toboolean( L, 2 );
109 d = MOD( vec->
x - x, vec->
y - y );
112 speed = luaL_optinteger( L, 3,
MIN( 2000.,
d ) );
117 else if ( vec != NULL )
134 lua_pushnumber( L, x );
135 lua_pushnumber( L, y );
151 vec2_cset( &v, x, y );
173 double zoom = luaL_optnumber( L, 1, -1. );
174 int hard_over = lua_toboolean( L, 2 );
175 double speed = luaL_optnumber( L, 3, conf.zoom_speed );
204 lua_pushnumber( L, 1.0 / conf.zoom_far );
205 lua_pushnumber( L, 1.0 / conf.zoom_near );
220 double amplitude = luaL_optnumber( L, 1, 1. );
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_setTargetPos(double x, double y, int soft_over)
Sets the camera target to a position.
void cam_getPos(double *x, double *y)
Gets the camera position.
double cam_getZoom(void)
Gets the camera zoom.
void cam_setZoomTarget(double zoom, double speed)
Sets the camera zoom target.
Header file with generic functions and naev-specifics.
static int camL_get(lua_State *L)
Gets the x/y position and zoom of the camera.
static int camL_shake(lua_State *L)
Makes the camera shake.
static int camL_pos(lua_State *L)
Gets the camera position.
static int camL_getZoom(lua_State *L)
Gets the camera zoom.
static const luaL_Reg cameraL_methods[]
int nlua_loadCamera(nlua_env env)
Loads the camera library.
static int camL_setZoom(lua_State *L)
Sets the camera zoom.
static int camL_set(lua_State *L)
Lua bindings to interact with the Camera.
LuaPilot lua_topilot(lua_State *L, int ind)
Lua bindings to interact with pilots.
int lua_ispilot(lua_State *L, int ind)
Checks to see if ind is a pilot.
int lua_isvector(lua_State *L, int ind)
Checks to see if ind is a vector.
vec2 * lua_tovector(lua_State *L, int ind)
Represents a 2D vector in Lua.
vec2 * lua_pushvector(lua_State *L, vec2 vec)
Pushes a vector on the stack.
Pilot * pilot_get(unsigned int id)
Pulls a pilot out of the pilot_stack based on ID.
void spfx_shake(double mod)
Increases the current rumble level.
The representation of an in-game pilot.