| 169 | /////////////////////////////////////////////////////////////////////////////////////////////// |
| 170 | |
| 171 | void BVHCompoundPruner::updateCompound(PrunerCompoundId compoundId, const PxTransform& transform) |
| 172 | { |
| 173 | const ActorIdPoolIndexMap::Entry* poolIndexEntry = mActorPoolMap.find(compoundId); |
| 174 | PX_ASSERT(poolIndexEntry); |
| 175 | |
| 176 | if(poolIndexEntry) |
| 177 | { |
| 178 | const PxU32 poolIndex = poolIndexEntry->second; |
| 179 | PxBounds3 localBounds; |
| 180 | const IncrementalAABBTreeNode* node = mCompoundTreePool.getCompoundTrees()[poolIndex].mTree->getNodes(); |
| 181 | mCompoundTreePool.getCompoundTrees()[poolIndex].mGlobalPose = transform; |
| 182 | V4StoreU(node->mBVMin, &localBounds.minimum.x); |
| 183 | PX_ALIGN(16, PxVec4) max4; |
| 184 | V4StoreA(node->mBVMax, &max4.x); |
| 185 | localBounds.maximum = PxVec3(max4.x, max4.y, max4.z); |
| 186 | const PxBounds3 compoundBounds = PxBounds3::transformFast(transform, localBounds); |
| 187 | mCompoundTreePool.getCurrentCompoundBounds()[poolIndex] = compoundBounds; |
| 188 | mChangedLeaves.clear(); |
| 189 | IncrementalAABBTreeNode* mainTreeNode = mMainTree.update(mMainTreeUpdateMap[poolIndex], poolIndex, mCompoundTreePool.getCurrentCompoundBounds(), mChangedLeaves); |
| 190 | // we removed node during update, need to update the mapping |
| 191 | updateMapping(poolIndex, mainTreeNode); |
| 192 | } |
| 193 | |
| 194 | #if PARANOIA_CHECKS |
| 195 | test(); |
| 196 | #endif |
| 197 | } |
| 198 | |
| 199 | /////////////////////////////////////////////////////////////////////////////////////////////// |
| 200 |
no test coverage detected