| 72 | } |
| 73 | } |
| 74 | void storeServerPhysicsPositions(BitStream &bs,Entity *self) |
| 75 | { |
| 76 | PUTDEBUG("before physics"); |
| 77 | |
| 78 | bs.StoreBits(1,self->m_full_update); |
| 79 | if( !self->m_full_update ) |
| 80 | bs.StoreBits(1,self->m_has_control_id); |
| 81 | |
| 82 | qCDebug(logPosition,"Input_Ack: %d",self->m_input_ack); |
| 83 | |
| 84 | if( self->m_full_update || self->m_has_control_id) |
| 85 | bs.StoreBits(16,self->m_input_ack); //target->m_input_ack |
| 86 | if(self->m_full_update) |
| 87 | { |
| 88 | for(int i=0; i<3; ++i) |
| 89 | bs.StoreFloat(self->m_entity_data.m_pos[i]); // server position |
| 90 | for(int i=0; i<3; ++i) |
| 91 | storeFloatConditional(bs,self->m_motion_state.m_velocity[i]); |
| 92 | |
| 93 | qCDebug(logPosition) << "position" << glm::to_string(self->m_entity_data.m_pos).c_str(); |
| 94 | qCDebug(logPosition) << "velocity" << glm::to_string(self->m_motion_state.m_velocity).c_str(); |
| 95 | } |
| 96 | } |
| 97 | void storeServerControlState(BitStream &bs,Entity *self) |
| 98 | { |
| 99 | bs.StoreBits(1,self->m_update_part_1); |
no test coverage detected