checks the presense of a group in the mask (maskbit) of a collision object * * Returns true if the specified group is set in the mask of a collision * object, false otherwise. * * @name physics.get_maskbit * @param url [type:string|hash|url] the collision object to check the mask of. * @param group [type:string] the name of the group to check for. * @return
| 1299 | * ``` |
| 1300 | */ |
| 1301 | static int Physics_GetMaskBit(lua_State* L) |
| 1302 | { |
| 1303 | DM_LUA_STACK_CHECK(L, 1); |
| 1304 | |
| 1305 | dmGameObject::HCollection collection = dmGameObject::GetCollection(CheckGoInstance(L)); |
| 1306 | CollisionComponent* comp = 0x0; |
| 1307 | CollisionWorld* comp_world = 0x0; |
| 1308 | GetCollisionObject(L, 1, collection, &comp, &comp_world); |
| 1309 | dmhash_t group_id = dmScript::CheckHashOrString(L, 2); |
| 1310 | |
| 1311 | bool boolvalue; |
| 1312 | if (! dmGameSystem::GetCollisionMaskBit(comp_world, comp, group_id, &boolvalue)) { |
| 1313 | return luaL_error(L, "Collision group not registered: %s.", dmHashReverseSafe64(group_id)); |
| 1314 | } |
| 1315 | lua_pushboolean(L, (int) boolvalue); |
| 1316 | return 1; |
| 1317 | } |
| 1318 | |
| 1319 | /*# |
| 1320 | * @name physics.SHAPE_TYPE_SPHERE |
nothing calls this directly
no test coverage detected