| 64 | //----------------------------------------------------------------------------- |
| 65 | |
| 66 | U32 VPathNode::packNode( NetConnection *pConnection, BitStream *pStream ) |
| 67 | { |
| 68 | // Init Return Mask. |
| 69 | U32 retMask = 0; |
| 70 | |
| 71 | // Fetch State. |
| 72 | VNetStateInfo *state = getState( pConnection ); |
| 73 | |
| 74 | // Note: This is out of sync with VPathNode::unpackUpdate(). |
| 75 | // If you're ever going to use these methods outside of VPath, you |
| 76 | // will need to read a flag *before* calling unpack! |
| 77 | |
| 78 | // Was the Node Created? |
| 79 | if ( pStream->writeFlag( state->Mask & k_StateCreate ) ) |
| 80 | { |
| 81 | // Clear Update. |
| 82 | state->Mask &= ~k_StateCreate; |
| 83 | } |
| 84 | |
| 85 | // Send mLocalPosition? |
| 86 | if ( pStream->writeFlag( state->Mask & k_StateUpdatePosition ) ) |
| 87 | { |
| 88 | // Write mLocalPosition. |
| 89 | pStream->write( mLocalPosition.x ); |
| 90 | pStream->write( mLocalPosition.y ); |
| 91 | pStream->write( mLocalPosition.z ); |
| 92 | |
| 93 | // Clear Update. |
| 94 | state->Mask &= ~k_StateUpdatePosition; |
| 95 | } |
| 96 | |
| 97 | // Send mLocalRotation? |
| 98 | if ( pStream->writeFlag( state->Mask & k_StateUpdateRotation ) ) |
| 99 | { |
| 100 | // Write mLocalRotation. |
| 101 | pStream->write( mLocalRotation.x ); |
| 102 | pStream->write( mLocalRotation.y ); |
| 103 | pStream->write( mLocalRotation.z ); |
| 104 | pStream->write( mLocalRotation.w ); |
| 105 | |
| 106 | // Clear Update. |
| 107 | state->Mask &= ~k_StateUpdateRotation; |
| 108 | } |
| 109 | |
| 110 | // Send mWeight? |
| 111 | if ( pStream->writeFlag( state->Mask & k_StateUpdateWeight ) ) |
| 112 | { |
| 113 | // Write mWeight. |
| 114 | pStream->write( mWeight ); |
| 115 | |
| 116 | // Clear Update. |
| 117 | state->Mask &= ~k_StateUpdateWeight; |
| 118 | } |
| 119 | |
| 120 | // Send Orientation Update? |
| 121 | if ( pStream->writeFlag( state->Mask & k_StateUpdateOrientation ) ) |
| 122 | { |
| 123 | // Clear Update? |
no test coverage detected