GameConnection::readPacket question
by William Todd Scott · in Torque Game Engine · 01/14/2007 (7:53 am) · 2 replies
Hi,
I am continuing my quest to get my arms around Torque's networking and I have run into a part that I don't quite understand.
In GameConnection::readPacket there is this snippet of code.
Can someone explain to me what this is doing? It seems that the control object's position is being sent and read, but not used. I say this because, in the above code, pos goes out of scope and getCompresionPoint() never seems to be called.
I'm also not clear why gameconnection would write the position of the control object instead of the control object doing its own read/write of its position.
Thanks
Todd
I am continuing my quest to get my arms around Torque's networking and I have run into a part that I don't quite understand.
In GameConnection::readPacket there is this snippet of code.
else
{
// read out the compression point
Point3F pos;
bstream->read(&pos.x);
bstream->read(&pos.y);
bstream->read(&pos.z);
bstream->setCompressionPoint(pos);
}Can someone explain to me what this is doing? It seems that the control object's position is being sent and read, but not used. I say this because, in the above code, pos goes out of scope and getCompresionPoint() never seems to be called.
I'm also not clear why gameconnection would write the position of the control object instead of the control object doing its own read/write of its position.
Thanks
Todd
#2
01/14/2007 (1:24 pm)
I'm fairly sure it's an optimization technique used in bitstream compression, but quite honestly I'm not sure of the mechanics.
Torque Owner Stefan Lundmark