MCPcopy Create free account
hub / github.com/defold/defold / Physics_Wakeup

Function Physics_Wakeup

engine/gamesys/src/gamesys/scripts/script_physics.cpp:1175–1187  ·  view source on GitHub ↗

Wake up a collisionobject component explicitly wakeup a collision object * * Collision objects tend to fall asleep when inactive for a small period of time for * efficiency reasons. This function wakes them up. * * @name physics.wakeup * @param url [type:string|hash|url] the collision object to wake. * ```lua * function on_input(self, action_id, action)

Source from the content-addressed store, hash-verified

1173 * ```
1174 */
1175 static int Physics_Wakeup(lua_State* L)
1176 {
1177 DM_LUA_STACK_CHECK(L, 0);
1178
1179 dmGameObject::HCollection collection = dmGameObject::GetCollection(CheckGoInstance(L));
1180 CollisionComponent* comp = 0x0;
1181 CollisionWorld* comp_world = 0x0;
1182 GetCollisionObject(L, 1, collection, &comp, &comp_world);
1183
1184 dmGameSystem::WakeupCollision(comp_world, comp);
1185
1186 return 0;
1187 }
1188
1189 /*# change the group of a collision object
1190 *

Callers

nothing calls this directly

Calls 4

GetCollectionFunction · 0.85
CheckGoInstanceFunction · 0.85
WakeupCollisionFunction · 0.85
GetCollisionObjectFunction · 0.70

Tested by

no test coverage detected