コード例 #1
0
ファイル: GLMHelpers.cpp プロジェクト: disigma/hifi
int packFloatVec3ToSignedTwoByteFixed(unsigned char* destBuffer, const glm::vec3& srcVector, int radix) {
    const unsigned char* startPosition = destBuffer;
    destBuffer += packFloatScalarToSignedTwoByteFixed(destBuffer, srcVector.x, radix);
    destBuffer += packFloatScalarToSignedTwoByteFixed(destBuffer, srcVector.y, radix);
    destBuffer += packFloatScalarToSignedTwoByteFixed(destBuffer, srcVector.z, radix);
    return destBuffer - startPosition;
}
コード例 #2
0
ファイル: Referential.cpp プロジェクト: CoderPaulK/hifi
int Referential::pack(unsigned char* destinationBuffer) const {
    unsigned char* startPosition = destinationBuffer;
    *destinationBuffer++ = (unsigned char)_type;
    memcpy(destinationBuffer, &_version, sizeof(_version));
    destinationBuffer += sizeof(_version);
    
    destinationBuffer += packFloatVec3ToSignedTwoByteFixed(destinationBuffer, _translation, 0);
    destinationBuffer += packOrientationQuatToBytes(destinationBuffer, _rotation);
    destinationBuffer += packFloatScalarToSignedTwoByteFixed(destinationBuffer, _scale, 0);
    return destinationBuffer - startPosition;
}