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;
sx
is the x component of the scale of the transforma
is one component of the shear for the transformb
is one component of the shear for the transformpvx
is the x component of the pivot point of the transformsy
is the y component of the scale of the transformc
is one component of the shear for the transformpvy
is the y component of the pivot point of the transformsz
is the z component of the scale of the transformpvz
is the z component of the pivot point of the transformqx
is the x component of the rotation quaternionqy
is the y component of the rotation quaternionqz
is the z component of the rotation quaternionqw
is the w component of the rotation quaterniontx
is the x component of the post-rotation translationty
is the y component of the post-rotation translationtz
is 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