box2d

Libgdx Box2D Velocity is just not fast enough

南笙酒味 提交于 2020-01-15 06:23:59
问题 I have a rectangle that I would like to move fast but for what ever reason the faster velocity I use still seems slow. What am I doing wrong? I have also dropped a circle from above onto a surface and even tough I play with gravity it comes down like a ballon... Some declarations float velocity = 10000000f; static final float BOX_STEP=1/60f; static final int BOX_VELOCITY_ITERATIONS=6; static final int BOX_POSITION_ITERATIONS=2; Gravity, tried everything and they all seem to suck world = new

Libgdx Box2D smooth angular rotation

荒凉一梦 提交于 2020-01-14 06:40:09
问题 I'm currently developing a flying game in libgdx where you can control the rotation of a bird with the mouse cursor. Right now the bird will instantly rotate to the cursor position. I'm aiming to make the bird rotation lag behind a little bit to make the flying seem more smooth. Rotational damping wont work because i am using the setTransform() method. I would be very happy about any suggestions, this is the code controlling the rotation, it's called every frame in the render method: //get

Typedef redefinition (C2371) for uint32 in two 3rd-party libraries

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 18:58:51
问题 In my application I am using Box2D and Spidermonkey. Both libraries are defining the type uint32, which obviously gives me a compiler-error when using both in the same compilation unit. b2settings.h (Box2D): typedef unsigned int uint32; jsotypes.h (Spidermonkey): typedef unsigned long uint32; Is there any way to resolve this collision without needing to change the headers of the 3rd-party libraries? I am thankful for every hint! 回答1: You can do this hack: #define uint32 Box2D_uint32 #include

Typedef redefinition (C2371) for uint32 in two 3rd-party libraries

末鹿安然 提交于 2020-01-13 18:58:06
问题 In my application I am using Box2D and Spidermonkey. Both libraries are defining the type uint32, which obviously gives me a compiler-error when using both in the same compilation unit. b2settings.h (Box2D): typedef unsigned int uint32; jsotypes.h (Spidermonkey): typedef unsigned long uint32; Is there any way to resolve this collision without needing to change the headers of the 3rd-party libraries? I am thankful for every hint! 回答1: You can do this hack: #define uint32 Box2D_uint32 #include

AttributeError: module '_Box2D' has no attribute 'RAND_LIMIT_swigconstant'

此生再无相见时 提交于 2020-01-13 17:01:07
问题 I am trying to run a lunar_lander on reinforcement learning, but when I run it, it occurs an error. Plus my computer is osx system. Here is the code of lunar lander: import numpy as np import gym import csv from keras.models import Sequential from keras.layers import Dense, Activation, Flatten from keras.optimizers import Adam from rl.agents.dqn import DQNAgent from rl.policy import BoltzmannQPolicy, EpsGreedyQPolicy from rl.memory import SequentialMemory import io import sys import csv #

Rolling a circle around a square

我与影子孤独终老i 提交于 2020-01-13 12:16:28
问题 After almost a month I am still stuck on this issue I managed to decide whether the circles (or pedestrians as I call them) should move left/right or up/down but I need to have the possibility to move the pedestrians around a building (that means they have to turn on the corners, basically does not matter whether direction, they just need to turn by 90 degrees Thank you very much import numpy as np import random import keyboard from Box2D.b2 import world, polygonShape, circleShape, edgeShape,

Cocos2D-x - Issues when with using CCFollow

左心房为你撑大大i 提交于 2020-01-13 06:58:08
问题 I've got a problem with CCFollow in Cocos2D-X. I want to follow my a Sprite, which is referred to a Box2D-Body. When i call this->runAction(CCFollow::create(playerSprite)); in the init method of my GameLayer, the lower left corner of my usual screen is centered on my device and although the emulator. May anyone help me with this issue ? :/ Best Regards, stotheg 回答1: ССFollow is often not enough for your own purposes. One way out of this situation is to create your custom ССFollow action or

Strange “stutter” in box2D on different android devices

余生长醉 提交于 2020-01-13 03:54:15
问题 I'm developing an engine and a game at the same time in C++ and I'm using box2D for the physics back end. I'm testing on different android devices and on 2 out of 3 devices, the game runs fine and so do the physics. However, on my galaxy tab 10.1 I'm sporadically getting a sort of "stutter". Here is a youtube video demonstrating: http://www.youtube.com/watch?v=DSbd8vX9FC0 The first device the game is running on is an Xperia Play... the second device is a Galaxy Tab 10.1. Needless to say the

使用Doxygen来生成Box2d的API文档

百般思念 提交于 2020-01-10 15:53:43
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 对于Doxygen以前只听别人说过,而现在使用它也是一个偶然,缘分吧。 前两天看box2d的官方sdk中,发现他有用户手册却没有说明,只是留下了一个Doxygen的文件。事情告一段落,然后今天在看box2d的例子的时候发现他的函数里都有注释即对函数的使用说明,这才让我想起了Doxygen,有了它,可以轻松生成自己最喜欢的chm格式的API文档。而且网上的api文档不好找。 csdn的教程链接 : http://blog.csdn.net/flyoxs/article/details/7558175 这是给大家参考的至于今天我就给大家一个例子,用doxygen生成Box2d的api文档。 先下载doxygen的向导程序doxygenwizard,然后安装,操作如下 下载地址可以到上面的csdn博客中查找网址。 file->open->box2d(你的box2d目录)/documention->选择doxygen的文件打开,随便点几个选项想发现人家已经帮你配置好了,这里我们直接生成。 run->run doxygen。等一会就会生成一堆html。这里认为html已经满足需要的就不用往下面看了。 如下图: 但是html格式不是我想要的,我需要的是一个pdf文档和chm文档所以需要进行下面的步骤: 点击wizard-

Cocos2d Box2D之动态刚体

那年仲夏 提交于 2020-01-08 01:47:11
| 版权声明:本文为博主原创文章,未经博主允许不得转载。 b2_dynamicBody 动态物体可以进行全模拟。用户可以用手手动移动动态刚体,也可以由动态刚体自己受力而自运动。动态物体可以和任何物体发生碰撞,拥有有限的非零质量。当设置动态物体的质量为零,那么动态刚体它会自动设置一个1千克质量的物体,而不会质量为0,在Box2D中物体总是刚体。动态Body也就是在物理世界中受力的运动的物体。 add BodyDef set bodyDef gravity set Linear Velocity *. 如果需要横向移动的话,只需要将b2Vec2(x,y)中的x!=0即可 来源: https://www.cnblogs.com/geore/p/5799829.html