| 165 | #define PX_BVH_STRUCTURE_VERSION 1 |
| 166 | |
| 167 | bool BVHStructureBuilder::save(PxOutputStream& stream, bool endian) const |
| 168 | { |
| 169 | // write header |
| 170 | if(!writeHeader('B', 'V', 'H', 'S', PX_BVH_STRUCTURE_VERSION, endian, stream)) |
| 171 | return false; |
| 172 | |
| 173 | // write mData members |
| 174 | writeDword(mNumVolumes, endian, stream); |
| 175 | writeDword(mNumNodes, endian, stream); |
| 176 | |
| 177 | // write indices and bounds |
| 178 | for(PxU32 i = 0; i < mNumVolumes; i++) |
| 179 | { |
| 180 | writeDword(mIndices[i], endian, stream); |
| 181 | } |
| 182 | |
| 183 | for(PxU32 i = 0; i < mNumVolumes; i++) |
| 184 | { |
| 185 | writeFloatBuffer(&mBounds[i].minimum.x, 3, endian, stream); |
| 186 | writeFloatBuffer(&mBounds[i].maximum.x, 3, endian, stream); |
| 187 | } |
| 188 | |
| 189 | // write nodes |
| 190 | for(PxU32 i = 0; i < mNumNodes; i++) |
| 191 | { |
| 192 | writeDword(mNodes[i].mData, endian, stream); |
| 193 | |
| 194 | writeFloatBuffer(&mNodes[i].mBV.minimum.x, 3, endian, stream); |
| 195 | writeFloatBuffer(&mNodes[i].mBV.maximum.x, 3, endian, stream); |
| 196 | } |
| 197 | |
| 198 | return true; |
| 199 | } |
| 200 | |
| 201 | void BVHStructureBuilder::moveData(Gu::BVHStructureData& bvhData) |
| 202 | { |
no test coverage detected