MCPcopy Create free account
hub / github.com/defold/defold / Vector3_concat

Function Vector3_concat

engine/script/src/script_vmath.cpp:390–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388 }
389
390 static int Vector3_concat(lua_State *L)
391 {
392 size_t size = 0;
393 const char* s = luaL_checklstring(L, 1, &size);
394 Vector3* v = CheckVector3(L, 2);
395 const int buffer_size = size + MAX_CHARS_PER_VECTOR3 + 1;
396 char* buffer = new char[buffer_size];
397 // Use same format as Lua when converting number to string (from LUA_NUMBER_FMT in luaconf.h)
398 dmSnPrintf(buffer, buffer_size, STRING_FORMAT_CONCAT_VECTOR3, s, v->getX(), v->getY(), v->getZ());
399 lua_pushstring(L, buffer);
400 delete [] buffer;
401 return 1;
402 }
403
404 static int Vector3_eq(lua_State *L)
405 {

Callers

nothing calls this directly

Calls 7

luaL_checklstringFunction · 0.85
CheckVector3Function · 0.85
dmSnPrintfFunction · 0.85
lua_pushstringFunction · 0.85
getXMethod · 0.45
getYMethod · 0.45
getZMethod · 0.45

Tested by

no test coverage detected