size_t LodConfigSerializer::calcLodConfigSize() { size_t size = calcChunkHeaderSize(); size += calcLodBasicInfoSize(); size += calcLodLevelsSize(); size += calcLodAdvancedInfoSize(); size += calcLodProfileSize(); return size; }
size_t LodConfigSerializer::calcLodAdvancedInfoSize() { size_t size = calcChunkHeaderSize(); // mLodConfig->advanced.useCompression size += sizeof(bool); // mLodConfig->advanced.useVertexNormals size += sizeof(bool); // mLodConfig->advanced.useBackgroundQueue size += sizeof(bool); // mLodConfig->advanced.outsideWeight size += sizeof(float); // mLodConfig->advanced.outsideWalkAngle size += sizeof(float); return size; }
size_t LodConfigSerializer::calcLodProfileSize() { if(mLodConfig->advanced.profile.empty()){ return 0; } // Vector3, LodProfile::ProfiledVertex::src size_t profiledVertexSize = sizeof(float) * 3; // Vector3, LodProfile::ProfiledVertex::dst profiledVertexSize += sizeof(float) * 3; // LodProfile::ProfiledVertex::cost profiledVertexSize += sizeof(float); size_t size = calcChunkHeaderSize(); // mLodConfig->advanced.profile->data.size() size += sizeof(uint32); size += profiledVertexSize * mLodConfig->advanced.profile.size(); return size; }
size_t LodConfigSerializer::calcLodLevelsSize() { //lodLevel.distance size_t levelSize = sizeof(float); //lodLevel.reductionMethod; levelSize += sizeof(Ogre::uint32); //lodLevel.reductionValue; levelSize += sizeof(float); size_t size = calcChunkHeaderSize(); // mLodConfig->levels.size() size += sizeof(Ogre::uint32); size += levelSize * mLodConfig->levels.size(); for(size_t i = 0; i < mLodConfig->levels.size(); i++) { size += calcStringSize(mLodConfig->levels[i].manualMeshName); } return size; }
void OgreMeshDeserializer::skipChunk(std::istream& stream) { stream.seekg(mCurrentstreamLen - calcChunkHeaderSize(), std::ios_base::cur); }