示例#1
0
void VoxelNodeData::resetVoxelPacket() {
    // If we're moving, and the client asked for low res, then we force monochrome, otherwise, use 
    // the clients requested color state.    
    _currentPacketIsColor = (LOW_RES_MONO && getWantLowResMoving() && _viewFrustumChanging) ? false : getWantColor();
    PACKET_TYPE voxelPacketType = _currentPacketIsColor ? PACKET_TYPE_VOXEL_DATA : PACKET_TYPE_VOXEL_DATA_MONOCHROME;
    int numBytesPacketHeader = populateTypeAndVersion(_voxelPacket, voxelPacketType);
    _voxelPacketAt = _voxelPacket + numBytesPacketHeader;
    _voxelPacketAvailableBytes = MAX_VOXEL_PACKET_SIZE - numBytesPacketHeader;
    _voxelPacketWaiting = false;
}
示例#2
0
void VoxelNodeData::resetVoxelPacket() {
    // Whenever we call this, we will keep a copy of the last packet, so we can determine if the last packet has
    // changed since we last reset it. Since we know that no two packets can ever be identical without being the same
    // scene information, (e.g. the root node packet of a static scene), we can use this as a strategy for reducing
    // packet send rate.
    _lastVoxelPacketLength = getPacketLength();
    memcpy(_lastVoxelPacket, _voxelPacket, _lastVoxelPacketLength);

    // If we're moving, and the client asked for low res, then we force monochrome, otherwise, use 
    // the clients requested color state.    
    _currentPacketIsColor = (LOW_RES_MONO && getWantLowResMoving() && _viewFrustumChanging) ? false : getWantColor();
    PACKET_TYPE voxelPacketType = _currentPacketIsColor ? PACKET_TYPE_VOXEL_DATA : PACKET_TYPE_VOXEL_DATA_MONOCHROME;
    int numBytesPacketHeader = populateTypeAndVersion(_voxelPacket, voxelPacketType);
    _voxelPacketAt = _voxelPacket + numBytesPacketHeader;
    _voxelPacketAvailableBytes = MAX_VOXEL_PACKET_SIZE - numBytesPacketHeader;
    _voxelPacketWaiting = false;
}