naev 0.11.5
nlua_vec2.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "nlua.h"
7#include "physics.h"
8
9#define VECTOR_METATABLE "vec2"
11/* Helper. */
12#define luaL_optvector(L,ind,def) nluaL_optarg(L,ind,def,luaL_checkvector)
13
14/*
15 * Vector library.
16 */
17int nlua_loadVector( nlua_env env );
18
19/*
20 * Vector operations.
21 */
22vec2* lua_tovector( lua_State *L, int ind );
23vec2* luaL_checkvector( lua_State *L, int ind );
24vec2* lua_pushvector( lua_State *L, vec2 vec );
25int lua_isvector( lua_State *L, int ind );
int nlua_loadVector(nlua_env env)
Loads the vector metatable.
Definition nlua_vec2.c:86
int lua_isvector(lua_State *L, int ind)
Checks to see if ind is a vector.
Definition nlua_vec2.c:161
vec2 * luaL_checkvector(lua_State *L, int ind)
Gets vector at index making sure type is valid.
Definition nlua_vec2.c:130
vec2 * lua_tovector(lua_State *L, int ind)
Represents a 2D vector in Lua.
Definition nlua_vec2.c:119
vec2 * lua_pushvector(lua_State *L, vec2 vec)
Pushes a vector on the stack.
Definition nlua_vec2.c:145
Represents a 2d vector.
Definition vec2.h:32