Guest User

Untitled

a guest
Nov 16th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1.  
  2. ######################################################################################################################
  3.  
  4. function_lib {
  5.  
  6. function translateBoolToVec( type )
  7.  
  8.     if type == "bvec2 then
  9.         return "vec2"
  10.     elseif type == "bvec3" then
  11.         return "vec3"
  12.     elseif type == "bvec4" then
  13.         return "vec4"
  14.     else
  15.         return ""
  16.     end
  17.    
  18. end
  19.  
  20. }
  21.  
  22. ######################################################################################################################
  23.  
  24. new BoolToFloat {
  25.    
  26.     group Boolean
  27.    
  28.     out {
  29.         out_types func { lbz . ret_type( translateBoolToVec( lbz . get_type( "Boolean" ) ) }
  30.        
  31.         lua {
  32.             local A = lbz . input( "Boolean" )
  33.             lbz . ret( "float( " .. B .. " )" )
  34.             }
  35.        
  36.         }
  37.        
  38.     in {
  39.         name Boolean
  40.         in_types {bool}
  41.         }      
  42.    
  43. }
  44.  
  45. ######################################################################################################################
Add Comment
Please, Sign In to add comment