Converting a short piece of C/C++ code
Posted: Mon Feb 17, 2020 2:52 pm
The definition of three float values in C/C++
I am uncertain how to convert to PB. I tried this, where u is a structured Vector (3D geometry):
.... but it doesn't work 
Code: Select all
float ax = (u.x >= 0 ? u.x : -u.x);
float ay = (u.y >= 0 ? u.y : -u.y);
float az = (u.z >= 0 ? u.z : -u.z);
Code: Select all
Structure vector3d
x.d
y.d
z.d
EndStructure
Define u.vector3d
Define.d ax, ay, az
If(u\x >= 0) : ax = u\x : Else : ax = -(u\x) : EndIf
If(u\y >= 0) : ay = u\y : Else : ay = -(u\y) : EndIf
If(u\z >= 0) : az = u\z : Else : az = -(u\z) : EndIf
