Make the physics system aware of an object @param e the entity to add */
| 176 | @param e the entity to add |
| 177 | */ |
| 178 | void PhysicsSolver::Spawn(Ref<Entity> e){ |
| 179 | if (e->Components().HasComponentOfSubclass<PhysicsBodyComponent>()) { |
| 180 | auto actor = e->Components().GetComponentOfSubclass<PhysicsBodyComponent>(); |
| 181 | actor->rigidActor->userData = actor.get(); |
| 182 | scene->addActor(*(actor->rigidActor)); |
| 183 | |
| 184 | //set filtering on the actor if its filtering is not disabled |
| 185 | if (actor->filterGroup != -1 && actor->filterMask != -1) { |
| 186 | setupFiltering(actor->rigidActor, actor->filterGroup, actor->filterMask); |
| 187 | } |
| 188 | |
| 189 | //add to the scene list |
| 190 | objects.push_back(actor); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | Remove the entity from the physics system. This does NOT destroy it in the World. |
nothing calls this directly
no test coverage detected