コード例 #1
0
ファイル: MOAICpSpace.cpp プロジェクト: Heyzap/moai-dev
/**	@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;
}
コード例 #2
0
ファイル: cpSpace.c プロジェクト: harad/Last-Escape
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);
}
コード例 #3
0
ファイル: cpSpace.c プロジェクト: harad/Last-Escape
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;
}
コード例 #4
0
ファイル: Espacio.c プロジェクト: segafan/bennugd-monolithic
 int modcpSpaceActivateShapesTouchingShape(INSTANCE * my, int * params)
{
    cpSpaceActivateShapesTouchingShape(cpEspacio,( cpShape * ) params[0]);
    return 0;
}
コード例 #5
0
ファイル: Space.cpp プロジェクト: Marwes/CppChipmunk
void Space::activateShapesTouchingShape(cp::Shape *shape)
{
		cpSpaceActivateShapesTouchingShape(space,shape ? shape->get() : 0);
}