mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-20 12:50:57 +00:00
Test PR of lazy load of ghosts and scene streaming
For now scene streaming only affects how subscenes are loaded. If you try it on everything in a scene expect issues as the namespaces are not linked up at that point. This is a TEST! Do not merge! If you do you will open up a gate to an alternate reality where all that you believe will cease to exist in an endless void of darkness.
This commit is contained in:
parent
23e30e801f
commit
eecc2bdaee
17 changed files with 298 additions and 37 deletions
|
|
@ -942,6 +942,86 @@ void TSStatic::setTransform(const MatrixF& mat)
|
|||
setRenderTransform(mat);
|
||||
}
|
||||
|
||||
U32 TSStatic::partialPackUpdate(NetConnection* conn, U32 mask, BitStream* stream)
|
||||
{
|
||||
U32 retMask = Parent::partialPackUpdate(conn,mask,stream);
|
||||
|
||||
if (stream->writeFlag(mask & TransformMask))
|
||||
{
|
||||
mathWrite(*stream, getTransform());
|
||||
retMask &= ~TransformMask;
|
||||
}
|
||||
|
||||
if (stream->writeFlag(mask & AdvancedStaticOptionsMask))
|
||||
{
|
||||
PACK_ASSET_REFACTOR(conn, Shape);
|
||||
|
||||
stream->writeInt(mDecalType, 4);
|
||||
|
||||
stream->writeFlag(mAllowPlayerStep);
|
||||
stream->writeFlag(mMeshCulling);
|
||||
stream->writeFlag(mUseOriginSort);
|
||||
|
||||
stream->write(mRenderNormalScalar);
|
||||
|
||||
stream->write(mForceDetail);
|
||||
|
||||
if (stream->writeFlag(mPlayAmbient && hasAnim()))
|
||||
{
|
||||
if (stream->writeFlag(mAnimOffset != 0.0f))
|
||||
stream->writeFloat(mAnimOffset, 7);
|
||||
|
||||
if (stream->writeFlag(mAnimSpeed != 1.0f))
|
||||
stream->writeSignedFloat(mAnimSpeed / AnimSpeedMax, 7);
|
||||
}
|
||||
|
||||
retMask &= ~AdvancedStaticOptionsMask;
|
||||
}
|
||||
|
||||
return retMask;
|
||||
}
|
||||
|
||||
void TSStatic::partialUnpackUpdate(NetConnection* conn, BitStream* stream)
|
||||
{
|
||||
Parent::partialUnpackUpdate(conn, stream);
|
||||
|
||||
if (stream->readFlag()) // TransformMask
|
||||
{
|
||||
MatrixF mat;
|
||||
mathRead(*stream, &mat);
|
||||
setTransform(mat);
|
||||
setRenderTransform(mat);
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // AdvancedStaticOptionsMask
|
||||
{
|
||||
UNPACK_ASSET_REFACTOR(conn, Shape);
|
||||
|
||||
mDecalType = (MeshType)stream->readInt(4);
|
||||
|
||||
mAllowPlayerStep = stream->readFlag();
|
||||
mMeshCulling = stream->readFlag();
|
||||
mUseOriginSort = stream->readFlag();
|
||||
|
||||
stream->read(&mRenderNormalScalar);
|
||||
|
||||
stream->read(&mForceDetail);
|
||||
|
||||
mPlayAmbient = stream->readFlag();
|
||||
if (mPlayAmbient)
|
||||
{
|
||||
if (stream->readFlag())
|
||||
mAnimOffset = stream->readFloat(7);
|
||||
|
||||
if (stream->readFlag())
|
||||
mAnimSpeed = stream->readSignedFloat(7) * AnimSpeedMax;
|
||||
}
|
||||
|
||||
//update our shape, figuring that it likely changed
|
||||
_createShape();
|
||||
}
|
||||
}
|
||||
|
||||
U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
||||
{
|
||||
U32 retMask = Parent::packUpdate(con, mask, stream);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue