| 487 | } |
| 488 | |
| 489 | void BodySim::setActive(bool active, PxU32 infoFlag) |
| 490 | { |
| 491 | PX_ASSERT(!active || isDynamicRigid()); // Currently there should be no need to activate an actor that does not take part in island generation |
| 492 | |
| 493 | const PxU32 asPartOfCreation = infoFlag & ActorSim::AS_PART_OF_CREATION; |
| 494 | if (asPartOfCreation || isActive() != active) |
| 495 | { |
| 496 | PX_ASSERT(!asPartOfCreation || (getActorInteractionCount() == 0)); // On creation or destruction there should be no interactions |
| 497 | |
| 498 | if (active) |
| 499 | { |
| 500 | if (!asPartOfCreation) |
| 501 | { |
| 502 | // Inactive => Active |
| 503 | getScene().addToActiveBodyList(*this); |
| 504 | } |
| 505 | |
| 506 | activate(); |
| 507 | |
| 508 | PX_ASSERT(asPartOfCreation || isActive()); |
| 509 | } |
| 510 | else |
| 511 | { |
| 512 | if (!asPartOfCreation) |
| 513 | { |
| 514 | // Active => Inactive |
| 515 | getScene().removeFromActiveBodyList(*this); |
| 516 | } |
| 517 | |
| 518 | deactivate(); |
| 519 | |
| 520 | PX_ASSERT(asPartOfCreation || (!isActive())); |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | void BodySim::wakeUp() |
| 526 | { |
no test coverage detected