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.
230
questions
0
votes
0
answers
35
views
Should a free roaming camera movement be controlled by the physics engine (for smooth movement)?
I have a hobby engine (for fun and research) with a free roaming camera implementation that works by modifying the PositionComponent and ...
0
votes
0
answers
18
views
Does unity transform world to local considering rotation
I want to implement oriented collision in unity as a test, and for convenience I just wanted to know if local space is also based on rotation. I wanted to check at least two objects against each other ...
0
votes
0
answers
85
views
Why doesn't multi-constraint work in this case?
The situation is as follows:
There are two objects and there are 3 constraints between the two objects.
$$
\dot{C}=(\vec{V}_{rel_a} - \vec{V}_{rel_b}) \cdot normalize(\vec{p_{a}} - \vec{p_{b}})
$$
&...
0
votes
0
answers
37
views
How to implement 2D rigid body motion?
I'm already depending on two NPM packages for 2D collision and differential equations:
sat
rungeKutta
I've a basic simulation structure, but don't know where to start with to use these two packages ...
0
votes
0
answers
48
views
How to rotate body in server-side physics without imparting angular velocity?
I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to get proper working physics on the server side. I'm using Next.js for the client and currently Node.js for the server.
I ...
1
vote
1
answer
76
views
Units in Unity?
I have read that in Unity 1 cube of size 1x1x1 and scale 1x1x1 is representing a cube in real life of 1mx1mx1m.
Now, the only setting I find, where I can input anything related to Units is gravity, ...
0
votes
0
answers
46
views
Why are global constraints so ineffective?
There are two objects here, each with 3 constraint points.
I use formula:
$$
\lambda=(JM^{-1}J^{T})^{-1}(-JV-b)
$$
$$
\Delta V=M^{-1}J^{T}\lambda \
$$
I put the information of the three constraint ...
0
votes
0
answers
65
views
Can Box2D be configured to conserve total energy of the system?
What I want
I want a physics engine that can support a few dozen balls and polygon objects interacting with each other in a closed environment. It needs to support objects rotating after collision. It ...
0
votes
0
answers
106
views
Box2D Lite demo by Erin Catto : How Baumgarte stablisation works with Arbiter and what "Allow Slope" means?
Hello Game physics developers,
Hope you are having a good time. I am trying to write basic 3D box-box rigid body collison resolution. I was able to copy paste BIG BEEP formula to generate two impulse ...
0
votes
1
answer
163
views
How do you resolve continuous collision in a multi body system?
I've been trying to figure this out for weeks but every resource only provides answers for a single body. As far as I can tell for a single body you
Find the time of impact
Step up to that time
...
0
votes
0
answers
54
views
Dynamic bodies falling onto static body tunnel through each other or fail to bounce
I have a problem with Box2D when 2 dynamic bodies fall onto a static body located below when their restitution is non-zero. They tunnel through each other instead of a rigid elastic bounce.
If I treat ...
1
vote
0
answers
40
views
How to update the version of Box2D used in AndEngine?
I need help to use an updated Box2D library where the current version is > 2.3.0. I am unable to find a compatible library and do not know how to compile one for use with the Java Native Interface (...
0
votes
1
answer
169
views
How to stop player when they hit an axis aligned bounding box?
I'm in the process of creating a game using electron and HTML5. It's going to be a pretty basic story-based platformer, but I'm ...
1
vote
1
answer
172
views
Why is my Moon not orbiting Earth in my physics demo
I am in the midst of making a gravitational body demo for my physics engine. For the demo, I am trying to simulate both all the inner planets' (Mercury-Venus-Earth-Mars) orbits around the sun, as ...
0
votes
0
answers
65
views
Is it advantageous if the conflict resolution for a 3d game is fake?
The game is you are a monster trainer in "3D" (I am going with WildPet(WP) for the game and the monsters). In battle with one other WP, you give the WildPets commands which can be tactical ...
2
votes
1
answer
165
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 ...
12
votes
2
answers
3k
views
Moving player inside of moving spaceship?
INTRO:
I am trying to achieve a spaceship that flies through space and the pilot can get out of their seat and walk around the ship and place physics objects in it while the ship is moving, rotating, ...
1
vote
1
answer
529
views
Configurable Joint rotation doesn't seem to respect mass difference
The Problem
I've run into a physics issue in my Unity project, and have put together a simple example scene to illustrate it. Hopefully someone will be able to tell me if I'm doing something wrong.
In ...
1
vote
1
answer
12
views
What can I set in rigid body and collidable objects to ensure that the angle after collision is larger?
I have a rigid body with sphere shape attached and a static collidable box. When sphere hits the box at an angle, for some reason, the angle that it bounces off from is really small: https://imgpile....
0
votes
2
answers
524
views
In physics engines, what are the differences between moving an object with transform.translate and using RigidBody related functions like AddTorque?
I'm trying to recreate the ball maze puzzle game from Breath of the Wild with Unity. This is what I currently managed to make:
As you can see, it's not nearly as smooth and I feel like I lack the ...
0
votes
0
answers
685
views
Unity - Billiard balls unrealistic movement
So, I have this problem, even when I apply a small amount of force, the balls seem to get pushed away easily. Here's how they should behave (GIF from 8 ball pool game):
And here's how I have it :
...
0
votes
0
answers
239
views
character movment and physics on 2d game
I'm developing a client/server multiplayer game. in server side i need prevent players cross map objects like walls also i need prevent player go inside each others, instead want to slide them along ...
0
votes
1
answer
97
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
1
answer
318
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
1
answer
427
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:
...
17
votes
1
answer
3k
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
0
answers
135
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 ...
9
votes
1
answer
6k
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
0
answers
390
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
0
answers
53
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
1
answer
129
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 ...
2
votes
1
answer
823
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
1
answer
199
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}(...
1
vote
1
answer
197
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
1
answer
144
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
2
answers
505
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
0
answers
214
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
0
answers
99
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 ...
1
vote
0
answers
83
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
0
answers
138
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
0
answers
134
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
0
answers
179
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
0
answers
335
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
2
answers
283
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
0
answers
737
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
0
answers
70
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
0
answers
30
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
0
answers
44
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
1
answer
254
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 ...
4
votes
2
answers
2k
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 ...