daScript
daScript copied to clipboard
How to return an object or value from function in das script to cpp host program?
How to return an object or value from function in das script to cpp host program?
C++ is calling das Context like this ctx.eval(fnTest, nullptr); It is not clear how to return a value from fnTest to host c++ program.
Thank you!
If its passed by value - eval returns vec4f, which can be cast to the right type. if its passed by reference on the stack, eval's 3rd parameter is address of the buffer for the result.
__forceinline vec4f eval ( const SimFunction * fnPtr, vec4f * args = nullptr, void * res = nullptr )