4,443 questions
-2
votes
0
answers
66
views
Slow collision detection in Python [closed]
I am making a particle simulator in python, and noticed that my collision detection is ruining the performance the most,I am not even sure if this is a thing but is it possible to tell the GPU to do ...
0
votes
1
answer
26
views
RealityKit CollisionFilter: left and right child colliders both firing when only one is touched
I’m working with RealityKit and trying to detect on which side of a connector a sphere has collided.
The setup:
I have a connector (a cylinder).
It has two child entities, each one with its own ...
0
votes
0
answers
87
views
Ball bounces off walls but not off tiles in PICO-8
I’m working on a small PICO-8 project where multiple balls/pixels should bounce around the screen.
The wall collisions work fine, but when I try to make the balls bounce off map tiles (with flag 0 = ...
0
votes
0
answers
41
views
SOFA: elastic band tunnels through pegs under high strain/fast motion
I control two grippers with two Geomagic devices in a SOFA scene. The task is to grasp a soft elastic band (a torus) and place it into target configurations (shown at the beginning of the task).
When ...
0
votes
1
answer
98
views
Detect if circle crossing arc, Lua
How can I detect whether a circle intersects or crosses a given arc segment?
The arc is defined by a center, radius, start angle (angle1), and end angle (angle2).
How to detect that arc AB has ...
0
votes
1
answer
86
views
How to make player lose only one life when hitting many spikes at once?
I have been working on a project in Godot 4.4.1 (a 2D platformer) and have added some spikes for the player to jump on; if you touch a spike, you lose a life.
The problem is that if there are two ...
1
vote
0
answers
157
views
Fast 2D collision detection of two convex quadrilaterals, distinguishing edge intersection and point intersection
The input is two 2D convex quadrilaterals.
I leaned that SAT or GJK algorithm can detect if their intersection is of zero area (as a segment or a point) or positive area (as a polygon). But these two ...
0
votes
2
answers
177
views
Swept AABB collision between circle and rectangle
I'm fairly new to javascript, and I've been trying to build a small game to learn new concepts. An issue I'm encountering is that projectiles in the game often have a higher velocity than the width of ...
1
vote
0
answers
154
views
Simple and Lightweight Collision Detection (and Reaction) in C# (Windows Forms)
I am looking to create a 2D Topdown Shooter in Windows Forms.NET (C#). I have player movement & enemy movement, player & enemy rotation (player aims towards the mouse, enemy aims towards the ...
0
votes
1
answer
120
views
Don't understand iOS RealityKit's collision detection
I am trying to detect collisions between two RealityKit entities, but the results are unexpected.
I thus created a minimal example. In the iOS app below, 3 entities are set up:
A board, a fixed box ...
1
vote
1
answer
169
views
How can I check for the child instead of the parent for collision in Godot?
I'm trying to detect collision to attack an enemy, but I don't want it to detect the player as a whole, I just want it to detect the Collision2D node named "Sword Hitbox". Is there any way ...
2
votes
1
answer
103
views
Collision detection of two rects with rounded borders
I wrote an algorithm how to detect the collision detection of two rects with rounded borders (the code was written using TypeScript but I tried to name things as clear as possible to code be readable ...
1
vote
1
answer
133
views
How can I detect collision between a box and a minimum poly collision mesh?
Mostly a C++ newbie, trying to do a 3D game in Raylib.
I have a set of fairly irregular meshes that I'd like to see if a box collider has penetrated. For this project, a fairly high level of accuracy ...
1
vote
1
answer
58
views
Problem SAT collision detection algorithm (circle-polygone)
def Axis(A, B): # RETURN A NORMALIZED NORMAL VECTOR (CHECKED)
dx = A[0] - B[0]
dy = A[1] - B[1]
n = [-dy, dx]
v = math.sqrt(dy ** 2 + dx ** 2)
return [n[0] / v, n[1] / v]
def ...
0
votes
1
answer
122
views
parallel verlet ball to ball collision detection handling
I've written a 2d ball to ball particle collision and detection system using Verlet integration.
This means my balls are using a "previous position" and "position" (As opposed to a ...
1
vote
0
answers
30
views
Why does my Separating Axis Theorem fail near world axes? Unity
Problem Description:
I am implementing collision detection between an OBB and an AABB using the Separating Axis Theorem (SAT) in Unity. The algorithm works perfectly in most cases, but I have noticed ...
1
vote
1
answer
153
views
How do I get a 3D collision with a Heightmap in Raylib?
I'm presently trying to do a sorta Starfox clone with Raylib, using the heightmap example here: https://www.raylib.com/examples/models/loader.html?name=models_heightmap
In order to handle collision in ...
0
votes
2
answers
57
views
How can I prevent two Rectangle2D from overlapping?
I am trying to create a Vampire survivor type game, and I am currently creating the logic of the enemies, but I have found a problem, and that is that they are able to overlap each other, to a point ...
1
vote
1
answer
54
views
How to manage monster collision range during calculating path by A* algorithm?
Pathfinder by A* algorithm working fine, the smoothing path algorithm is working excellent too.
The problem is: pathfinder grid is not equal to monster hitbox (collision range), the grid size and ...
0
votes
0
answers
28
views
Side scrolling collisionbox system either has player falling through floor or running out of memory based on my methods
I had a system with checking, but as it scrolled, I basically sank into the floor. I had chatGPT comment my code for helping with this.
The main problems seem to be the ReassignCollisionBox(), which ...
0
votes
0
answers
97
views
Construct spatial network of natural tunnels via 3D raytracing in R
Short question: How to do 3D ray-tacing/collision-detection, in R?
Longer question:
I have a 3-dimensional triangular mesh of animal burrows in soil produced my a micro-CT scanner (wavefront file ...
1
vote
1
answer
80
views
Collision doesn't work under very specific circumstances
This is my player's update function:
void update() {
IsOnWall = false;
IsOnFloor = false;
int collide[4] = { collidelist(Rect{pos.x, pos.y + vel.y, hitbox.width, vel.y + 1}, Stillbodies),
...
-1
votes
1
answer
60
views
PyGame multipleobjects comparisons/collision detection [duplicate]
I was able to create the collision of 2 objects in PyGame using the calculation of Euclidian distance.
Circles created are moving on the screen, changing the coordinates based on the "gravity&...
0
votes
1
answer
81
views
Unity 3D. My character is shaking on the surface
I use MVC in my Unity 3D project. I have CollisionPoller to determine contacts and movement. If I use my MoveController and CollisionPoller my character is shaking Y axis every frame per +/- 0.01.
If ...
1
vote
1
answer
51
views
how to keep window color changed in pygame
Im trying to make it so when my picture bounces, the window changes to a random color, but when it changes, it only changes for a split second when it collides then the window changes back to white
...
3
votes
1
answer
116
views
Polygons on 2D plane: Calculate the exact shift to resolve overlaps
I'm working with polygons on a 2D plane that have Tetris-style gravity. Each polygon can rest either on the X-axis or on top of another polygon. If a polygon overlaps with any other polygon(s), it ...
0
votes
1
answer
29
views
Possible collision not working? no Movement
Trying to create movement through vertical axis, only when objects are overlapping. I basically want my character to be fixed to the wall before they're able to climb up.
Here's my player code, no ...
0
votes
1
answer
550
views
Godot Mesh Create Collision shape: Mesh is empty
I have a very basic mesh imported for this example. I just resized the default blender cube to a more plane-like structure and exported it into glb and then imported it in Godot.
In Godot, I created a ...
0
votes
1
answer
69
views
How to calculate offset on collision between two rectangles based on their relative positions?
I am working on a collision detection system where a moving rectangle (movingRect) collides with a stationary rectangle (steadyRect). Upon collision, I want to calculate an offset that should be ...
1
vote
3
answers
200
views
Efficiently Finding Nearest Non-Colliding Position for a Rectangle in 2D Space?
I’ve been struggling with a problem related to collision detection and positioning in a 2D space, and I could really use some guidance on achieving good performance.
I have a rectangular boundary (...
0
votes
2
answers
182
views
Finding the intersection of two lines a given perpendicular distance from the line of intersection
I'm looking for help to solve the following situation. I have a line segment defined by two points P1 and P2. And I have a ray that starts at P3 and intersects segment P1P2 at P4. I want to calculate ...
1
vote
1
answer
98
views
Why does my player move diagonally through the colliders?
I have a simple setup. A player with a camera, a plane that the player walks on, and two walls with box colliders.
THE PROBLEM
When moving in one direction (X or Z-Axis), the player stops when ...
0
votes
1
answer
51
views
Collision detection only working on the last placed piece
I have been making a simple tetris game to enhance my java skills and here are the two classes:
import java.awt.*;
import java.util.ArrayList;
public class Piece{
int posX;
int posY;
...
1
vote
1
answer
73
views
How to make a collision that works with rotation?
I have a problem because - if I rotate the block collision is still a box. I want to make hit boxes rotated too but I don't know what to do.
Also I don't use import in libraries.
Here is my code to ...
0
votes
1
answer
65
views
Ignore collision between parent objects in order to detect collision between its child game objects
If weapon collided with the body deal damage, if weapon collided with other weapon do not deal damage.
Problem is that when two weapons collide it detects it as if Player object and Goblin object ...
1
vote
1
answer
40
views
Using .scale() in HTML canvas causes hit detection issues
NOTE
Here is a link to a video I made demonstrating the issue at hand on Dropbox: https://www.dropbox.com/scl/fo/p19oite64o22sh9bl8s1b/ALnUvrJzNbK7QixHrgHGgdY?rlkey=gpxahqur1kmfdqr1ulow4bk04&st=...
1
vote
1
answer
165
views
Collision detection and response for self intersecting 2d polygons (e.g. soft bodies/meshes, loops of "string")
I am looking for an algorithm to resolve collisions in 2d meshes.
Picture a free floating loop of string represented by a polygon (vertex connected by edges). Nodes and edges can move depending on ...
0
votes
0
answers
49
views
Ways to have only some collisions get resolved handled by Unity Physics, while letting all collisions be detected by code
Often, I want certain GameObjects, which I'll hereafter refer to as "entities", to exhibit the following properties: I want entities to use Unity's physics system for collision with terrain, ...
0
votes
0
answers
53
views
Issue with Horizontal Collision Detection in Game Development
I'm working on a game and having trouble with horizontal collision detection between the player and block objects. The collision seems to work fine when the player collides from below the block, but ...
0
votes
0
answers
501
views
Collisions in Raylib C++
Im making this simple platform game on Raylib C++, and I can't nail down the collisions. I have tried to implement my own collisions:
#include "raylib.h"
#include <stdio.h>
struct ...
2
votes
1
answer
116
views
Collision detection for concave polygons with SAT, round/off error optimization
Basically I want to create my own tools for developing a 2D top-down game and when it comes to collision detection I'm trying to implement the SAT method, but somehow my calculations seem to be way ...
1
vote
1
answer
345
views
Godot4. How to detect collisions ONLY by the first iteration
I have the following problem in Godot Engine: How to detect collisions only the first iteration when Node2D enters the tree?
I'm using Area2D which is 💥 "Explosion" in my game and it has to ...
0
votes
1
answer
299
views
`.is_in_group` method not returning `true` despite being used on an object inside the specified group
I'm making a roguelike game in there is a large, procedurally generated level. There are loads of enemies in the level, and in this case they will only be aggravated and start attacking once you get ...
0
votes
0
answers
126
views
How to make that SAT collision algo implementation work for walls?
I wrote Separating Axis Theorem (SAT) algorithm implementation for collisions in my SFML game by one of the OneLoneCoder video tutorials on YouTube. But it doesn't work for wall colliders, the problem ...
1
vote
0
answers
60
views
How do I fix a collision-skipping bug on my character controller?
I have a player object which is parent to a cylinder object (simply for sprite), MainCamera object, and a checkGround object so that I can check if it is touching the ground in order to jump. The ...
2
votes
0
answers
43
views
How are the feet established in inverse kinematics?
So, I'm working on a game in Unity, It was a 3D game. and I was intending that the player character uses inverse kinematics and prodedural animation, and stuff like that. To be clear they don't have a ...
0
votes
1
answer
42
views
My collider is not detecting collision. Unity2D
It does not detect collision. (I have been trying to fix this for 3 days now)
using UnityEngine;
public class Enemy : MonoBehaviour
{
[Header("Ectoplasm Reward")]
public int ...
1
vote
1
answer
1k
views
How to implement one way collision for platforms in Godot?
I have a 2d platform game and wanted to make the player be able to jump on top of it from the bottom or diagonally from bottom-left or bottom-right. The problem I'm facing is that sometimes the player ...
1
vote
0
answers
75
views
I tried using a slope handling movement script from a tutorial video, my player character falls through any objects with the ground layer
I set the layer of various slopes in my environment to Ground and then set the layer that the slope detector is meant to detect to Ground as well. This would then activate a separate movement setting ...
1
vote
0
answers
54
views
Unity2D Mirror, OverlapCircle not detecting colliders/layermasks
I'm currently making a game prototype. This is a multiplayer rpg, but I'm currently struggling with collisions. My movement script works fine, it is a grid based movement using a move point that I &...