NVIDIA OptiX 7.1 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OptixMatrixMotionTransform Struct Reference

Public Attributes

OptixTraversableHandle child
 
OptixMotionOptions motionOptions
 
unsigned int pad [3]
 
float transform [2][12]
 

Detailed Description

Represents a matrix motion transformation.

The device address of instances of this type must be a multiple of OPTIX_TRANSFORM_BYTE_ALIGNMENT.

This struct, as defined here, handles only N=2 motion keys due to the fixed array length of its transform member. The following example shows how to create instances for an arbitrary number N of motion keys:

float matrixData[N][12];
... // setup matrixData
size_t transformSizeInBytes = sizeof( OptixMatrixMotionTransform ) + ( N-2 ) * 12 * sizeof( float );
OptixMatrixMotionTransform* matrixMoptionTransform = (OptixMatrixMotionTransform*) malloc( transformSizeInBytes );
memset( matrixMoptionTransform, 0, transformSizeInBytes );
... // setup other members of matrixMoptionTransform
matrixMoptionTransform->motionOptions.numKeys
memcpy( matrixMoptionTransform->transform, matrixData, N * 12 * sizeof( float ) );
... // copy matrixMoptionTransform to device memory
free( matrixMoptionTransform )
See Also
optixConvertPointerToTraversableHandle()

Member Data Documentation

OptixTraversableHandle OptixMatrixMotionTransform::child

The traversable that is transformed by this transformation.

OptixMotionOptions OptixMatrixMotionTransform::motionOptions

The motion options for this transformation.

unsigned int OptixMatrixMotionTransform::pad[3]

Padding to make the transformation 16 byte aligned.

float OptixMatrixMotionTransform::transform[2][12]

Affine object-to-world transformation as 3x4 matrix in row-major layout.