Problem with rotation

Results 1 to 3 of 3
  1. #1
    Registered ivanlamega is offline
    MemberRank
    Aug 2017 Join Date
    15Posts

    Problem with rotation

    Does anyone know how the dbo client sends the rotation to the server? , the problem is that if the value is in a range less than PI, the value is correct even though the value is between PI, but if the value is greater than PI, then the value is enclosed within 315 degress and 400 degress more or less.


  2. #2
    Newbie Nady93 is offline
    MemberRank
    Jun 2014 Join Date
    2Posts

    Re: Problem with rotation

    This is how you get direction from client:
    Code:
    struct VectorNtlShort{
        SHORT x;    
        SHORT y;    
        SHORT z;    
        
        void getVector3Ntl(Vector3Short &vector) const {        
            SHORT newX = x & 0x3FFF ^ 0x3FFF;        
            vector.x = static_cast<SHORT>((x & (1 << 15) ? -newX : x) / 10000.f);        
            SHORT newY = y & 0x3FFF ^ 0x3FFF;        
            vector.y = static_cast<SHORT>((y & (1 << 15) ? -newY : y) / 10000.f);
            SHORT newZ = z & 0x3FFF ^ 0x3FFF; 
            vector.z = static_cast<SHORT>((z & (1 << 15) ? -newZ : z) / 10000.f);   
        }
    }
    Client sometimes want same weird format back. "Encrypted" direction should have values -1 ~ +1

  3. #3
    Registered ivanlamega is offline
    MemberRank
    Aug 2017 Join Date
    15Posts

    Re: Problem with rotation

    How did you know that the client encrypted the direction?



Advertisement