42
42
#include " IECore/SplineData.h"
43
43
#include " IECore/MatrixAlgo.h"
44
44
#include " IECore/Transform.h"
45
- #include " IECore/MatrixTransform.h"
46
45
#include " IECore/Group.h"
47
46
48
47
#include " boost/algorithm/string/case_conv.hpp"
@@ -228,14 +227,9 @@ void IECoreRI::SXRendererImplementation::worldEnd()
228
227
229
228
void IECoreRI::SXRendererImplementation::transformBegin ()
230
229
{
231
- Imath::M44f worldTransform = m_stateStack.top ().localTransform * m_stateStack.top ().parentWorldTransform ;
232
-
233
230
// New push state onto the stack: deep copy flag is false, so we don't create a new SxContext, which will swallow up any
234
231
// coordinate systems declared before transformEnd():
235
232
m_stateStack.push ( State ( m_stateStack.top (), false ) );
236
-
237
- m_stateStack.top ().parentWorldTransform = worldTransform;
238
- m_stateStack.top ().localTransform .makeIdentity ();
239
233
}
240
234
241
235
void IECoreRI::SXRendererImplementation::transformEnd ()
@@ -251,7 +245,7 @@ void IECoreRI::SXRendererImplementation::transformEnd()
251
245
252
246
void IECoreRI::SXRendererImplementation::setTransform ( const Imath::M44f &m )
253
247
{
254
- m_stateStack.top ().localTransform = m;
248
+ m_stateStack.top ().transform = m;
255
249
}
256
250
257
251
void IECoreRI::SXRendererImplementation::setTransform ( const std::string &coordinateSystem )
@@ -261,7 +255,7 @@ void IECoreRI::SXRendererImplementation::setTransform( const std::string &coordi
261
255
262
256
Imath::M44f IECoreRI::SXRendererImplementation::getTransform () const
263
257
{
264
- return m_stateStack.top ().localTransform * m_stateStack. top (). parentWorldTransform ;
258
+ return m_stateStack.top ().transform ;
265
259
}
266
260
267
261
Imath::M44f IECoreRI::SXRendererImplementation::getTransform ( const std::string &coordinateSystem ) const
@@ -272,14 +266,14 @@ Imath::M44f IECoreRI::SXRendererImplementation::getTransform( const std::string
272
266
273
267
void IECoreRI::SXRendererImplementation::concatTransform ( const Imath::M44f &m )
274
268
{
275
- m_stateStack.top ().localTransform = m * m_stateStack.top ().localTransform ;
269
+ m_stateStack.top ().transform = m * m_stateStack.top ().transform ;
276
270
}
277
271
278
272
void IECoreRI::SXRendererImplementation::coordinateSystem ( const std::string &name )
279
273
{
280
- Imath:: M44f worldTransform = m_stateStack.top ().localTransform * m_stateStack. top (). parentWorldTransform ;
274
+ M44f m = m_stateStack.top ().transform . transposed () ;
281
275
RtMatrix mm;
282
- convert ( worldTransform. transposed () , mm );
276
+ convert ( m , mm );
283
277
SxDefineSpace ( m_stateStack.top ().context .get (), name.c_str (), (RtFloat*)&mm[0 ][0 ] );
284
278
}
285
279
0 commit comments