Set whether the collider is a trigger 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 simulation collider. * @param isTrigger True if you want to set this collider as a trigger and false otherwise */
| 248 | * @param isTrigger True if you want to set this collider as a trigger and false otherwise |
| 249 | */ |
| 250 | void Collider::setIsTrigger(bool isTrigger) const { |
| 251 | mBody->mWorld.mCollidersComponents.setIsTrigger(mEntity, isTrigger); |
| 252 | |
| 253 | // The collider cannot be a simulation collider anymore |
| 254 | if (isTrigger && getIsSimulationCollider()) { |
| 255 | setIsSimulationCollider(false); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | // Return true if the collider can generate contacts for the simulation of the associated body |
| 260 | bool Collider::getIsSimulationCollider() const { |
nothing calls this directly
no outgoing calls
no test coverage detected