• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cpSpaceFree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cpSpaceFree函数的典型用法代码示例。如果您正苦于以下问题:C++ cpSpaceFree函数的具体用法?C++ cpSpaceFree怎么用?C++ cpSpaceFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cpSpaceFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: l_physics_gc

static int l_physics_gc(lua_State* state)
{
    l_physics_PhysicsData* physics = (l_physics_PhysicsData*)lua_touserdata(state, 1);
    cpSpaceFree(physics->physics->space);

    return 0;
}
开发者ID:dns,项目名称:CLove,代码行数:7,代码来源:physics.c


示例2: destroy

static void
destroy(void)
{
	cpBodyFree(staticBody);
	cpSpaceFreeChildren(space);
	cpSpaceFree(space);
}
开发者ID:18702515007xjy,项目名称:cocos2d,代码行数:7,代码来源:Tumble.c


示例3: cpSpaceRemoveShape

	Space::~Space() {
		for (auto& shape : shapes) {
			cpSpaceRemoveShape(space, *shape);
		}
		shapes.clear();
		cpSpaceFree(space);
	}
开发者ID:jhasse,项目名称:chipmunkpp,代码行数:7,代码来源:space.cpp


示例4: destroy

static void
destroy(void)
{
	cpBodyFree(rogueBoxBody);
	ChipmunkDemoFreeSpaceChildren(space);
	cpSpaceFree(space);
}
开发者ID:meiyunyang,项目名称:chipmunk-physics,代码行数:7,代码来源:Tumble.c


示例5: destroy

static void
destroy(void)
{
	cpBodyFree(tankControlBody);
	cpSpaceFreeChildren(space);
	cpSpaceFree(space);
}
开发者ID:hit1983,项目名称:cocos2d-iphone,代码行数:7,代码来源:Tank.c


示例6: destroy

static void
destroy(cpSpace *space)
{
	ChipmunkDemoFreeSpaceChildren(space);
	cpBodyFree(planetBody);
	cpSpaceFree(space);
}
开发者ID:Adefy,项目名称:AdefyiOS,代码行数:7,代码来源:Planet.c


示例7: eol_level_clear_layer_space

void eol_level_clear_layer_space(eolLevelLayer *layer)
{
  if (!layer)
  {
    return;
  }
  if (layer->space != NULL)
  {
    cpSpaceFree(layer->space);
  }
  layer->space = cpSpaceNew();
  if (layer->space == NULL)
  {
    eol_logger_message(
      EOL_LOG_ERROR,
      "Unable to create a physics space for new layer!");
    eol_level_delete_layer(layer);
    return;
  }
  layer->space->iterations = _eol_level_clip_iterations;
  layer->space->sleepTimeThreshold = 999999;
  cpSpaceSetEnableContactGraph(layer->space,eolTrue);
  cpSpaceSetCollisionSlop(layer->space, _eol_level_slop);
  cpSpaceSetCollisionBias(layer->space, _eol_level_bias);

}
开发者ID:engineerOfLies,项目名称:EngineOfLies,代码行数:26,代码来源:eol_level.c


示例8: eol_level_delete_layer

void eol_level_delete_layer(eolLevelLayer * level)
{
  eolBackground *b = NULL;
  GList *s,*e;
  eolSpawn *spawn;
  if (!level)return;
  
  eol_tile_map_free(&level->tileMap);
  
  for (s = level->spawnList; s != NULL; s = s->next)
  {
    if (!s->data)continue;
    spawn = (eolSpawn *)s->data;
    eol_spawn_free(&spawn);
  }
  s = NULL;
  g_list_free(level->spawnList);
  for (s = level->backgrounds; s != NULL; s = s->next)
  {
    if (s->data == NULL)continue;
    b = (eolBackground *)s->data;
    eol_model_free(&b->model);
    free(b);
  }
  s = NULL;
  g_list_free(level->backgrounds);

  for (e = level->entities;e != NULL;e = e->next)
  {
    eol_entity_remove_from_space(e->data);
  }
  g_list_free(level->entities);/*just free our pointers to em, they can delete themselves*/
  if (level->space != NULL)cpSpaceFree(level->space);
}
开发者ID:engineerOfLies,项目名称:EngineOfLies,代码行数:34,代码来源:eol_level.c


示例9: physics_thread

	static void physics_thread()
	{	
		/* Now initialize the physics engine. */
		cpInitChipmunk();
		space = cpSpaceNew();	
	
		do
		{
			/* But here we do care about the elapsed time. */
			synchronize(&oldtime /*,&server_elapsed*/);

			simple_lock(&physics_lock);

			physics(world, space);
			cpSpaceHashEach(space->activeShapes, &draw_player, NULL);
			//cpSpaceHashEach(space->staticShapes, &draw_static, NULL);

			simple_unlock(&physics_lock);

			if(to_remove_array.length > 0)
				lDestroy(&to_remove_array, remove_unused);
		}
		while(!physics_exit_time);

		lFree(&to_remove_array);
		cpSpaceFreeChildren(space);
		cpSpaceFree(space);	
	}
开发者ID:wormsparty,项目名称:beautiful-absurd-subtle,代码行数:28,代码来源:server.c


示例10: destroy

static void
destroy(void)
{
	cpSpaceFreeChildren(space);
	cpSpaceFree(space);
	
	cpArrayFree(platformInstance.passThruList);
}
开发者ID:9miao,项目名称:cocos2dx-win8,代码行数:8,代码来源:OneWay.cpp


示例11: lc_space_gc

int lc_space_gc(lua_State *vm){
    lc_space *space = lc_GetSpace(1, vm);
    cpSpaceFree(space->space);
    luaL_unref(vm, LUA_REGISTRYINDEX, space->bodies);
    luaL_unref(vm, LUA_REGISTRYINDEX, space->shapes);
    free(space);
    printf("Delete space: %p\n", lua_touserdata(vm, 1));
}
开发者ID:sixian,项目名称:lunatic-chipmunk,代码行数:8,代码来源:space.c


示例12: main

/*
 * main
 */
int main(int argc, char** argv) {


    espace=init();
    SDL_Event event;
    int continuer=1;
    SDL_Init(SDL_INIT_VIDEO);
    ecran=SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);


    
    //char* fichier_dico = "dico.txt";
    //algo_1(fichier_dico, "asdfarbre");
    if (ecran == NULL)
    {
        fprintf(stderr, "Erreur d'initialisation de la SDL");
        exit(EXIT_FAILURE);
    }
     
    SDL_WM_SetCaption("Letter Boule Game !", NULL);
    SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format,0,0,0));
    initPolice();
    initLesBoules(espace);
    boolean refresh=TRUE;
    while (continuer) {
        SDL_WaitEvent(&event);
        switch(event.type) {
            case SDL_QUIT: continuer = 0;
        }
        
        if(refresh)
        {
            affichage();
            refresh=FALSE;
        }    
        if(nbBoules==0)
    {
        SDL_Color white={255,255,255};
        SDL_Surface *game=TTF_RenderText_Solid(police,"GAME OVER" , white);
        SDL_Rect position_game;
        position_game.y=320;
        position_game.x=240;
        SDL_BlitSurface(game, NULL, ecran, &position_game);  
    }
        SDL_Flip(ecran);
        refresh=tracerLigne();
        
        SDL_Flip(ecran);
    }   
    
    cpSpaceFree(espace);
    TTF_CloseFont(police);
    TTF_Quit();
    SDL_Quit();
  
    return (EXIT_SUCCESS);
}
开发者ID:Hakall,项目名称:LetterBouleGame,代码行数:60,代码来源:main.c


示例13: destroyCPBody

void TestColliderDetector::onExit()
{
	destroyCPBody(armature2->getCPBody());
	destroyCPBody(bullet->getCPBody());
    
	cpSpaceFree(space);
    
	CCLayer::onExit();
}
开发者ID:chengstory,项目名称:CocoStudioSamples,代码行数:9,代码来源:TestColliderDetector.cpp


示例14: destroy

static void
destroy(void)
{
	cpBodyFree(staticBody);
	cpSpaceFreeChildren(space);
	cpSpaceFree(space);
	
	cpArrayFree(playerInstance.groundShapes);
}
开发者ID:18702515007xjy,项目名称:cocos2d,代码行数:9,代码来源:Player.c


示例15: world_destroy

void world_destroy(World_t *aWorld)
{
    llist_apply(aWorld->entities, (LinkedListApplier_t)&_removeEntityFromWorld, aWorld);
    aWorld->staticEntity->cpBody = NULL;
    world_removeEntity(aWorld, aWorld->staticEntity);
    cpSpaceFree(aWorld->cpSpace), aWorld->cpSpace = NULL;
    obj_release(aWorld->entities), aWorld->entities = NULL;
    obj_release(aWorld->staticEntity), aWorld->staticEntity = NULL;
}
开发者ID:fjolnir,项目名称:Dynamo,代码行数:9,代码来源:world.c


示例16: destroy_sample

/* Cleanup
 * -------
 *
 * Clean up is simple enough. Just destroy the tile
 * image and free the state structure memory.
 */
static void destroy_sample(void* data)
{
    struct state* state = data;
    cleanup_walls(state);
    cleanup_tiles(state);
    destroy_image(state->tile_img);
    cpBodyFree(state->mouse_body);
    cpSpaceFree(state->space);
    free(data);
}
开发者ID:rlofc,项目名称:cage,代码行数:16,代码来源:chipmunk.c


示例17: scene_destroy

void scene_destroy(Scene* scene) {
    cpSpaceFree(scene->space);

    // entities has to be first, because of relation with components
    pool_destroy(scene->entities);
    pool_destroy(scene->transforms);
    pool_destroy(scene->scripts);
    pool_destroy(scene->sprites);
    free(scene);
}
开发者ID:ifzz,项目名称:merriment,代码行数:10,代码来源:scene.c


示例18: removeAllJoints

PhysicsWorld::~PhysicsWorld()
{
    removeAllJoints(true);
    removeAllBodies();
    if (_cpSpace)
    {
        cpSpaceFree(_cpSpace);
    }
    CC_SAFE_DELETE(_debugDraw);
}
开发者ID:1414648814,项目名称:AStar-Cocos2dx,代码行数:10,代码来源:CCPhysicsWorld.cpp


示例19: cpShapeFree

ChipmunkTestLayer::~ChipmunkTestLayer()
{
    // manually Free rogue shapes
    for( int i=0;i<4;i++) {
        cpShapeFree( _walls[i] );
    }

    cpSpaceFree( _space );

}
开发者ID:0x0c,项目名称:cocos2d-x,代码行数:10,代码来源:ChipmunkTest.cpp


示例20: cpSpaceFree

 void CDynamics2DEngine::Destroy() {
    /* Empty the physics model map */
    for(CDynamics2DModel::TMap::iterator it = m_tPhysicsModels.begin();
        it != m_tPhysicsModels.end(); ++it) {
       delete it->second;
    }
    m_tPhysicsModels.clear();
    /* Get rid of the physics space */
    cpSpaceFree(m_ptSpace);
    cpBodyFree(m_ptGroundBody);
 }
开发者ID:hoelzl,项目名称:argos3,代码行数:11,代码来源:dynamics2d_engine.cpp



注:本文中的cpSpaceFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cpSpaceNew函数代码示例发布时间:2022-05-30
下一篇:
C++ cpSpaceAddShape函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap