| 576 | |
| 577 | |
| 578 | int LuaObstacle::GetFaceNorms(lua_State* L) { |
| 579 | const MeshFace* face = ParseMeshFace(L, 1); |
| 580 | if (face == NULL) { |
| 581 | return luaL_pushnil(L); |
| 582 | } |
| 583 | if (!face->useNormals()) { |
| 584 | return luaL_pushnil(L); |
| 585 | } |
| 586 | const int elements = face->getVertexCount(); |
| 587 | lua_createtable(L, elements, 0); |
| 588 | for (int i = 0; i < elements; i++) { |
| 589 | const fvec3& vec = face->getNormal(i); |
| 590 | lua_createtable(L, 3, 0); |
| 591 | lua_pushfloat(L, vec.x); lua_rawseti(L, -2, 1); |
| 592 | lua_pushfloat(L, vec.y); lua_rawseti(L, -2, 2); |
| 593 | lua_pushfloat(L, vec.z); lua_rawseti(L, -2, 3); |
| 594 | lua_rawseti(L, -2, i + 1); |
| 595 | } |
| 596 | return 1; |
| 597 | } |
| 598 | |
| 599 | |
| 600 | int LuaObstacle::GetFaceTxcds(lua_State* L) { |
nothing calls this directly
no test coverage detected