NVIDIA OptiX 7.7 nvidia_logo_transpbg.gif Up
OptixMatrixMotionTransform Struct Reference

#include <optix_types.h>

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 )
struct OptixMatrixMotionTransform OptixMatrixMotionTransform
Represents a matrix motion transformation.
Represents a matrix motion transformation.
Definition: optix_types.h:1435
OptixMotionOptions motionOptions
The motion options for this transformation. Must have at least two motion keys.
Definition: optix_types.h:1441
float transform[2][12]
Affine object-to-world transformation as 3x4 matrix in row-major layout.
Definition: optix_types.h:1447
unsigned short numKeys
If numKeys > 1, motion is enabled. timeBegin, timeEnd and flags are all ignored when motion is disabl...
Definition: optix_types.h:1301
See also
optixConvertPointerToTraversableHandle()

Member Data Documentation

 child

OptixTraversableHandle OptixMatrixMotionTransform::child

The traversable that is transformed by this transformation.

 motionOptions

OptixMotionOptions OptixMatrixMotionTransform::motionOptions

The motion options for this transformation. Must have at least two motion keys.

 pad

unsigned int OptixMatrixMotionTransform::pad[3]

Padding to make the transformation 16 byte aligned.

 transform

float OptixMatrixMotionTransform::transform[2][12]

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