MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / Spawn

Method Spawn

src/PhysicsSolver.cpp:178–192  ·  view source on GitHub ↗

Make the physics system aware of an object @param e the entity to add */

Source from the content-addressed store, hash-verified

176 @param e the entity to add
177 */
178void 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.

Callers

nothing calls this directly

Calls 4

setupFilteringFunction · 0.85
getMethod · 0.45
addActorMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected