Questions tagged [collision-resolution]
A process of adjusting game objects position after collision.
434 questions
1
vote
0
answers
76
views
how to implement the vines in animal well
the vines in animal well display pixel perfect deformation when the pc moves through them. they also display rope physics but do not appear to be implemented by jointed segments of physics rigidbodies ...
7
votes
1
answer
1k
views
Why are collision manifold points created inside objects instead of on their surfaces?
Suppose you have two overlapping spheres \$A\$ and \$B\$, with centers \$c_{A}\$ and \$c_{B}\$ and radii \$r_{A}\$ and \$r_{B}\$. Let
\$n = \operatorname{normalize}(c_{B} - c_{A})\$ be the collision ...
1
vote
1
answer
217
views
Collision detection and physics in a 2d pixel platformer
I'm reworking physics in a 2d action platformer I'm developing (no engine, c++ / sdl). Here's the general movement logic for all characters:
I calculate the offset I need to apply to the character
I ...
3
votes
0
answers
60
views
Collision response with external forces & small relative velocities
How do I deal with collisions that have small relative velocities, but external forces such as gravity?
Imagine a scenario with a box in 2D, rotated 30 degrees, and placed on the ground.
Gravity acts ...
0
votes
1
answer
68
views
How to calculate a fixed reflected direction from a face (or plane) whatever the incident angle or direction
In my collision protocol when a hit is found I’m using AABB faces to determine a reflected direction where the mobile must move (see picture left). This is easy as we just need to invert the sign of ...
1
vote
1
answer
116
views
PGS solver leads to boxes spinning out of control or sliding out of stacks
I'm trying to implement a PGS solver for collision response, but I'm currently stuck.
How the problem manifests is, for the example of a box resting on the ground, if the box is given a small rotation ...
1
vote
0
answers
122
views
How to Prevent Character Controller Descent at Platform Edges When Using a Capsule Collider
CONTEXT: I am implementing a basic 3D character controller from scratch in Unity. For collisions, I do a capsule cast in the direction of the player velocity and use the collide and slide algorithm to ...
1
vote
1
answer
117
views
How to compute a normal in circle vs rectangle collision to push them apart?
I have a 2D circle, defined from:
c = circle(position = (x,y), radius = r)
I also have a 2D rectangle defined from
...
1
vote
1
answer
91
views
2D Square Collision Correction issue detecting which direction
I've just started getting into 2D game development and have been experimenting with some 2D collision and correction logic in canvas. I'm trying to debug this block of code and understand why it is ...
0
votes
1
answer
96
views
Predictive Rectangle Collision Resolution Corner Snagging
I've written two main functions who's purpose is to detect and resolve collisions between a moving rectangle and a non-moving rectangle. I have a decent understanding of how the algorithm works, and ...
0
votes
0
answers
98
views
Collision of two rigid spheres with spin
I'm trying to create a particle simulation (solar system kind). Until now my particles have no spin so the collision is rather simple
...
0
votes
0
answers
74
views
Dynamic Knock Back Force Based on Collider Velocity
I'm making a game prototype in Godot. My player character is a ship that moves around in 3D space without gravity. I have some simple code that adds a knock back force to the player on collisions ...
1
vote
0
answers
75
views
Applying impulses simultaneously at each contact point or sequentially?
I'm coding a 2d physics engine in python, and I'm struggling to understand the right way to implement collision resolution when there are multiple contact points.
Consider a very simple collision case ...
0
votes
0
answers
109
views
How to make this soft sphere with Unity?
What methods should be used to create such a sphere in UNITY? This collider seems to deform in real-time, squeezing and monitoring collision information when the sphere collides. I cannot achieve this ...
0
votes
1
answer
153
views
Object collision and vector reflection for complex polygons?
I am currently creating an environment to train aim-bot AI's for my game. It is a 2d world made of complex polygons, and the goal is to have the AI's shoot ricocheting bullets. Using a ray-casting ...
0
votes
0
answers
109
views
AABB Collision Resolution Per Face
I have this function that detect the collision of two AABBs:
...
0
votes
1
answer
98
views
Circle to Polygon & Circle to Circle Velocity Resolution
I am working a 2d physics engine.
Polygon to polygon collision and velocity resolution works without issue, but I am struggling to get working circle to circle and circle to polygon velocity working ...
2
votes
0
answers
148
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 ...
0
votes
0
answers
108
views
Is it possible to create an actual working physics-based ball bearing in Roblox engine?
Will it allow for making actual wheels, gears and roller coasters?
0
votes
2
answers
145
views
How to make a character fall through a BoxCollider2D?
Currently trying to make a 2D game in Unity and I'm trying to make the part where if the character falls in a hole it goes back to spawn, but I currently have a ground box collider blocking it, which ...
0
votes
1
answer
167
views
Bounding Box/Rectangle collision glitches
I've been working on this golf game for a couple of weeks and have been trying to create a reliable collision system for whenever a golf ball (mini golf) hits a block. I'm using regular rectangular ...
0
votes
1
answer
130
views
3D Impulse based collision resolution not behaving correctly, what could be wrong?
I've implemented a collision resolution system based on Ian Mellington's System Cyclone and afterwards based on the Game Physics Cookbook. Currently the last one is implemented.
For some reason the ...
1
vote
0
answers
78
views
Separating axis theorem implementation results in limitless extending colliders along the Z axis
I am trying to implement SAT and it works except for the fact that colliders extend infinitely along the Z axis and I can never get past them. I also have confirmed that ...
0
votes
2
answers
157
views
Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner
I am making a 2D game where balls bounce from the edges of the screen, However, there seem to be two types of issues with this kind of bounce method, and every tutorial I checked uses the same method.
...
3
votes
1
answer
366
views
How to make a CharacterBody2D slide out of StaticBody2D instead of teleporting?
I am trying to replicate Mario Maker's On/Off switches in Godot 4.1.
In my current version, if the player got stuck inside the block after it was toggled on, the player just teleports out it. I know ...
0
votes
1
answer
183
views
Why check the ball and brick collision twice?
I watched https://www.youtube.com/watch?v=F86edI_EF3s.
I believe the following code is the complete code
https://github.com/games50/breakout/tree/master/breakout13
And
https://github.com/games50/...
4
votes
1
answer
1k
views
Character controller that can handle sloped terrain and boxy ledge traversal
I am working on a character controller for a 3D platformer in Unity. I cannot find an approach that satisfies me.
I have experimented with these approaches in order to learn about their virtues and ...
0
votes
1
answer
147
views
How to calculate angular momentum of two colliding bodies about their shared center of mass in 2D?
I'm following this guide to implementing collisions in 2D physics.
It shows this diagram, but I don't understand how to calculate the values of Da and ...
1
vote
1
answer
92
views
Player stays grounded when jumping at the side of a two tile high wall
I am currently developing a simple Super Mario Bros. like platformer in Cocos2d-x v2. I am now at the step of doing wall sliding with two axis-aligned bounding boxes (tiles) but I've not quite found ...
1
vote
0
answers
163
views
I don't want my plane to go trough walls, I want it to stop on obstacles
I'm currently working on my first Unity Learn code challenge, making a Flappy Bird style game where a plane needs to fly through gaps between wall obstacles.
I've successfully implemented all the ...
0
votes
1
answer
76
views
How can I prevent my ball from slowing down when it makes contact with the corners of colliders
I'm trying to make a game where the player has to destroy blocks. But when the player collides with the corners of the blocks, the player's velocity slows down, or even stops.
How can I ignore the ...
0
votes
1
answer
125
views
How to separate player characters occupying the same board game space?
I'm trying to create a 2D "board game" type thing in Unity, and I would like each player to be visible within the same space.
The way I want to do that is by having it so when a player ...
0
votes
0
answers
75
views
Calculate direction to push player away from wall
I'm trying to write a common 2D game and using vectors for physics.
I have 1 wall and 1 player object that can move diagonally (both are squares without rotation).
When the player object collides with ...
1
vote
1
answer
435
views
How to prevent colliders from knocking each other back before being destroyed?
For context, I have a player that can use a bow or a spear to shoot enemies in a 2D side scroller game. The bow shoots arrows and the spear shoots itself, and they both have rigidbody2Ds attached.
...
0
votes
0
answers
176
views
Why do my VR avatar's hands clip through my chair object?
I have spent hours on this task and I feel it's high time I asked. My avatar hands go into my chair GameObject.
I added a box collider to the hands of my avatar and unchecked "Is Trigger". I ...
1
vote
2
answers
177
views
How to settle a rigid body to rest on flat surface
I am trying to simulate the behaviour of a rigid body, for example a cube, while it settles on a flat surface. Let's say it lends on an edge or even on a corner, and now it has to settle and remain on ...
0
votes
0
answers
99
views
Motion of a cube after it bounces off a floor
I am trying to simulate what happens when a cube hits the floor after free fall. I am considering a situation in which cube hits the floor with its edge. There is obviously reaction force from the ...
1
vote
1
answer
399
views
How do I make multiple circles bounce of each other
How will I calculate the direction of the circles when they hit each other? (there is no change in speed, there is no mass, and all circles have the same radius)
...
0
votes
1
answer
547
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
117
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 ...
0
votes
1
answer
433
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 ...
15
votes
4
answers
3k
views
Solving obtuse interior corner collisions
I'm having some trouble solving collisions in obtuse interior corners.
In the above image, the black circle is the initial position, the red is the projected movement (straight into the corner), the ...
0
votes
0
answers
342
views
Rigid Body is rolling/spinning on collision, is there a way to have it slide on surfaces instead?
I have a rigid body with a sphere as a collision mesh which can move and rotate freely. It realistically spins when colliding with other objects, but this is annoying from a gameplay standpoint. Is ...
3
votes
1
answer
218
views
Is there a generic formula to determine the angle of deflection off of a rectangle?
I have a perfect 2D system, with no friction, elasticity, etc. A ball is colliding with a rectangle. I know the angle of the motion of the ball in degrees. I want to figure out how said angle will ...
2
votes
1
answer
439
views
Transferring linear momentum to angular momentum in Godot
In Godot, when a 2D rigid body collides with another body, it seems that the force is absorbed/used to bounce back, but it doesn't give an "angular impulse" to the object, for instance if a ...
1
vote
1
answer
914
views
Get the closest point on an SDF
Is there a cheap and effective way to get the closest point on an SDF? (signed distance field). CodeParade made a video on a game he developed that uses SDF collisions with a sphere, how did he do it? ...
0
votes
1
answer
741
views
How to allow a CharacterController to pass through walls?
I'm developing a game in which bot-controlled billboards pursue you.
If the bot gets stuck behind a wall for a while, not able to catch the player, I want the bot to pass through the wall.
I'm using a ...
0
votes
2
answers
375
views
Changing falling behavior of my object after collision to go gradually down and not instantly
Context
I'm here today to figure out how can I have an object to fall down after colliding to another object. In my case, I'm remaking Flappy Bird and trying to reapply some of the physics in place ...
1
vote
0
answers
20
views
numeric inaccuracy collision resolution [duplicate]
I need an idea, please :). I've implemented moving AABB -> AABB collision detection (3D), returning the time of impact.
When I calculate time_of_impact * velocity...
0
votes
0
answers
67
views
Sliding convex polygon against other polygons
Is there a common practice for resolving polygon/polygon collision by sliding as shown in the image? The moving polygon is convex (and if it makes it any easier, a quadrilateral), but the polygons it ...