Questions tagged [physics-engine]

Software for simulating physics like collisions, forces, mass, joints, motion etc. Examples of physics engines are PhysX, Havok, Bullet and ODE.

Filter by
Sorted by
Tagged with
3 votes
3 answers
1k views

Optimizing Bullet and ODE Physics on consoles and mobile phones

I'd like to use either Bullet or ODE on low powered devices (mobile and consoles), but the frame rates are below the acceptable 25-30fps for simulations. I've found that one articulated body by ...
zmdat's user avatar
  • 615
3 votes
2 answers
2k views

How do I calculate rotational impulses in rigid body collisions?

I'm writing a simple 2D physics engine to help me understand the inner workings of physics engines. I'm following Randy Gaul's tutorial which can be found here and It's been extremely useful and ...
acernine's user avatar
  • 133
3 votes
3 answers
316 views

Physics System ignores collision in some rare cases

I've been developing a simple physics engine for my game. since the game physics is very simple I've decided to increase accuracy a little bit. Instead of formal integration methods like fourier or ...
Ali1S232's user avatar
  • 8,687
3 votes
2 answers
2k views

What is inertia in a physics engine?

Inertia seems to be useful in a physics engine, so useful that even in Box2DLite, a demo of Box2D it hasn't been omitted. See this Body class from Box2DLite: ...
Winter's user avatar
  • 341
3 votes
1 answer
1k views

Data oriented design in physics engine

I am new to data oriented design and I am currently developing a physics engine as a hobby project. I am really interested in data orinted design but I am not sure how to apply data oriented design to ...
kevinyu's user avatar
  • 231
3 votes
2 answers
654 views

Bounding volume hierarchy - linked nodes (linear model)

The scenario A chain of points: (Pi)i=0,N where Pi is linked to its direct neighbours (Pi-1 and Pi+1). The goal: perform efficient collision detection between any two, non-adjacent links: (PiPi+1) vs....
teodron's user avatar
  • 3,271
3 votes
1 answer
1k views

Design patterns in Game Physics

In the frames of a number crunching compatible programming language (say.. C++), what would be an elegant solution for adding self collision, external collision and integration step (Euler, etc.) ...
teodron's user avatar
  • 3,271
3 votes
1 answer
2k views

Cutting a body in box2d

After cocos2d, I'm looking at box2d... And I have some questions: I was wondering how to cut a body into pieces. How do I determine the intersection point of the body with the cut line? Create a new ...
Darth Vader's user avatar
3 votes
1 answer
664 views

Rigid body falls through static mesh even though collision is detected

I'm using Jitter Physics to create a game. For testing, I have ball (a spherical rigid body) falling onto a small box-like mesh. The problem is that the ball falls straight through the floor, even ...
Grimelios's user avatar
  • 559
3 votes
1 answer
403 views

Time complexity of solving constraints in physics engine

Erin Catto mentioned in a talk that solving constraints precisely requires cubic time and quadratic space. What algorithm is he talking about when he mentions cubic time? pdf of slides with following ...
user782220's user avatar
  • 1,007
3 votes
0 answers
146 views

Faster convergence in a physics engine

I've got my hands on the first edition of the book Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game by Ian Millington. Because I didn't really know ...
Peter Lenkefi's user avatar
3 votes
0 answers
365 views

Bullet Physics Scaling rotational part of 6DoF Spring Damper

I am currently trying to scale up my setup (consisting of two rigid bodies connected by a btGeneric6DofSpring2Constraint) to fall within the suggested dimensions for a concise simulation. In order to ...
Flo Ryan's user avatar
  • 131
2 votes
2 answers
1k views

Why not derive velocity from position updates in games?

Is there a reason why retrieving velocity of a 3d object in a game engine vs deriving it from position updates is preferable? I am currently polling position at every step and deriving current ...
JeffV's user avatar
  • 185
2 votes
1 answer
158 views

How do force fields scale?

Setting I am designing a 2d game in which a \$1/r^2\$ force acts between moving charged particles, and the number \$n\$ of particles is very large. To calculate the force between all pairs of ...
Deniz's user avatar
  • 121
2 votes
2 answers
1k views

How to handle player input with fixed rate variable fps time step?

I've made a system which uses the ideas from "Fix your Time Step" in order update physics. I'm having trouble finding standard methods for dealing with this when user input affects player movement ...
Krupip's user avatar
  • 1,763
2 votes
2 answers
2k views

Physics engine and squishing of stacked objects

I have a general question that seems to apply to most physics Engines (Box2D, Unity, Matter.js, …). I'm trying to make a tower of rectangular objects that are stacked on the [static/mass=infinity] ...
Brunni's user avatar
  • 51
2 votes
1 answer
267 views

Rigidbody physics concept: Why translate collision shape on-the-fly instead of mutating it?

Crossposting at https://stackoverflow.com/questions/29993547/rigidbody-physics-concept-why-translate-collision-shape-on-the-fly-instead-of-m I've spent some time going through physics engine's ...
Arthur Spooner's user avatar
2 votes
2 answers
1k views

Understanding constant acceleration in terms of game physics simulation

There are various integration methods that can be used for games. I am trying to write a simple physics engine deciding between semi-implicit Euler and Verlet variants. What I don't understand is ...
Chris's user avatar
  • 21
2 votes
2 answers
303 views

Replicating no. of sprites without letting the app to slow down and crash

Is it possible that if I'm making a a simple drag-n-drop game, does making a new sprite via constructor with texture as a parameter makes the game slower and depletes more memory until it crashes or ...
David Dimalanta's user avatar
2 votes
4 answers
1k views

What different ways are there to model restitution in a physics engine?

In my physics engine I give a body a value for restitution between 0 and 1. When two bodies collide there seems to be different views on how the restitution of the collision should be calculated. To ...
Mikael Högström's user avatar
2 votes
1 answer
1k views

Unity Physics Simulation - Limitations / Inaccuracies? Bounciness of a ball (pool/snooker balls etc)

I am playing with Unity physics engine. I have a pool table and a cue ball. Both have Physic Materials. If I start the game, with the ball floating about 1m above the table, it falls and bounces (...
Big T Larrity's user avatar
2 votes
2 answers
1k views

Jump-through & drop-down platform

I'm creating platforms in my game where the player can: 1) Jump through them from the bottom and land on top of them 2) While on top of them, drop down through them I've been able to get #2 working ...
SaviorXTanren's user avatar
2 votes
1 answer
743 views

How do I run a physics simulation in the background, to determine possible future outcomes?

I'm designing a physics-heavy game, in 3D. The core mechanic of this game is that the user gets to choose his actions based on probable future outcomes. For example, the player has a choice whether to ...
OpherV's user avatar
  • 655
2 votes
2 answers
2k views

How to deal with pushing objects out of collision in a physics engine

I'm developing a 3D physics engine (I know, I should use one of the many good existing physics libraries, however my collision detection is optimised for objects with highly ordered highly complex ...
Richard Tingle's user avatar
2 votes
1 answer
892 views

Stopping an object after applying an impulse or force?

I'm having a small issue where after applying an impulse or force it is impossible to actually get an object to stop, i.e. a velocity of zero. This code is run every ...
Casey's user avatar
  • 2,010
2 votes
1 answer
1k views

AndEngine Physics: Shape rotating but not updating physics effects

I was looking at PhysicsExample from AndEngine's Examples. I made the following change that I added a vertical line shape and created a fixture for it. Then I registered a rotation modifier for that ...
Khawar Raza's user avatar
2 votes
1 answer
1k views

what is the absolute simplest way to add physics to a simple 3D game

This physics does not have to be very complex at all. There are a number of rectangles and one ball, all of which have the appropriate bounding volumes constrained to them, it would be great if the ...
Dollarslice's user avatar
  • 3,410
2 votes
1 answer
188 views

Why do physic engines apply force fully linear, despite adding torque

I checked how the applyForce function on rigid bodies in 3 different physic engines work (cannon.js, matter.js, PhysicsJS) and it seems that this is the common way ...
Bastian Born's user avatar
2 votes
1 answer
762 views

RK4 integration and Continuous Collision Detection

I'm using this method to detect collision between two AABBs. The algorithm is simple, fast and works great. It uses the relative velocity between the two objects to calculate TOI. This works fine with ...
dreta's user avatar
  • 3,524
2 votes
1 answer
913 views

How to make a stack stable? Need help for an explicit resting contact scheme (2-dimensional)

Previously, I struggle with the sequential impulse-based method I developed. Thanks to jedediah referring me to this paper, I managed to rebuild the codes and implement the simultaneous impulse based ...
Register Sole's user avatar
2 votes
1 answer
972 views

Simulation step size in a physics engine

I am trying to integrate a physics engine (Bullet) into my game engine, but I immediately found that I do not know how big should I make the simulation step. I think of 2 options: Use a fixed step ...
Vít Gardoň's user avatar
2 votes
1 answer
250 views

How do I calculate impulse when an object collides with plane(fixed object)?

I've been developing simple 3D impulse-based physics engine. I calculate impulse as follows: $$j_r = \frac{-1(1+e)v_r\cdot\hat n} {m_1^{-1}+\bbox[yellow,5px,border:2px solid red]{m_2^{-1}}+(I_1^{-1}(...
jmiry's user avatar
  • 31
2 votes
1 answer
160 views

Scaling physics engines beyond single computational server

Currently working on a small home project of developing our own game. The game basics are just a straightforward space game, currently without any collision detection/resolution, just movement with ...
Matti Kettu's user avatar
2 votes
1 answer
533 views

Box2D physics are different on server and client

I'm using C# Box2D library for my server and client, they have similar world.step(), iterations and update function. At the same time they have different physics' results, difference is not fixed, it ...
Basea Basilia's user avatar
2 votes
1 answer
190 views

Transfering an inertia tensor from local coordinates to another one

If we have an inertia tensor in local coordinates with a basis matrix B and we want to transform it to other local coordinates with basis matrix A, is it right to do the following: A* inv(B) *Inertia ...
georjo's user avatar
  • 21
2 votes
1 answer
815 views

Impulse resolution for purely rotational collisions (relative linear velocity = 0)

I've been writing a basic physics engine, (loosely) following Randy Gaul's online tutorial. I have been using this equation that he derives: $$j=\frac{-(1+e)((V^A-V^B)*t)}{\frac{1}{{mass}^A}+\frac{1}{...
Orion66's user avatar
  • 21
2 votes
1 answer
560 views

Calculating real time moment of inertia around arbitrary axis in 3d

I have a 3d rigid body consisting of multiple triangles forming a closed mesh. I know how to calculate the moment of inertia around an arbitrary axis by splitting up the mesh into simpler shapes and ...
Markus Fjellheim's user avatar
2 votes
1 answer
117 views

How to detect and prevent the resolution of fake collisions?

I'm creating my own physics engine and I came across a small inconvenience. Here how it goes: when a body tries to push into something it really can't push, it gets pushed back (which is completly ...
Winter's user avatar
  • 341
2 votes
2 answers
2k views

How to get the point of collision in Separating Axis Theorem?

I'm interested in the relatively precise point (not line) of collision for calculating angular velocity on impact for use in a impulse calculation. At first I thought, perhaps naively, that I could ...
JavaProphet's user avatar
2 votes
1 answer
1k views

How does matrix based game physics (collision detection & response) work?

I'm familiar with how to do collision detection and response using shape intersection tests, the separating axis theorem, and by using MPR and GJK with minkowski sums and support vector defined shapes....
Alan Wolfe's user avatar
  • 2,353
2 votes
1 answer
637 views

Why is the drag force multiplied by the inverse normalised velocity vector?

In pure physics texbooks, I'm seeing this formula to calculate fluid drag force: It is clearly stated that it should be opposite to the velocity. Now to me that means, in pseudocode: ...
Fabio's user avatar
  • 283
2 votes
1 answer
2k views

Bullet physics: how to make a soft body "static" (kind of)?

I'm fairly new to Bullet and started using it a week ago. I mainly played with rigid bodies and everything works as expected but now that I also need to add soft bodies into my simulation, things got ...
megamoustache's user avatar
2 votes
1 answer
559 views

What physics engine support force fields and bodies represented as points?

I need a game engine that supports force fields in 2d or 3d, but suitable for 2d calculations, like bullet. Each body I want to simulate is represented as a set of points. Each point has positive ...
q______b's user avatar
  • 123
2 votes
1 answer
263 views

JiglibX addition to existing project questions

Got a very simple existing project, that basically contains a lot of cubes. Now I am wanting to add a physics system to it and JiglibX seemed like the simplest one with some tutorials out there. My ...
SomeXnaChump's user avatar
2 votes
1 answer
1k views

Converting 2D Physics to 3D

I'm new to game physics and I am trying to adapt a simple 2D ball simulation for a 3D simulation with the Java3D library. I have this problem: Two things: 1) I noted down the values generated by the ...
static void main's user avatar
2 votes
0 answers
22 views

How to choose the normal for collision?

Here two objects collide and I use impulse to calculate the velocity after the collision. But because there are two objects, there are two normals. Calculating impulse only requires one normal. My ...
noodle_run's user avatar
2 votes
1 answer
459 views

p2.js body position is NaN when spawned inside of each other

I'm working on a project for which I need a physics engine. At the moment I'm playing around with p2.js but I'm running into a problem: When I try to create multiple bodies (circles and/or boxes) ...
Olivier's user avatar
  • 23
2 votes
0 answers
257 views

Cloth effect to boned model for XNA

I'm currently working in virtual dressing project using kinect. I'm using a dress model with bone created in blender and added that to xna, placed on the customer and controlled the product movements ...
Jagan's user avatar
  • 21
2 votes
0 answers
146 views

p2.js physics engine behavior on Heightfield

I am writing a small game consisting of a 'ragdoll' character riding a skateboard. I have created a 'skateboard park' with some ramps and a jump. I am using a 'heightfield' object as the ground. ...
smatthews1999's user avatar
2 votes
0 answers
261 views

Storing rigid body collision shapes in local or world coordinates

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
skwashi's user avatar
  • 36