physics-engine

Fixing two box2D bodies together securely

我的未来我决定 提交于 2019-12-02 06:25:23
I am trying to join two box2d bodies together that are separated over a fixed distance. Both bodies cannot rotate themselves, and the join should have to rotation either. The gap between the bodies needs to allow other bodies to pass through. I currently have a b2revoluteJoint setup like so: b2RevoluteJointDef rjd; rjd.lowerAngle = 0.0f; rjd.upperAngle = 0.0f; rjd.Initialize(body2, body1, body2->GetPosition()); rjd.collideConnected = false; world->CreateJoint(&rjd); However the joint is not completely rigid and the bodies tend to move around a fair bit relative to each other. Is there a better

SceneKit SCNPhysicsBody get notified of resting

痴心易碎 提交于 2019-12-02 06:24:59
SceneKit Is there a way to get notified when dynamicBody is in resting State ? I want to remove dynamicBody when it finished to fall to the ground and stopped moving completely - I presume that I will have quite large amount of those so I would like to use something event based rather than looping through all the bodies and checking their velocities ? Hal Mueller You could use Key-Value Observation on the isResting property. See Is key-value observation (KVO) available in Swift? . Or you could use the SCNPhysicsContact and SCNPhysicsContactDelegate to detect collisions with the floor, and use

physics engine - phase order and other general information

扶醉桌前 提交于 2019-12-02 04:46:00
I want to build my own 2D mini-physics engine, that will include(for now) rigid bodys, and constraints (joints, contacts, springs...). And I've tried to figure out what is the right order of the phases, when I start a timestep, when the the general phases are: Broadphase, Narrow phase(Collision Detection, and Contact generation), Resolution (Constraints Solver), and the Integration - hope you can tell me the right order. I allso have general questions about each phase: Narrow Phase - When I've found a collision do I need to seperate the bodies after I've found the collision or just apply an

Are there any decent physics engines for Android? [closed]

狂风中的少年 提交于 2019-11-28 17:05:28
I've looked around for a physics engine that will play nicely with Android, but I've only been disappointed. In terms of performance, I had heard that jbox2d was the best bet, but (from my understanding) ever since Android SDK V1.0, the Dalvik VM's verifier has become very strict and rejects some of the key classes and refuses to run. This problem persists after using the dx tool (although I might be using the tool improperly). I know that the AndroidBox2D porting project exists to optimize jbox2d for the Android garbage collector, but the project page doesn't have any downloads and the gpl

Is there an upper limit on velocity when using box2d?

断了今生、忘了曾经 提交于 2019-11-28 13:23:51
I'm using box2d for physics simulation. I'm moving a circle using arrow keys by applying impulse on the body when ever a key is pressed. Unfortunately, the circle moves excruciatingly slow and doesn't seem to accelerate like a true physical body is supposed to. My world's dimensions are 400x800 pixels. The radius of the circle body is 20f. According to this , the problem can be solved by scaling the circle radius down when creating it and scaling up after getting the body position during painting. It doesn't seem to make any difference at all. Is there some step or setting I'm missing here ?

Slick2D and JBox2D. How to draw

与世无争的帅哥 提交于 2019-11-27 11:30:29
Before asking this i did A LOT of searching on the net. I just can't do it. It's a little hard for me to understand. So how do i draw the images at the right screen positions coresponding to bodies in world position? Thanx. If anyone else finds himslef in front of the same obstacle i posted a HOW TO, thanx to normalocity's good explanation. You can find it here: http://romeo.akademx.ro/2012/04/06/slick-and-box2d/ This is the render function: public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException { g.setBackground(Color.white); g.pushTransform(); g

Are there any decent physics engines for Android? [closed]

我们两清 提交于 2019-11-27 10:23:06
问题 I've looked around for a physics engine that will play nicely with Android, but I've only been disappointed. In terms of performance, I had heard that jbox2d was the best bet, but (from my understanding) ever since Android SDK V1.0, the Dalvik VM's verifier has become very strict and rejects some of the key classes and refuses to run. This problem persists after using the dx tool (although I might be using the tool improperly). I know that the AndroidBox2D porting project exists to optimize