Jason Campbell Posted March 21, 2017 Author Posted March 21, 2017 Ok this seems to work so far but is this a bad idea?I noticed this in some of the rotation calculations// Constrain the range of mRot.z while (mRot.z < 0.0f) mRot.z += M_2PI_F; while (mRot.z > M_2PI_F) mRot.z -= M_2PI_F; So I figured it wasn't making it to the writeFloat.Is this a stupid idea, I placed it right before the writeFloat like so... // // constrain the range of mRot.z while (mRot.z < 0.0f) mRot.z += M_2PI_F; while (mRot.z > M_2PI_F) mRot.z -= M_2PI_F; stream->writeFloat(mRot.z / M_2PI_F, 7); Seems to work without throwing all those other errors...so far.Thanks Quote
Azaezel Posted March 21, 2017 Posted March 21, 2017 yeah, that'd be the generally accepted pre-compression step. just remember on the out end to re-multiply it by that same M_2PI_F. https://github.com/GarageGames/Torque3D/pull/1358/files uses the same principle. Quote
Jason Campbell Posted March 21, 2017 Author Posted March 21, 2017 I was excited for a second. I think I understand what you are saying. I didn't apply the division, that was already there, I just re-applied the constraint right before the writeFloat. Should I endeavor to find out why that constraint isn't making it to where (mRot.z / M_2PI_F) is being written?It was herehttps://github.com/GarageGames/Torque3D/blob/7185d9664d7ee8c0469014acce9caad6d1380ea2/Engine/source/T3D/player.cpp#L2625-L2629and herehttps://github.com/GarageGames/Torque3D/blob/7185d9664d7ee8c0469014acce9caad6d1380ea2/Engine/source/T3D/player.cpp#L2705-L2709 Quote
Azaezel Posted March 21, 2017 Posted March 21, 2017 See what you're saying... It'd likely be a good idea to track it further if time allows most likely, given that if you're introducing the rotation clamp in the pack/unpack, 10-1 on the server end it aint in a proper range to begin with... Quote
Azaezel Posted March 21, 2017 Posted March 21, 2017 Waaaaitaminute....stream->writeFloat(mRot.z / M_2PI_F, 7);? not stream->writeSignedFloat(mRot.z / M_2PI_F, 7); ? Quote
Jason Campbell Posted March 21, 2017 Author Posted March 21, 2017 Could that be a problem? original player.cpp does not have the Signed designation. Quote
Azaezel Posted March 21, 2017 Posted March 21, 2017 hrm... while>0 checks earlier. no sorry, misfire on my part. Quote
Jason Campbell Posted March 30, 2017 Author Posted March 30, 2017 I just wanted to thank you for your help Az. So far so good. I'm sure 4.0 will be another story, if I even attempt to port it whenever it arrives. Anyway thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.