mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
handle mounted lights ghosting in and out
send a periodic corrective packet for mounted lights to ensure they stay mounted when moving in and out of ghosting
This commit is contained in:
parent
e77c4b3a18
commit
4d66ae37de
|
|
@ -147,7 +147,7 @@ bool LightBase::onAdd()
|
|||
// Update the light parameters.
|
||||
_conformLights();
|
||||
addToScene();
|
||||
|
||||
setProcessTick(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -256,10 +256,22 @@ void LightBase::_onUnselected()
|
|||
|
||||
void LightBase::interpolateTick( F32 delta )
|
||||
{
|
||||
if (isMounted()) {
|
||||
MatrixF mat;
|
||||
mMount.object->getRenderMountTransform(delta, mMount.node, mMount.xfm, &mat);
|
||||
mLight->setTransform(mat);
|
||||
Parent::setTransform(mat);
|
||||
}
|
||||
}
|
||||
|
||||
void LightBase::processTick()
|
||||
{
|
||||
if (isMounted()) {
|
||||
MatrixF mat;
|
||||
mMount.object->getMountTransform(mMount.node, mMount.xfm, &mat);
|
||||
mLight->setTransform(mat);
|
||||
setTransform(mat);
|
||||
}
|
||||
}
|
||||
|
||||
void LightBase::advanceTime( F32 timeDelta )
|
||||
|
|
|
|||
|
|
@ -1236,10 +1236,10 @@ bool SceneObject::_setMountPID( void* object, const char* index, const char* dat
|
|||
|
||||
void SceneObject::resolveMountPID()
|
||||
{
|
||||
if ( mMountPID && !mMount.object )
|
||||
if ( mMountPID )
|
||||
{
|
||||
SceneObject *obj = dynamic_cast< SceneObject* >( mMountPID->getObject() );
|
||||
if ( obj )
|
||||
if ( obj != mMount.object)
|
||||
obj->mountObject( this, mMount.node, mMount.xfm );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue