| 398 | } |
| 399 | |
| 400 | void 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 | |
| 425 | void Prefab::_updateChildren() |
| 426 | { |
nothing calls this directly
no test coverage detected