MCPcopy Create free account
hub / github.com/ImageEngine/cortex / readTransform

Method readTransform

src/IECoreScene/SampledSceneInterface.cpp:71–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71ConstDataPtr SampledSceneInterface::readTransform( double time ) const
72{
73 size_t sample1, sample2;
74 double x = transformSampleInterval( time, sample1, sample2 );
75
76 if( x == 0 )
77 {
78 return readTransformAtSample( sample1 );
79 }
80 if( x == 1 )
81 {
82 return readTransformAtSample( sample2 );
83 }
84
85 ConstDataPtr transformData1 = readTransformAtSample( sample1 );
86 ConstDataPtr transformData2 = readTransformAtSample( sample2 );
87 DataPtr transformData = runTimeCast< Data >( linearObjectInterpolation( transformData1.get(), transformData2.get(), x ) );
88 if( !transformData )
89 {
90 // failed to interpolate, return the closest one
91 return ( x >= 0.5 ? transformData2 : transformData1 );
92 }
93 return transformData;
94}
95
96Imath::M44d SampledSceneInterface::readTransformAsMatrix( double time ) const
97{

Callers

nothing calls this directly

Calls 4

transformSampleIntervalFunction · 0.85
readTransformAtSampleFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected