MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _updateChildTransform

Method _updateChildTransform

Engine/source/T3D/prefab.cpp:400–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void Prefab::_updateChildTransform( SceneObject* child )
401{
402 ChildToMatMap::Iterator itr = mChildMap.find(child->getId());
403 AssertFatal( itr != mChildMap.end(), "Prefab, mChildMap out of synch with mChildGroup." );
404
405 MatrixF mat( itr->value.mat );
406 Point3F pos = mat.getPosition();
407 pos.convolve( mObjScale );
408 mat.setPosition( pos );
409 mat.mulL( mObjToWorld );
410
411 child->setTransform( mat );
412 child->setScale( itr->value.scale * mObjScale );
413
414 // Hack for PhysicsShape... need to store the "editor" position to return to
415 // when a physics reset event occurs. Normally this would be where it is
416 // during onAdd, but in this case it is not because the prefab stores its
417 // child objects in object space...
418
419 PhysicsShape *childPS = dynamic_cast<PhysicsShape*>( child );
420 if ( childPS )
421 childPS->storeRestorePos();
422
423}
424
425void Prefab::_updateChildren()
426{

Callers

nothing calls this directly

Calls 10

mulLMethod · 0.80
storeRestorePosMethod · 0.80
getIdMethod · 0.65
findMethod · 0.45
endMethod · 0.45
getPositionMethod · 0.45
convolveMethod · 0.45
setPositionMethod · 0.45
setTransformMethod · 0.45
setScaleMethod · 0.45

Tested by

no test coverage detected