<bdo id='ayHec'></bdo><ul id='ayHec'></ul>

      <i id='ayHec'><tr id='ayHec'><dt id='ayHec'><q id='ayHec'><span id='ayHec'><b id='ayHec'><form id='ayHec'><ins id='ayHec'></ins><ul id='ayHec'></ul><sub id='ayHec'></sub></form><legend id='ayHec'></legend><bdo id='ayHec'><pre id='ayHec'><center id='ayHec'></center></pre></bdo></b><th id='ayHec'></th></span></q></dt></tr></i><div id='ayHec'><tfoot id='ayHec'></tfoot><dl id='ayHec'><fieldset id='ayHec'></fieldset></dl></div>

    1. <small id='ayHec'></small><noframes id='ayHec'>

      1. <legend id='ayHec'><style id='ayHec'><dir id='ayHec'><q id='ayHec'></q></dir></style></legend>
        <tfoot id='ayHec'></tfoot>
      2. 在 cocos2d 中创建物理体

        creating Physic body in cocos2d(在 cocos2d 中创建物理体)
          <tbody id='TB8VC'></tbody>

          <bdo id='TB8VC'></bdo><ul id='TB8VC'></ul>
          • <small id='TB8VC'></small><noframes id='TB8VC'>

              <legend id='TB8VC'><style id='TB8VC'><dir id='TB8VC'><q id='TB8VC'></q></dir></style></legend>
                <tfoot id='TB8VC'></tfoot>

                <i id='TB8VC'><tr id='TB8VC'><dt id='TB8VC'><q id='TB8VC'><span id='TB8VC'><b id='TB8VC'><form id='TB8VC'><ins id='TB8VC'></ins><ul id='TB8VC'></ul><sub id='TB8VC'></sub></form><legend id='TB8VC'></legend><bdo id='TB8VC'><pre id='TB8VC'><center id='TB8VC'></center></pre></bdo></b><th id='TB8VC'></th></span></q></dt></tr></i><div id='TB8VC'><tfoot id='TB8VC'></tfoot><dl id='TB8VC'><fieldset id='TB8VC'></fieldset></dl></div>

                  本文介绍了在 cocos2d 中创建物理体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在 box2d 中创建物理身体,如下所示,这是我的代码

                  I am creating the physical body in box2d as below , this si my code

                   b2BodyDef carBodyDef;
                  carBodyDef.position.Set(x/PTM_RATIO,y/PTM_RATIO);
                  carBodyDef.type=b2_dynamicBody;    b2Body* carBody=physicsWorld->CreateBody(&carBodyDef);
                  
                  b2CircleShape carShape;
                  carShape.m_radius=rad/40.0f;
                  
                  
                  b2FixtureDef carFixture;
                  carFixture.shape=&carShape;
                  carFixture.density = 1.0f;
                  carFixture.friction = 0.0f;
                  
                  carBody->CreateFixture(&carFixture);
                  
                  return carBody ;
                  

                  当我运行应用程序时,它会崩溃,有以下错误*断言失败:(IsLocked() == false),函数 CreateBody,*in box2d

                  When am running the app, its getting crash , with the below erro *Assertion failed: (IsLocked() == false), function CreateBody,*in box2d

                  推荐答案

                  那是因为你在执行 b2WorldStep() 函数时创建了你的 body.执行此函数时无法创建新实体

                  That's because you are creating your body during execution of Step() function of b2World. You can't create new bodies while this function is executing

                  这篇关于在 cocos2d 中创建物理体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
                  <i id='fO2Wv'><tr id='fO2Wv'><dt id='fO2Wv'><q id='fO2Wv'><span id='fO2Wv'><b id='fO2Wv'><form id='fO2Wv'><ins id='fO2Wv'></ins><ul id='fO2Wv'></ul><sub id='fO2Wv'></sub></form><legend id='fO2Wv'></legend><bdo id='fO2Wv'><pre id='fO2Wv'><center id='fO2Wv'></center></pre></bdo></b><th id='fO2Wv'></th></span></q></dt></tr></i><div id='fO2Wv'><tfoot id='fO2Wv'></tfoot><dl id='fO2Wv'><fieldset id='fO2Wv'></fieldset></dl></div>
                    <tbody id='fO2Wv'></tbody>
                1. <tfoot id='fO2Wv'></tfoot>

                        <bdo id='fO2Wv'></bdo><ul id='fO2Wv'></ul>
                          <legend id='fO2Wv'><style id='fO2Wv'><dir id='fO2Wv'><q id='fO2Wv'></q></dir></style></legend>

                          <small id='fO2Wv'></small><noframes id='fO2Wv'>