Ejemplo n.º 1
0
bool NetworkEventHandler::HandleOSNE_AgentMovementComplete(ProtocolUtilities::NetworkEventInboundData* data)
{
    ProtocolUtilities::NetInMessage &msg = *data->message;
    msg.ResetReading();

    RexUUID agentid = msg.ReadUUID();
    RexUUID sessionid = msg.ReadUUID();

//    if (agentid == rexlogicmodule_->GetServerConnection()->GetInfo().agentID &&
//    sessionid == rexlogicmodule_->GetServerConnection()->GetInfo().sessionID)
    {
        Vector3 position = msg.ReadVector3(); 
        Vector3 lookat = msg.ReadVector3();

        assert(rexlogicmodule_->GetAvatarControllable() && "Handling agent movement complete event before avatar controller is created.");
        rexlogicmodule_->GetAvatarControllable()->HandleAgentMovementComplete(
            OpenSimToOgreCoordinateAxes(position), OpenSimToOgreCoordinateAxes(lookat));

        /// \todo tucofixme, what to do with regionhandle & timestamp?
        uint64_t regionhandle = msg.ReadU64();
        uint32_t timestamp = msg.ReadU32(); 
    }

    rexlogicmodule_->GetServerConnection()->SendAgentSetAppearancePacket();
    return false;
}
Ejemplo n.º 2
0
    Vector3df GetProcessedScaledVectorFromUint16(const uint8_t* bytes, float scale)
    {
        uint16_t *vec = reinterpret_cast<uint16_t*>((uint16_t*)&bytes[0]);
        
        Vector3df resultvector;
        resultvector.x = scale * ((vec[0] / 32768.0f) - 1.0f);
        resultvector.y = scale * ((vec[1] / 32768.0f) - 1.0f);
        resultvector.z = scale * ((vec[2] / 32768.0f) - 1.0f);

        return OpenSimToOgreCoordinateAxes(resultvector);        
    }
Ejemplo n.º 3
0
    Vector3df GetProcessedVector(const uint8_t* bytes)
    {
        Vector3df resultvector = *reinterpret_cast<Vector3df*>((Vector3df*)&bytes[0]);

        return OpenSimToOgreCoordinateAxes(resultvector);  
    }
Ejemplo n.º 4
0
    Vector3df GetProcessedVectorFromUint16(const uint8_t* bytes)
    {
        uint16_t *vec = reinterpret_cast<uint16_t*>((uint16_t*)&bytes[0]);

        return OpenSimToOgreCoordinateAxes(Vector3df(vec[0],vec[1],vec[2]));    
    }