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

Method unpackUpdate

Engine/source/afx/afxMagicMissile.cpp:1612–1665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1610}
1611
1612void afxMagicMissile::unpackUpdate(NetConnection* con, BitStream* stream)
1613{
1614 Parent::unpackUpdate(con, stream);
1615
1616 if ( stream->readFlag() ) // InitialUpdateMask
1617 {
1618 Point3F pos;
1619 stream->readCompressedPoint( &pos );
1620 if ( stream->readFlag() )
1621 {
1622 stream->readNormalVector( &mCurrVelocity, 10 );
1623 mCurrVelocity *= stream->readInt( 13 ) / 32.0f;
1624 }
1625 else
1626 mCurrVelocity.zero();
1627
1628 mCurrDeltaBase = pos;
1629 mCurrBackDelta = mCurrPosition - pos;
1630 mCurrPosition = pos;
1631 setPosition( mCurrPosition );
1632
1633 mCurrTick = stream->readRangedU32(0, afxMagicMissileData::MaxLifetimeTicks);
1634 if ( stream->readFlag() )
1635 {
1636 U32 id = stream->readRangedU32(0, NetConnection::MaxGhostCount);
1637 choreographer = dynamic_cast<afxChoreographer*>(con->resolveGhost(id));
1638 if (choreographer)
1639 {
1640 deleteNotify(choreographer);
1641 }
1642 }
1643 else
1644 {
1645 if (choreographer)
1646 clearNotify(choreographer);
1647 choreographer = 0;
1648 }
1649 }
1650
1651 // impact update
1652 if (stream->readFlag())
1653 {
1654 mathRead(*stream, &mCurrPosition);
1655 mathRead(*stream, &mCurrVelocity);
1656 did_impact = stream->readFlag();
1657
1658 }
1659
1660 if (stream->readFlag()) // guided update
1661 {
1662 mathRead( *stream, &mCurrPosition );
1663 mathRead( *stream, &mCurrVelocity );
1664 }
1665}
1666
1667//--------------------------------------------------------------------------
1668void afxMagicMissile::prepRenderImage(SceneRenderState* state)

Callers

nothing calls this directly

Calls 9

mathReadFunction · 0.85
readFlagMethod · 0.80
readCompressedPointMethod · 0.80
readNormalVectorMethod · 0.80
readIntMethod · 0.80
readRangedU32Method · 0.80
resolveGhostMethod · 0.80
setPositionFunction · 0.50
zeroMethod · 0.45

Tested by

no test coverage detected