Advertisement
quantumech

Untitled

Apr 23rd, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <emscripten/bind.h>
  2.  
  3. // Bring Emscripten namespace into scope for the sake of readability
  4. using namespace emscripten;
  5.  
  6. // Method being exported to JS
  7. float lerp(float a, float b, float t)
  8. {
  9.     return (1 - t) * a + t * b;
  10. }
  11.  
  12. // Embind Block that registers the 'lerp()' method under the group 'Module'
  13. EMSCRIPTEN_BINDINGS(Module) {
  14.     function("lerp", &lerp);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement