Project Manhattan: NeoCommodore 64 Advanced Emulator
Code Converter Module
Original Code
// Plane - exact float sdPlane( vec3 p, vec3 n, float h ) { // n must be normalized return dot(p,n) + h; }
Intermediate Code
double _ZN12SYSTEM_BUS_T7SDPLANEER7VECTOR3S1_d( struct $12SYSTEM_BUS_T* THIS$1, struct $7VECTOR3* P$1, \ struct $7VECTOR3* N$1, double H$1 ) { double fb$result$1; __builtin_memset( &fb$result$1, 0, 8ll ); label$2197:; double vr$1 = _Z3DOTR7VECTOR3S0_( P$1, N$1 ); fb$result$1 = vr$1 + H$1; goto label$2198; label$2198:; return fb$result$1; }
FreeBASIC Code
proc SYSTEM_BUS_T.sdPlane overload (p as vector3, n as vector3, h as float) as float ' n must be normalized return (p.x * n.x + p.y * n.y + p.z * n.z) + h end proc
Explain Conversion
Clear All