quakeforge/tools/qfcc/test/motor.r
Bill Currie b648c353ff [qfcc] Add a failing test for bogus uninitialized
The variable is very definitely initialized... by a memset (which is the
problem, actually).
2023-09-11 00:34:15 +09:00

14 lines
398 B
R

typedef @algebra(float(3,0,1)) PGA;
typedef PGA.group_mask(0xa) bivector_t;
typedef PGA.group_mask(0x1e) motor_t;
motor_t
make_motor (vec4 translation, vec4 rotation)
{
auto dt = (PGA.group_mask(0x18)) translation;
auto q = (PGA.group_mask(0x06)) rotation;
motor_t t = { .scalar = 1, .bvecp = -dt.bvecp };
motor_t r = { .scalar = q.scalar, .bvect = q.bvect };
motor_t m = t * r;
return m;
}