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
0
votes
0answers
21 views

Weird Collision Response occurring between 2 objects

I have been trying to program collision response between two objects (with AABBs) and the response is not what I except. Instead of bouncing off (reflective to the collision normal) each other the ...
0
votes
1answer
38 views

Simulating a small world with Box2D

I would like to use Box2D to simulate a small world, with entity sizes around 1cm (0.01m), some smaller than that. Box2D's FAQ says twice: Your moving objects should be between 0.1 - 10 meters. You ...
1
vote
1answer
98 views

Should delta be applied to every change per frame ? (e.g. acceleration, deceleration, jump, etc.?)

I have written a game based on another game's original physics. I have all the constants the original game used in the Sega Megadrive. For example: ...
0
votes
1answer
88 views

How could I move an object, while respecting the gravity and other related physics in Unity?

How could I move an object, while respecting the gravity and other related physics in Unity? I tried using the following approach: ...
0
votes
0answers
14 views

ArticulationBody Stability Stopgap

I have an ArticulationBody with a relatively large number of joints that interacts via capsule colliders with a static mesh collider. This works pretty well under most conditions, using continuous ...
13
votes
1answer
862 views

In games physics engines, what is "tunneling", also known as the "bullet through paper problem"?

I have recently had an issue where sometimes a collision would not be detected. Someone told me that maybe I had an tunneling issue. In the context of game development using physics, what is tunneling?...
1
vote
0answers
37 views

How to avoid CollisionShape2D bouncing which prevents Area2D detection?

Consider the player with a rectangular CollisionShape2D: and a round enemy with a CollisionShape2D and a little bigger ...
1
vote
1answer
438 views

Difference between _process(delta) and _physics_process(delta)?

The documentation is pointing one main difference, this is the concept of being synced or not with the physics engine, so the delta parameter has more chance to be ...
0
votes
0answers
52 views

What is causing my wheel collider's raycast to fail?

I'm making custom car suspension(Custom wheelcollider etc), now I encountered a problem where if car gets dropped from a certain height, raycast will fail to detect collision and wheels intersect with ...
0
votes
0answers
24 views

Calculating the bouncing ball bounce height while on platforms

I tried to calculate the bounce height for the bouncing ball however it ends up shaking against the moving platform after it finishes bouncing. grav_val in this ...
0
votes
1answer
36 views

Predict future position of a moving body in Phaser arcade physics

I am looking for an equation for predicting the future position of a moving arcade physics body in Phaser 3. The body has drag applied and isDamping set to true. Phaser applies the drag using the ...
1
vote
1answer
118 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 ...
2
votes
1answer
30 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}(...
0
votes
0answers
68 views

Snooker/Pool AI Predicting end location of cue ball Unity

I’m trying to implement a pool/snooker game. I figured the best way to implement the ball movement/potting mechanics is to use the physics simulation, apply an impulse to strike the cue ball and let ...
1
vote
1answer
60 views

Is an inertia tensor in local-space always diagonal?

I'm looking at the implementation of a physics engine and I observe that the inertia tensor of a rigid body, in local-space coordinates, is stored as a 3 dimensional vector, rather than a 3x3 matrix, ...
2
votes
1answer
62 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 ...
0
votes
2answers
144 views

What's the maths behind checking line of sight

I understand in unity there is Phsyics.LineCast(Vector A, VectorB). What's the maths behind doing that, the only thing i can think of is going along the line at small intervals and seeing whether it ...
0
votes
0answers
55 views

Are you supposed to be looping through all PhysicsObjects at every step in a physics engine?

I am currently making a small 2D game and I am trying to implement some basic 2D physics. I currently have a list of around 100 PhysicsObjects which I loop through every frame in order to update and ...
0
votes
0answers
39 views

LibGDX program crashing on on StepSimulation call

I am trying to add a Character Controller to a Discrete Dynamics World in Bullet via the LibGDX wrapper and everything seems to work, but when I attempt to update the world via the StepSimulation ...
0
votes
0answers
16 views

Problem using a CharacterController with a moving platform

My game has a wierd problem that I can reduce to the following minimal working example. There is a box object with a component with the following method: ...
1
vote
0answers
45 views

What in the BOTW game engine makes physics behave wildly when certain actions are triggered during bullet-time? [closed]

What in the BOTW game engine makes physics behave wildly when certain actions are triggered during bullet-time? https://www.youtube.com/watch?v=dXKsTrwZ6XY Also, what can you do to prevent it? Is this ...
0
votes
0answers
61 views

Retractable object in unity

I'm trying to get the physics of a retractable object in unity, So I will be able to "launch" an elastic cable (similar to rope physics) out of an object (e.g. A gun), And the cable will ...
1
vote
0answers
51 views

Proper sphere collision resolution?

I am implementing a sphere to sphere collision resolution and I am a little confused on where to start. First question, is there a standard way that games/engines do sphere to sphere collision ...
0
votes
0answers
54 views

How to implement joints in and impulse based engine

I have been writing a 2D physics engine (for fun and learning) for a while now. I have managed to implement collision detection along with collisions responses with angular impulse and frictional ...
0
votes
0answers
76 views

Contact points in collision

I am making a GJK-EPA based collision detection routine. In this picture, the algorithm picks up on two contact points (the endpoints of the green penetration vector). I'm certain that the penetration ...
0
votes
2answers
106 views

How to switch career to game engine/graphics programming [closed]

My whole background is related to enterprise applications but I've been thinking of switching my career path from enterprise/business to something that I feel is more challenging and interesting. One ...
0
votes
0answers
336 views

(Unity) how to write my own raycasting functions

I am making a game in curved space in Unity and I am trying to figure out the best way to handle raycasting. For my purposes the Ray struct doesn't carry enough ...
0
votes
0answers
30 views

How to make particle based fluid simulator like Algodoo?

I need to create swim mechanism which is interaction between object actuator and water. I've play Algodoo and I can make simple swiming mechine. Which priciple to achieve this? As far as I know it ...
0
votes
0answers
21 views

How do I calculate forces from a cinematic rigidbody?

Imagine a game with an astronaut that is directly controlled by a players pose. If the player now rotates their arm from the waist to the head, a rotation of the whole body in the opposite direction ...
0
votes
0answers
26 views

Trying to create a knockback effect between 2 squares (Code in Java)

I've been in trouble for weeks now and I don't understand why it doesn't work for me! I have tried so many things and I just can not understand. I try to get one player to get a knockback as soon as ...
0
votes
1answer
91 views

Unity data sampling rate

I'm using the Unity as a physic simulation and I want to gather the data of object position from it. So I put my code about random the force and apply to that object. Also the part that Write the data ...
2
votes
2answers
536 views

How do fixed-point physics (engines) work?

I would think there should be an abundance of excellent articles answering this question, but my searches have come up completely empty. I am developing an embedded graphics engine on a ...
0
votes
0answers
30 views

Reading collision force between two bodies in a 3D physics simulation engine (ODE?)

I want to detect collision and read the collision force vector between two bodies in a 3D physics engine like ODE. Could someone please tell me how to achieve this? ...
1
vote
0answers
172 views

How to use continious collision detection in a dynamic AABB tree

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. ...
0
votes
1answer
349 views

Creating Complex Collision Shapes in GMS2

I'm pretty new to Game Maker Studio 2 and I've hit a wall in programming with their built-in physics engine. I created a irregularly shaped object and I want to modify the collision shape so that it ...
1
vote
1answer
80 views

How can I decelerate a physics object to a stand still?

I am currently working on a little prototype and I am struggling to apply a friction force to slow down the player object. I have a simple physics engine using the model of setting acceleration, ...
0
votes
0answers
40 views

Portal physics by bending space

I've been thinking about how to implement a portal, and after a quick search, everyone seems to do it by adding a camera per portal and then just update the other portal's view with that camera's view....
3
votes
1answer
237 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 ...
0
votes
1answer
83 views

What is wrong with my gravity calculation?

Im trying to create a method to calculate the fall time for an object using real formulas. Well I came up with this: ...
1
vote
0answers
37 views

Real-time 3D Scene-reconstruction into Physics Engine

I am trying to create a game where the user scans the room using RGBD camera and reconstructs 3D scene. This scene would be integrated into physics engine, after an object recognition algorithm tells ...
0
votes
0answers
66 views

how can I visually compensate for latency in a diep.io style game

implementing extrapolation using linear velocity, orientation and position like on here gafferongames.com/post/state_synchronization/ I'm a little confused if I want to extrapolate from a known ...
1
vote
2answers
796 views

Can I use the 2d physics engine in a 3d game (or viceversa) in Unity?

This is entirely for performance. The 2D physics are less expensive, but I require 3D for some scenes. I never need both at the same time. I know you can have 2D with an orthographic perspective in a ...
0
votes
0answers
189 views

Simulating circular motion with gravitational forces in Unity2D

I am currently messing around with a game where you control a black hole and use its gravity to fling planets at targets. I have the gravity calculations working pretty well when the planets start out ...
0
votes
2answers
59 views

Objects aren't rotating in sync

This is a follow-up question to How to reapply force applied to one object to another object I want to make two objects move, react to collisions and other stuff as if they were one. For example, ...
0
votes
2answers
71 views

How to reapply force applied to one object to another object

Edit: While I wasn't able to make the code work completely, I believe my question has been sufficiently answered. I want to make two objects move, react to collisions and other stuff as if they were ...
1
vote
0answers
156 views

How do I prevent falling tiles from bouncing on each other in my match 3 game?

I am working on a match 3 game in Unity. The tiles have a RigidBody2D in dynamic mode and a BoxCollider2D. When a match occurs ...
3
votes
0answers
88 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 ...
0
votes
2answers
224 views

AABB Collision Detection Confusion

I am trying to understand and implement AABB collision to learn simple 2D game physics. I'm following a tutorial and its method is a bit different to other websites. It uses the center of the object ...
48
votes
6answers
12k views

How can I perform a deterministic physics simulation?

I'm creating a physics game involving rigid bodies in which players move pieces and parts to solve a puzzle/map. A hugely important aspect of the game is that when players start a simulation, it runs ...
1
vote
0answers
31 views

Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground (\$y=0\$). When a vertex hits the ground, I apply the (linear) impulse $$\overrightarrow{P}...

1
2 3 4 5