returns the group of a collision object * * Returns the group name of a collision object as a hash. * * @name physics.get_group * @param url [type:string|hash|url] the collision object to return the group of. * @return group [type:hash] hash value of the group. * ```lua * local function check_is_enemy() * local group = physics.get_group("#collisiono
| 1233 | * ``` |
| 1234 | */ |
| 1235 | static int Physics_GetGroup(lua_State* L) |
| 1236 | { |
| 1237 | DM_LUA_STACK_CHECK(L, 1); |
| 1238 | |
| 1239 | dmGameObject::HCollection collection = dmGameObject::GetCollection(CheckGoInstance(L)); |
| 1240 | CollisionComponent* comp = 0x0; |
| 1241 | CollisionWorld* comp_world = 0x0; |
| 1242 | GetCollisionObject(L, 1, collection, &comp, &comp_world); |
| 1243 | |
| 1244 | dmhash_t group_hash = dmGameSystem::GetCollisionGroup(comp_world, comp); |
| 1245 | dmScript::PushHash(L, group_hash); |
| 1246 | |
| 1247 | return 1; |
| 1248 | } |
| 1249 | |
| 1250 | /*# updates the mask of a collision object |
| 1251 | * |
nothing calls this directly
no test coverage detected