Replies: 1 comment 2 replies
-
|
Iirc you can try putting round brackets around E.g.
Or maybe it would be better to do it like this: Also i'm not sure if you need the parentheses around |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
so I have some macros im using to do math with some vectors but it wont let me do anything with literals. I could make another variable or just split up the components for it but its gonna be slower or use extra code
`
%define VEC3ADD(V1, V2) vec3d { x: (V1.x + V2.x), y: (V1.y + V2.y), z: (V1.z + V2.z) }
%define VEC3SUB(V1, V2) vec3d { x: (V1.x - V2.x), y: (V1.y - V2.y), z: (V1.z - V2.z) }
%define VEC3MUL(V1, V2) vec3d { x: (V1.x * V2.x), y: (V1.y * V2.y), z: (V1.z * V2.z) }
%define VEC3DIV(V1, V2) vec3d { x: (V1.x / V2.x), y: (V1.y / V2.y), z: (V1.z / V2.z) }
%define VEC3POW(V1, V2) vec3d { x: POW(V1.x, V2.x), y: POW(V1.y, V2.y), z: POW(V1.z, V2.z) }
onflag {
vec3d vector1 = vec3d { x: 1, y: 2, z: 3 };
vec3d vector2 = vec3d { x: 4, y: 5, z: 6 };
# VEC3MUL(VEC3ADD()) and VEC3MUL(... , vec3d {}) both arent allowed
vec3d test = VEC3MUL(VEC3ADD(vector1, vector2), vec3d { x: 2, y: 2, z: 2 });
}
`
Beta Was this translation helpful? Give feedback.
All reactions