1 | // Copyright (C) 2012-2015 ChaosForge Ltd
|
---|
2 | // http://chaosforge.org/
|
---|
3 | //
|
---|
4 | // This file is part of Nova libraries.
|
---|
5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
6 |
|
---|
7 | #include "nv/lua/lua_math.hh"
|
---|
8 |
|
---|
9 | #include "nv/lua/lua_raw.hh"
|
---|
10 | #include "nv/lua/lua_aux.hh"
|
---|
11 | #include "nv/stl/type_traits/common.hh"
|
---|
12 |
|
---|
13 | static size_t nlua_swizzel_lookup[256];
|
---|
14 |
|
---|
15 | using nv::lua::detail::is_vec;
|
---|
16 | using nv::lua::detail::to_vec;
|
---|
17 | using nv::lua::detail::to_pvec;
|
---|
18 | using nv::lua::detail::push_vec;
|
---|
19 |
|
---|
20 | inline bool nlua_is_swizzel( const unsigned char* str, size_t max )
|
---|
21 | {
|
---|
22 | while (*str)
|
---|
23 | {
|
---|
24 | if (nlua_swizzel_lookup[*str] > max) return false;
|
---|
25 | str++;
|
---|
26 | }
|
---|
27 | return true;
|
---|
28 | }
|
---|
29 |
|
---|
30 | template < typename T, size_t k >
|
---|
31 | struct nlua_vec_constructor {
|
---|
32 | static inline T unit() { return T(); }
|
---|
33 | static inline T construct( lua_State*, int ) {
|
---|
34 | return T();
|
---|
35 | }
|
---|
36 | };
|
---|
37 |
|
---|
38 | template < typename T > struct nlua_vec_constructor< T, 1 > {
|
---|
39 | static inline T unit() { return T( 1 ); }
|
---|
40 | static inline T construct( lua_State* L, int index ) {
|
---|
41 | return T( lua_tonumber( L, index ) );
|
---|
42 | }
|
---|
43 | };
|
---|
44 |
|
---|
45 | template < typename T > struct nlua_vec_constructor< T, 2 > {
|
---|
46 | static inline T unit() { return T( 1, 1 ); }
|
---|
47 | static inline T construct( lua_State* L, int index ) {
|
---|
48 | if ( lua_type( L, index ) == LUA_TUSERDATA )
|
---|
49 | return to_vec<T>( L, index );
|
---|
50 | else
|
---|
51 | return T( lua_tonumber( L, index ), lua_tonumber( L, index + 1 ) );
|
---|
52 | }
|
---|
53 | };
|
---|
54 |
|
---|
55 | template < typename T > struct nlua_vec_constructor< T, 3 > {
|
---|
56 | static inline T unit() { return T( 1, 1, 1 ); }
|
---|
57 | static inline T construct( lua_State* L, int index ) {
|
---|
58 | typedef nv::math::tvec2<typename T::value_type> vec2;
|
---|
59 | if ( lua_type( L, index ) == LUA_TUSERDATA )
|
---|
60 | {
|
---|
61 | if ( is_vec<T>( L, index ) )
|
---|
62 | return to_vec<T>( L, index );
|
---|
63 | else
|
---|
64 | return T( to_vec<vec2>( L, index ), lua_tonumber( L, index + 1 ) );
|
---|
65 | }
|
---|
66 | else
|
---|
67 | {
|
---|
68 | if ( lua_type( L, index+1 ) == LUA_TUSERDATA )
|
---|
69 | return T( lua_tonumber( L, index ), to_vec<vec2>( L, index+1 ) );
|
---|
70 | else
|
---|
71 | return T( lua_tonumber( L, index ), lua_tonumber( L, index + 1 ), lua_tonumber( L, index + 2 ) );
|
---|
72 | }
|
---|
73 | }
|
---|
74 | };
|
---|
75 |
|
---|
76 | template < typename T > struct nlua_vec_constructor< T, 4 > {
|
---|
77 | static inline T unit() { return T( 1, 1, 1, 1 ); }
|
---|
78 | static inline T construct( lua_State* L, int index ) {
|
---|
79 | typedef nv::math::tvec2<typename T::value_type> vec2;
|
---|
80 | typedef nv::math::tvec3<typename T::value_type> vec3;
|
---|
81 | if ( lua_type( L, index ) == LUA_TUSERDATA )
|
---|
82 | {
|
---|
83 | if ( is_vec<T>( L, index ) )
|
---|
84 | return to_vec<T>( L, index );
|
---|
85 | else
|
---|
86 | {
|
---|
87 | if ( is_vec<vec3>( L, index ) )
|
---|
88 | return T( to_vec<vec3>( L, index ), lua_tonumber( L, index + 1 ) );
|
---|
89 | else
|
---|
90 | {
|
---|
91 | if ( lua_type( L, index+1 ) == LUA_TUSERDATA )
|
---|
92 | return T( to_vec<vec2>( L, index ), to_vec<vec2>( L, index + 1 ) );
|
---|
93 | else
|
---|
94 | return T( to_vec<vec2>( L, index ), lua_tonumber( L, index + 1 ), lua_tonumber( L, index + 2 ) );
|
---|
95 | }
|
---|
96 | }
|
---|
97 | }
|
---|
98 | else
|
---|
99 | {
|
---|
100 | if ( lua_type( L, index+1 ) == LUA_TUSERDATA )
|
---|
101 | {
|
---|
102 | if ( is_vec<vec3>( L, index+1 ) )
|
---|
103 | return T( lua_tonumber( L, index ), to_vec<vec3>( L, index+1 ) );
|
---|
104 | else
|
---|
105 | return T( lua_tonumber( L, index ), to_vec<vec2>( L, index+1 ), lua_tonumber( L, index + 2 ) );
|
---|
106 | }
|
---|
107 | else
|
---|
108 | {
|
---|
109 | if ( lua_type( L, index+2 ) == LUA_TUSERDATA )
|
---|
110 | return T( lua_tonumber( L, index ), lua_tonumber( L, index + 1 ), to_vec<vec2>( L, index+2 ) );
|
---|
111 | else
|
---|
112 | return T( lua_tonumber( L, index ), lua_tonumber( L, index + 1 ), lua_tonumber( L, index + 2 ), lua_tonumber( L, index + 3 ) );
|
---|
113 | }
|
---|
114 | }
|
---|
115 | }
|
---|
116 | };
|
---|
117 |
|
---|
118 | template< typename T >
|
---|
119 | int nlua_vec_new( lua_State* L )
|
---|
120 | {
|
---|
121 | push_vec<T>( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( typename T::value_type )>::construct( L, 1 ) );
|
---|
122 | return 1;
|
---|
123 | }
|
---|
124 |
|
---|
125 | template< typename T >
|
---|
126 | int nlua_vec_random( lua_State* L )
|
---|
127 | {
|
---|
128 | push_vec<T>( L, nv::lua::rng().range( to_vec<T>( L, 1 ), to_vec<T>( L, 2 ) ) );
|
---|
129 | return 1;
|
---|
130 | }
|
---|
131 |
|
---|
132 | template< typename T >
|
---|
133 | int nlua_vec_clone( lua_State* L )
|
---|
134 | {
|
---|
135 | push_vec<T>( L, to_vec<T>( L, 1 ) );
|
---|
136 | return 1;
|
---|
137 | }
|
---|
138 |
|
---|
139 | template< typename T >
|
---|
140 | int nlua_vec_call( lua_State* L )
|
---|
141 | {
|
---|
142 | push_vec<T>( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( typename T::value_type )>::construct( L, 2 ) );
|
---|
143 | return 1;
|
---|
144 | }
|
---|
145 |
|
---|
146 | template< typename T >
|
---|
147 | static int nlua_vec_unm( lua_State* L )
|
---|
148 | {
|
---|
149 | push_vec<T>( L, -to_vec<T>( L, 1 ) );
|
---|
150 | return 1;
|
---|
151 | }
|
---|
152 |
|
---|
153 | template< typename T >
|
---|
154 | int nlua_vec_add( lua_State* L )
|
---|
155 | {
|
---|
156 | T v;
|
---|
157 | if ( lua_type( L, 1 ) == LUA_TNUMBER )
|
---|
158 | v = static_cast<typename T::value_type>(lua_tonumber( L, 1 )) + to_vec<T>( L, 2 );
|
---|
159 | else
|
---|
160 | if ( lua_type( L, 2 ) == LUA_TNUMBER )
|
---|
161 | v = to_vec<T>( L, 1 ) + static_cast<typename T::value_type>( lua_tonumber( L, 2 ) );
|
---|
162 | else
|
---|
163 | v = to_vec<T>( L, 1 ) + to_vec<T>( L, 2 );
|
---|
164 | push_vec<T>( L, v );
|
---|
165 | return 1;
|
---|
166 | }
|
---|
167 |
|
---|
168 | template< typename T >
|
---|
169 | int nlua_vec_sub( lua_State* L )
|
---|
170 | {
|
---|
171 | T v;
|
---|
172 | if ( lua_type( L, 1 ) == LUA_TNUMBER )
|
---|
173 | v = static_cast<typename T::value_type>(lua_tonumber( L, 1 )) - to_vec<T>( L, 2 );
|
---|
174 | else
|
---|
175 | if ( lua_type( L, 2 ) == LUA_TNUMBER )
|
---|
176 | v = to_vec<T>( L, 1 ) - static_cast<typename T::value_type>(lua_tonumber( L, 2 ) );
|
---|
177 | else
|
---|
178 | v = to_vec<T>( L, 1 ) - to_vec<T>( L, 2 );
|
---|
179 | push_vec<T>( L, v );
|
---|
180 | return 1;
|
---|
181 | }
|
---|
182 |
|
---|
183 | template< typename T >
|
---|
184 | int nlua_vec_mul( lua_State* L )
|
---|
185 | {
|
---|
186 | T v;
|
---|
187 | if ( lua_type( L, 1 ) == LUA_TNUMBER )
|
---|
188 | v = static_cast<typename T::value_type>(lua_tonumber( L, 1 )) * to_vec<T>( L, 2 );
|
---|
189 | else
|
---|
190 | if ( lua_type( L, 2 ) == LUA_TNUMBER )
|
---|
191 | v = to_vec<T>( L, 1 ) * static_cast<typename T::value_type>(lua_tonumber( L, 2 ));
|
---|
192 | else
|
---|
193 | v = to_vec<T>( L, 1 ) * to_vec<T>( L, 2 );
|
---|
194 | push_vec<T>( L, v );
|
---|
195 | return 1;
|
---|
196 | }
|
---|
197 |
|
---|
198 | template< typename T >
|
---|
199 | int nlua_vec_div( lua_State* L )
|
---|
200 | {
|
---|
201 | T v;
|
---|
202 | if ( lua_type( L, 1 ) == LUA_TNUMBER )
|
---|
203 | v = static_cast<typename T::value_type>(lua_tonumber( L, 1 )) / to_vec<T>( L, 2 );
|
---|
204 | else
|
---|
205 | if ( lua_type( L, 2 ) == LUA_TNUMBER )
|
---|
206 | v = to_vec<T>( L, 1 ) / static_cast<typename T::value_type>(lua_tonumber( L, 2 ));
|
---|
207 | else
|
---|
208 | v = to_vec<T>( L, 1 ) / to_vec<T>( L, 2 );
|
---|
209 | push_vec<T>( L, v );
|
---|
210 | return 1;
|
---|
211 | }
|
---|
212 |
|
---|
213 | template< typename T >
|
---|
214 | int nlua_vec_eq( lua_State* L )
|
---|
215 | {
|
---|
216 | lua_pushboolean( L, to_vec<T>( L, 1 ) == to_vec<T>( L, 2 ) );
|
---|
217 | return 1;
|
---|
218 | }
|
---|
219 |
|
---|
220 | template< typename T >
|
---|
221 | int nlua_vec_get( lua_State* L )
|
---|
222 | {
|
---|
223 | T v = to_vec<T>( L, 1 );
|
---|
224 | for ( size_t i = 0; i < v.size(); ++i )
|
---|
225 | {
|
---|
226 | lua_pushnumber( L, v[i] );
|
---|
227 | }
|
---|
228 | return v.size();
|
---|
229 | }
|
---|
230 |
|
---|
231 | template< typename T >
|
---|
232 | int nlua_vec_index( lua_State* L )
|
---|
233 | {
|
---|
234 | T* v = to_pvec<T>( L, 1 );
|
---|
235 | size_t len = 0;
|
---|
236 | size_t vlen = v->size();
|
---|
237 | const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
|
---|
238 | size_t idx = 255;
|
---|
239 |
|
---|
240 | if ( len == 1 )
|
---|
241 | {
|
---|
242 | idx = nlua_swizzel_lookup[ key[ 0 ] ];
|
---|
243 | if ( idx < vlen )
|
---|
244 | {
|
---|
245 | lua_pushnumber( L, (*v)[idx] );
|
---|
246 | return 1;
|
---|
247 | }
|
---|
248 | }
|
---|
249 | else if ( len < 4 && nlua_is_swizzel(key,vlen-1) )
|
---|
250 | {
|
---|
251 | switch (len) {
|
---|
252 | case 2 : push_vec( L, nv::math::tvec2<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]] ) ); return 1;
|
---|
253 | case 3 : push_vec( L, nv::math::tvec3<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]] ) ); return 1;
|
---|
254 | case 4 : push_vec( L, nv::math::tvec4<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]], (*v)[nlua_swizzel_lookup[key[3]]] ) ); return 1;
|
---|
255 | default: break;
|
---|
256 | }
|
---|
257 | }
|
---|
258 |
|
---|
259 | luaL_getmetafield( L, 1, "__functions" );
|
---|
260 | lua_pushvalue( L, 2 );
|
---|
261 | lua_rawget( L, -2 );
|
---|
262 | return 1;
|
---|
263 | }
|
---|
264 |
|
---|
265 | template< typename T >
|
---|
266 | int nlua_vec_newindex( lua_State* L )
|
---|
267 | {
|
---|
268 | typedef nv::math::tvec2<typename T::value_type> vec2;
|
---|
269 | typedef nv::math::tvec3<typename T::value_type> vec3;
|
---|
270 | typedef nv::math::tvec4<typename T::value_type> vec4;
|
---|
271 |
|
---|
272 | T* v = to_pvec<T>( L, 1 );
|
---|
273 | size_t len = 0;
|
---|
274 | size_t vlen = v->size();
|
---|
275 | const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
|
---|
276 | size_t idx = 255;
|
---|
277 | if( len == 1 )
|
---|
278 | {
|
---|
279 | idx = nlua_swizzel_lookup[ key[ 0 ] ];
|
---|
280 | if ( idx < vlen )
|
---|
281 | {
|
---|
282 | (*v)[idx] = static_cast<typename T::value_type>( luaL_checknumber( L, 3 ) );
|
---|
283 | return 0;
|
---|
284 | }
|
---|
285 | }
|
---|
286 | else if ( len < 4 && nlua_is_swizzel(key,vlen-1) )
|
---|
287 | {
|
---|
288 | switch (len) {
|
---|
289 | case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
|
---|
290 | case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
|
---|
291 | case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
|
---|
292 | default: break;
|
---|
293 | }
|
---|
294 | }
|
---|
295 | return 0;
|
---|
296 | }
|
---|
297 |
|
---|
298 | template< typename T >
|
---|
299 | static int nlua_vec_tostring( lua_State* L )
|
---|
300 | {
|
---|
301 | T v = to_vec<T>( L, 1 );
|
---|
302 | bool fl = nv::is_floating_point<typename T::value_type>::value;
|
---|
303 | switch ( v.size() )
|
---|
304 | {
|
---|
305 | case 1: lua_pushfstring( L, ( fl ? "(%f)" : "(%d)" ), v[0] ); break;
|
---|
306 | case 2: lua_pushfstring( L, ( fl ? "(%f,%f)" : "(%d,%d)" ), v[0], v[1] ); break;
|
---|
307 | case 3: lua_pushfstring( L, ( fl ? "(%f,%f,%f)" : "(%d,%d,%d)" ), v[0], v[1], v[2] ); break;
|
---|
308 | case 4: lua_pushfstring( L, ( fl ? "(%f,%f,%f,%f)" : "(%d,%d,%d,%d)" ), v[0], v[1], v[2], v[3] ); break;
|
---|
309 | default:
|
---|
310 | lua_pushliteral( L, "(vector?)" ); break;
|
---|
311 | }
|
---|
312 | return 1;
|
---|
313 | }
|
---|
314 |
|
---|
315 | template< typename T >
|
---|
316 | int luaopen_vec( lua_State * L )
|
---|
317 | {
|
---|
318 | static const struct luaL_Reg nlua_vec_sf [] = {
|
---|
319 | { "new", nlua_vec_new<T> },
|
---|
320 | { "random", nlua_vec_random<T> },
|
---|
321 | {NULL, NULL}
|
---|
322 | };
|
---|
323 |
|
---|
324 | static const struct luaL_Reg nlua_vec_f [] = {
|
---|
325 | { "clone", nlua_vec_clone<T> },
|
---|
326 | { "get", nlua_vec_get<T> },
|
---|
327 | { "tostring", nlua_vec_tostring<T> },
|
---|
328 | {NULL, NULL}
|
---|
329 | };
|
---|
330 |
|
---|
331 | static const struct luaL_Reg nlua_vec_sm [] = {
|
---|
332 | { "__call", nlua_vec_call<T> },
|
---|
333 | {NULL, NULL}
|
---|
334 | };
|
---|
335 |
|
---|
336 | static const struct luaL_Reg nlua_vec_m [] = {
|
---|
337 | { "__add", nlua_vec_add<T> },
|
---|
338 | { "__sub", nlua_vec_sub<T> },
|
---|
339 | { "__unm", nlua_vec_unm<T> },
|
---|
340 | { "__mul", nlua_vec_mul<T> },
|
---|
341 | { "__div", nlua_vec_div<T> },
|
---|
342 | { "__eq", nlua_vec_eq<T> },
|
---|
343 | { "__index", nlua_vec_index<T> },
|
---|
344 | { "__newindex", nlua_vec_newindex<T> },
|
---|
345 | { "__tostring", nlua_vec_tostring<T> },
|
---|
346 | {NULL, NULL}
|
---|
347 | };
|
---|
348 |
|
---|
349 | luaL_newmetatable( L, nv::lua::pass_traits<T>::metatable() );
|
---|
350 | nlua_register( L, nlua_vec_m, -1 );
|
---|
351 | lua_createtable( L, 0, 0 );
|
---|
352 | nlua_register( L, nlua_vec_f, -1 );
|
---|
353 | lua_setfield(L, -2, "__functions" );
|
---|
354 | lua_pop( L, 1 );
|
---|
355 |
|
---|
356 | lua_createtable( L, 0, 0 );
|
---|
357 | nlua_register( L, nlua_vec_sf, -1 );
|
---|
358 | lua_createtable( L, 0, 0 );
|
---|
359 | nlua_register( L, nlua_vec_sm, -1 );
|
---|
360 | lua_setmetatable( L, -2 );
|
---|
361 |
|
---|
362 | nv::lua::detail::push_vec( L, T() );
|
---|
363 | lua_setfield( L, -2, "ZERO" );
|
---|
364 | nv::lua::detail::push_vec( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( typename T::value_type )>::unit() );
|
---|
365 | lua_setfield( L, -2, "UNIT" );
|
---|
366 | return 1;
|
---|
367 | }
|
---|
368 |
|
---|
369 | template < typename T >
|
---|
370 | void nlua_rtti_vec_push( nv::lua::state* state, const nv::type_entry*, void* object )
|
---|
371 | {
|
---|
372 | T* value = reinterpret_cast<T*>( object );
|
---|
373 | push_vec<T>( state->get_raw(), *value );
|
---|
374 | }
|
---|
375 |
|
---|
376 | template < typename T >
|
---|
377 | bool nlua_rtti_vec_read( nv::lua::state* state, const nv::type_entry*, void* object, int index )
|
---|
378 | {
|
---|
379 | T* value = reinterpret_cast<T*>( object );
|
---|
380 | int type = lua_type( state->get_raw(), index );
|
---|
381 | if ( type == LUA_TUSERDATA )
|
---|
382 | {
|
---|
383 | T* from = to_pvec<T>( state->get_raw(), index );
|
---|
384 | if ( !from ) return false;
|
---|
385 | *value = *from;
|
---|
386 | }
|
---|
387 | // else if ( type == LUA_TTABLE )
|
---|
388 | // {
|
---|
389 | //
|
---|
390 | // }
|
---|
391 | else
|
---|
392 | return false;
|
---|
393 | int todo; int table_constructor;
|
---|
394 | return true;
|
---|
395 | }
|
---|
396 |
|
---|
397 | void nv::lua::register_math( lua::state* state )
|
---|
398 | {
|
---|
399 | for (size_t i = 0; i < 256; ++i ) nlua_swizzel_lookup[i] = 255;
|
---|
400 | using nv::uchar8;
|
---|
401 | nlua_swizzel_lookup[uchar8( 'x' )] = 0;
|
---|
402 | nlua_swizzel_lookup[uchar8( 'r' )] = 0;
|
---|
403 | nlua_swizzel_lookup[uchar8( 's' )] = 0;
|
---|
404 | nlua_swizzel_lookup[uchar8( '0' )] = 0;
|
---|
405 | nlua_swizzel_lookup[uchar8( 'y' )] = 1;
|
---|
406 | nlua_swizzel_lookup[uchar8( 'g' )] = 1;
|
---|
407 | nlua_swizzel_lookup[uchar8( 't' )] = 0;
|
---|
408 | nlua_swizzel_lookup[uchar8( '1' )] = 1;
|
---|
409 | nlua_swizzel_lookup[uchar8( 'z' )] = 2;
|
---|
410 | nlua_swizzel_lookup[uchar8( 'b' )] = 2;
|
---|
411 | nlua_swizzel_lookup[uchar8( 'u' )] = 0;
|
---|
412 | nlua_swizzel_lookup[uchar8( '2' )] = 2;
|
---|
413 | nlua_swizzel_lookup[uchar8( 'w' )] = 3;
|
---|
414 | nlua_swizzel_lookup[uchar8( 'a' )] = 3;
|
---|
415 | nlua_swizzel_lookup[uchar8( 'v' )] = 0;
|
---|
416 | nlua_swizzel_lookup[uchar8( '3' )] = 3;
|
---|
417 |
|
---|
418 | lua_State* L = state->get_raw();
|
---|
419 | int stack = lua_gettop( L );
|
---|
420 |
|
---|
421 | nlua_requiref(L, "coord", luaopen_vec<nv::ivec2>, 1);
|
---|
422 | nlua_requiref(L, "ivec2", luaopen_vec<nv::ivec2>, 1);
|
---|
423 | nlua_requiref(L, "ivec3", luaopen_vec<nv::ivec3>, 1);
|
---|
424 | nlua_requiref(L, "ivec4", luaopen_vec<nv::ivec4>, 1);
|
---|
425 | nlua_requiref(L, "vec2", luaopen_vec<nv::vec2>, 1);
|
---|
426 | nlua_requiref(L, "vec3", luaopen_vec<nv::vec3>, 1);
|
---|
427 | nlua_requiref(L, "vec4", luaopen_vec<nv::vec4>, 1);
|
---|
428 | lua_settop( L, stack );
|
---|
429 |
|
---|
430 | state->register_rtti_type< nv::ivec2 >( nlua_rtti_vec_push<nv::ivec2>, nlua_rtti_vec_read<nv::ivec2> );
|
---|
431 | state->register_rtti_type< nv::ivec3 >( nlua_rtti_vec_push<nv::ivec3>, nlua_rtti_vec_read<nv::ivec3> );
|
---|
432 | state->register_rtti_type< nv::ivec4 >( nlua_rtti_vec_push<nv::ivec4>, nlua_rtti_vec_read<nv::ivec4> );
|
---|
433 | state->register_rtti_type< nv::vec2 > ( nlua_rtti_vec_push<nv::vec2>, nlua_rtti_vec_read<nv::vec2> );
|
---|
434 | state->register_rtti_type< nv::vec3 > ( nlua_rtti_vec_push<nv::vec3>, nlua_rtti_vec_read<nv::vec3> );
|
---|
435 | state->register_rtti_type< nv::vec4 > ( nlua_rtti_vec_push<nv::vec4>, nlua_rtti_vec_read<nv::vec4> );
|
---|
436 | }
|
---|
437 |
|
---|