Set whether the collider can generate contacts for the simulation of the associated body Note that a collider cannot be a simulation collider and a trigger at the same time. If you set this to true, this collider will stop being a trigger. * @param isSimulationCollider True if this collider can generate contacts for the simulation of the * associated body. */
| 269 | * associated body. |
| 270 | */ |
| 271 | void Collider::setIsSimulationCollider(bool isSimulationCollider) const { |
| 272 | |
| 273 | mBody->mWorld.mCollidersComponents.setIsSimulationCollider(mEntity, isSimulationCollider); |
| 274 | |
| 275 | if (isSimulationCollider) { |
| 276 | |
| 277 | mBody->mWorld.mBodyComponents.setHasSimulationCollider(mBody->getEntity(), true); |
| 278 | } |
| 279 | else { |
| 280 | mBody->updateHasSimulationCollider(); |
| 281 | } |
| 282 | |
| 283 | // The collider cannot be a trigger anymore |
| 284 | if (isSimulationCollider && getIsTrigger()) { |
| 285 | setIsTrigger(false); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // Return true if the collider will be part of results of queries on the PhysicsWorld |
| 290 | bool Collider::getIsWorldQueryCollider() const { |