Structures
VkSRTDataNV
Structure specifying a transform in SRT decomposition
An acceleration structure SRT transform is defined by the structure:
typedef struct VkSRTDataNV {
float sx;
float a;
float b;
float pvx;
float sy;
float c;
float pvy;
float sz;
float pvz;
float qx;
float qy;
float qz;
float qw;
float tx;
float ty;
float tz;
} VkSRTDataNV;
sxis the x component of the scale of the transformais one component of the shear for the transformbis one component of the shear for the transformpvxis the x component of the pivot point of the transformsyis the y component of the scale of the transformcis one component of the shear for the transformpvyis the y component of the pivot point of the transformszis the z component of the scale of the transformpvzis the z component of the pivot point of the transformqxis the x component of the rotation quaternionqyis the y component of the rotation quaternionqzis the z component of the rotation quaternionqwis the w component of the rotation quaterniontxis the x component of the post-rotation translationtyis the y component of the post-rotation translationtzis the z component of the post-rotation translation
This transform decomposition consists of three elements. The first is a matrix S, consisting of a scale, shear, and translation, usually used to define the pivot point of the following rotation. This matrix is constructed from the parameters above by:
The rotation quaternion is defined as:
R= [qx,qy,qz,qw]
This is a rotation around a conceptual normalized axis [ ax, ay, az ]
of amount theta such that:
- [
qx,qy,qz] = sin(theta/2) × [ax,ay,az]
and
qw= cos(theta/2)
Finally, the transform has a translation T constructed from the parameters above by:
The effective derived transform is then given by
T×R×S