/** @name activateShapesTouchingShape @text Activates shapes that are currently touching the specified shape. @in MOAICpSpace self @in MOAICpShape shape @out nil */ int MOAICpSpace::_activateShapesTouchingShape ( lua_State* L ) { MOAI_LUA_SETUP ( MOAICpSpace, "UU" ) MOAICpShape* shape = state.GetLuaObject < MOAICpShape >( 2, true ); if ( shape && shape->mShape ) { cpSpaceActivateShapesTouchingShape ( self->mSpace, shape->mShape ); } return 0; }
void cpSpaceRemoveStaticShape(cpSpace *space, cpShape *shape) { cpAssertWarn(cpHashSetFind(space->staticShapes->handleSet, shape->hashid, shape), "Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)"); cpAssertSpaceUnlocked(space); removalContext context = {space, shape}; cpHashSetFilter(space->contactSet, (cpHashSetFilterFunc)contactSetFilterRemovedShape, &context); cpSpaceHashRemove(space->staticShapes, shape, shape->hashid); cpSpaceActivateShapesTouchingShape(space, shape); }
cpShape * cpSpaceAddStaticShape(cpSpace *space, cpShape *shape) { cpAssert(!cpHashSetFind(space->staticShapes->handleSet, shape->hashid, shape), "Cannot add the same static shape more than once."); cpAssertSpaceUnlocked(space); if(!shape->body) shape->body = &space->staticBody; cpShapeCacheBB(shape); cpSpaceActivateShapesTouchingShape(space, shape); cpSpaceHashInsert(space->staticShapes, shape, shape->hashid, shape->bb); return shape; }
int modcpSpaceActivateShapesTouchingShape(INSTANCE * my, int * params) { cpSpaceActivateShapesTouchingShape(cpEspacio,( cpShape * ) params[0]); return 0; }
void Space::activateShapesTouchingShape(cp::Shape *shape) { cpSpaceActivateShapesTouchingShape(space,shape ? shape->get() : 0); }