Chi-Tech
chi_ffinter_volume_calllua.cc
Go to the documentation of this file.
2
3#include "chi_runtime.h"
5
6//###################################################################
7/**Calls the designated lua function*/
9 CallLuaFunction(double ff_value, int mat_id) const
10{
11 lua_State* L = Chi::console.GetConsoleState();
12 double ret_val = 0.0;
13
14 lua_getglobal(L, op_lua_func_.c_str());
15 lua_pushnumber(L,ff_value);
16 lua_pushnumber(L,mat_id);
17
18 //2 arguments, 1 result, 0=original error object
19 if (lua_pcall(L,2,1,0) == 0)
20 {
21 ret_val = lua_tonumber(L,-1);
22 }
23 lua_pop(L,1);
24
25
26 return ret_val;
27}
static chi::Console & console
Definition: chi_runtime.h:80
lua_State *& GetConsoleState()
Definition: chi_console.h:130
double CallLuaFunction(double ff_value, int mat_id) const