MCPcopy Create free account
hub / github.com/DavidColson/Polybox / VecMagnitude

Function VecMagnitude

source/userdata.cpp:590–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588// ***********************************************************************
589
590i32 VecMagnitude(lua_State* L) {
591 UserData* pUserData = (UserData*)luaL_checkudata(L, 1, "UserData");
592 switch(pUserData->type) {
593 case Type::Float32: lua_pushnumber(L, CalcMagnitude<f32>(pUserData)); break;
594 case Type::Int32: lua_pushinteger(L, CalcMagnitude<i32>(pUserData)); break;
595 case Type::Int16: lua_pushinteger(L, CalcMagnitude<i16>(pUserData)); break;
596 case Type::Uint8: lua_pushunsigned(L, CalcMagnitude<u8>(pUserData)); break;
597 default: return 0;
598 }
599 return 1;
600}
601
602// ***********************************************************************
603

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected