//多边形的点:Point verts1[] = { Point(-146.5f,155.1f),Point(-146.5f,-87.6f),Point(-140.9f,-88.1f),Point(-140.8f,155.5f),Point(162.8f,154.6f),Point(162.9f,-27.7f),Point(12.0f,-29.0f),-33.9f),Point(167.6f,-34.6f),Point(168.7f,154.4f),Point(235.0f,Point(235.3f,-91.6f),Point(238.8f,-93.2f),Point(239.8f,-91.5f),Point(239.1f,159.2f),Point(-238.3f,159.0f),Point(-238.7f,155.0f),Point(-147.4f,154.9f) };auto spEdgepolygon1 = Sprite::create("HelloWorld.png");spEdgepolygon1->setTag(1);//创建多边形刚体auto borderUpper = PhysicsBody::createEdgepolygon(verts1,18);spEdgepolygon1->setPhysicsBody(borderUpper);spEdgepolygon1->setposition(Point(visibleSize.wIDth/2,visibleSize.height/2));this->addChild(spEdgepolygon1);总结
以上是内存溢出为你收集整理的cocos2dx 3.x版本多边形刚体全部内容,希望文章能够帮你解决cocos2dx 3.x版本多边形刚体所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)