physics-engine

What is wrong with my code PhysicsRemoveExample.java (AndEngine)?

北城以北 提交于 2019-12-10 20:19:19
问题 Trying to make the example PhysicsRemoveExample.java from here. I get this message when the program starts: Sorry! The application PhysicsRemoveExample(process org.anddev.andengine.PhysicsRemoveExample) has stopped unexpectedly. Please try again. I have Build Path andengine.jar and andenginephysicsbox2dextension.jar assets/gfx -> face_box_tiled.png and face_circle_tiled.png . This is my Java code in PhysicsRemoveExample.java . Same as in the example, though I have changed to extends

Robot Model drops off the floor after running the simulation

拟墨画扇 提交于 2019-12-10 18:51:54
问题 I imported a model in webots simulation from URDFs in ROS. The robot is a tricycle drive with 3 castor wheels. I have followed the wheel style as in the webots style guide and changed accordingly. My problem is that when I run the simulation the robot's wheels drops off the floor and is not able to move. Just chassis is on the floor and the wheels hangs down. 回答1: Your robot is probably too heavy for the physics configuration. You can fix this by changing the fields values of the WorldInfo

2D Physics Engine: bouncing ball w/ inelastic collisions does not come to a stop

做~自己de王妃 提交于 2019-12-07 07:35:19
问题 I've created a simple 2d physics engine in Java that uses circular projectiles and straight walls. Currently, with each frame, every projectile's position is advanced by velocity * (1/fps) . Velocity is updated afterwards, once per frame. Collision detection defines a line in point-slope form using the previous and current position, checks if that line intersects with a wall, and if that intersection lies in between the previous position and current position, a collision is registered and the

2D Physics Engine: bouncing ball w/ inelastic collisions does not come to a stop

风流意气都作罢 提交于 2019-12-05 15:52:37
I've created a simple 2d physics engine in Java that uses circular projectiles and straight walls. Currently, with each frame, every projectile's position is advanced by velocity * (1/fps) . Velocity is updated afterwards, once per frame. Collision detection defines a line in point-slope form using the previous and current position, checks if that line intersects with a wall, and if that intersection lies in between the previous position and current position, a collision is registered and the projectile's current position and velocity is updated accordingly. At the moment, there is no rotation

Centroid of convex polyhedron

醉酒当歌 提交于 2019-12-05 05:10:18
I have a closed convex polyhedron which is defined by an array of convex polygons (faces) which are defined by arrays of vertices in 3D space. I'm trying to find the centroid of the polyhedron, assuming uniform density. At the moment I calculate it with the algorithm in this pseudo-code. public Vector3 getCentroid() { Vector3 centroid = (0, 0, 0); for (face in faces) { Vector3 point = face.centroid; point.multiply(face.area()); centroid.add(point); } centroid.divide(faces.size()); return centroid; } This essentially takes the weighted average of the centroids of the faces. I'm not 100% sure

How to stop the forces acting on a body in box2d

怎甘沉沦 提交于 2019-12-05 02:17:58
I am using box2d on the iphone to create a game. I have a body that is effected by gravity to move down and not right or left. It will get hit by another body and will then be moving right or left. I then have a reset button which moves the body back to its starting point. The only problem is that it is still moving right or left. How can I counteract the forces that a ball is already traveling? How can I get rid of this right and left movement when I reset my game? box2d automatically clears forces each simulation step. I think you are just changing you body's position when reseting, but not

android physics engine [closed]

£可爱£侵袭症+ 提交于 2019-12-04 09:28:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . After looking into 3D game programming, it quickly became evident why a physics engine could be extremely useful. What physics engines are supported by and viable on Android? Any other advice regarding them would be nice. Thanks 回答1: It is not 3D, but AndEngine could at least provide you some useful information

android physics engine [closed]

雨燕双飞 提交于 2019-12-03 02:21:18
After looking into 3D game programming, it quickly became evident why a physics engine could be extremely useful. What physics engines are supported by and viable on Android? Any other advice regarding them would be nice. Thanks It is not 3D, but AndEngine could at least provide you some useful information to start with. It is a very promising and free Open Source 2D OpenGL Game Engine for the Android platform. Have a look at their example application to see what it can do :) Here's a 2D JavaScript engine that looks interesting: Box2D The latest Matali Physics Pro supports Android OS through

Fixing two box2D bodies together securely

有些话、适合烂在心里 提交于 2019-12-02 11:39:13
问题 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

physics engine - phase order and other general information

六眼飞鱼酱① 提交于 2019-12-02 07:30:23
问题 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