Questions tagged [collision-detection]

Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

279 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
927 views

Using PhysX, how can I predict where I will need to generate procedural terrain collision shapes?

In this situation, I have terrain height values I generate procedurally. For rendering, I use the camera's position to generate an appropriate sized height map. For collision, however, I need to have ...
6
votes
4answers
4k views

Can I use two Collision Boxes on the same GameObject?

I have two Collision Boxes on the same GameObject. I don't want the Collision Boxes to be triggers. I want the Collision Boxes on the actual GameObject, not its children. For example, if I want to ...
5
votes
2answers
1k views

Collision detection between draggable object and world objects?

I have a game I'm making in Javascript that will involve combining items by dragging and dropping them onto each other. Think Alchemy or similar. So far, so good, but I hit a snag while trying to ...
4
votes
2answers
1k views

LibGDX - Tilemap Wall Collision Detection Issues

I cribbed some code from another web tutorial (SuperKoalio - https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java) about detecting a ...
4
votes
0answers
153 views

How can I create a set of collision points for an arbitrary mesh?

In my project I am working on automatically deforming an arbitrary mesh with respect to another arbitrary mesh, within the context of user generated content, similar to this deformer being developed ...
3
votes
0answers
53 views

How to implement path-finding with a large number of blocking agents following similar paths?

I want to implement a demo like creeps laning in Dota 2. So for simplicity, there is Left team and Right team, they are enemies. Units from Left team move toward Right base, and units from Right team ...
3
votes
0answers
136 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
3
votes
0answers
166 views

Understanding unknown mesh data structure

I have a large number of old mesh files in a custom, undocumented binary format. I have managed to parse almost everything but am left with one group of structures, described below, that I don't ...
3
votes
1answer
246 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 ...
3
votes
0answers
227 views

Check if a point is touching a user drawn curve in HTML5 canvas

I am having trouble detecting whether a ball is colliding with a red curve. The curve below is an example of what a user may draw on to the canvas. I can't think of any fast ways to detect collision ...
3
votes
2answers
396 views

Collision detection problem in XNA4/Monogame

I have been trying to get 3D collision detection working for a while and I think (hope) you people can help me. For my project I have created a 'sprite3d' kinda class which is called ...
3
votes
1answer
912 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
3
votes
1answer
103 views

How can I determine “exact moment” of collision with ray casting?

I'm currently brainstorming how the physics for my game engine is going to be handled. It's top down and I'm thinking of using ray casting for collision detection. I've reached two potential problems (...
2
votes
1answer
30 views

Creating a victory zone / Count units inside zone

So I am attempting to create a zone implementation where if the amount of units with a certain tag exceeds the number of units with another tag an objective will be captured standing in the zone will ...
2
votes
0answers
50 views

Support function of Minkowski Difference

I am watching this and if you stop at 7:25, you will find an implementation of the support function. The goal of the function is to give you the farthest point in a given direction. My question is how ...
2
votes
0answers
30 views

Unity - kinematic rigidbody character calling OnCollisionEnter and OnCollsionExit on every frame for specific collisions

I'm encountering an issue with my character collider behavior. I have several elements that are relevant to this issue: a "character" gameobject (capsule mesh), that is assigned with a kinematic ...
2
votes
0answers
147 views

How do you find the collision between 3D boxes and 3D QUAD face meshes?

I have an axis aligned bounding boxes for 3D object collision, but I have a complex 3d mesh that's divided into 3d faces so I want to check for bounding boxes and collision with the faces of that ...
2
votes
0answers
150 views

Getting false positives with SAT

I've been trying to get proper collision detection with SAT in 3D. I started of with this post: How many and which axes to use for 3D OBB collision with SAT. I've been trying to get the right axis to ...
2
votes
0answers
384 views

How can I make a collision detection on marching objects?

In a Raymarching project I need to have a collision detection for my Signed Distance Field shapes. I find a project that Implemented simple collision detection.but I need a more stable Physic when ...
2
votes
1answer
306 views

How do I make mask work

I have been trying to make a game, but mask collision doesn't seem to work. Here is my code: ...
2
votes
2answers
1k views

How can I get the specific tile in a collision with a Tilemap?

I am developing a simple platformer, I have three types of tiles right now: Floor: does nothing on collision. Bad: makes the player lose the game. Good: makes the player beat the game. I am trying ...
2
votes
0answers
589 views

Unity2D: Proper way to implement ladder climbing with a raycast controller?

I originally posted this on Stack Overflow, but was told I might have more luck here: I've been slowing grinding out programming features for my character controller, and one of the last things to ...
2
votes
0answers
264 views

2D platformer:How to avoid “bouncing descend” when walking down slopes?

I've been working on implementing slope collision by SAT(Separating Axis Theorem). And then I have a trouble. When my character walks down slope, it moves like a bouncing ball: The slope has 3 ...
2
votes
0answers
169 views

Event based collision system

Currently I am writing a litte 2D engine for training purposes. Some time ago I had some thoughts about good ways to implement and handle collision. (Not about the particular algorithm, but about how ...
2
votes
0answers
55 views

why collision not detection not happened in Two Sphere

I start practice 3d collision detection of sphere in OpenGl containing two sphere one sphere hit using cannon gun but collision not detect when it hit and when i debug code collision statement triger ...
2
votes
0answers
91 views

Agent avoidance in 3D

I am currently trying to find some alogorithm for agent avoidance in 3D (or for simplicity, 2.5D could be enough). So far, I have been using variation of RVO - "Reciprocal Collision Avoidance" (C++ ...
2
votes
1answer
217 views

C# XNA colliders, physics, inclined plane/terrain/colliders

Currently I'm working on a project to learn game programming. But I'm not sure if I have the right approach on several things, and that's what I'm here for. What I'm trying to create is a small world ...
2
votes
0answers
676 views

Z-order curve — how to query all nearest neighbors?

TLDR: How to query all nearest neighbors with the least effort? (Iterating over a bigger neighboring area that's continuous and filtering out elements that are not immediate neighbors?) Suppose the ...
2
votes
0answers
62 views

Allowing one sprite to move through another in Quintus

I have a Bumper class extended from Sprite: ...
2
votes
0answers
412 views

Polygon 2D collision response- How do I find the correct edge a polygon hit?

Hey guys I've been seriously stressed out by this, so please go easy on me. My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
2
votes
1answer
547 views

Can't make sprite collide with tilemap made with Tiled

I'm a newbie who just started learning phaser. I have created a tile map with Tiled. It is composed of two tiled layer: background & collision. In collision layer I put some walls. And in the ...
2
votes
0answers
94 views

What is the formula for the collision of two “stretched spheres”?

In Smash Bros Melee, hitboxes aren't perfect spheres or boxes. They are, instead, a shape that looks like a continuous line of consecutive spheres: I.e., the geometry can represented as: ...
2
votes
0answers
196 views

Game Physics: Calculating a collision response using the Separating Axis Theorem?

I am working on a project in which I have implemented the Separating Axis Theorem to detect collisions between objects. My current collision response is an object that contains whether it is ...
2
votes
0answers
143 views

Swept AABB vs AABB Calculation Error

I'm having issues running simple AABB vs AABB collision detection. I'm able to successfully detect collisions without checking with velocity. But for some reason my code keeps prematurely firing ...
2
votes
1answer
670 views

How to handle collision detection

So the way that I am doing the movement for my game is that you can left click a unit (which is just a rectangle object), and then it is selected. While it is selected, you can right click and that ...
2
votes
3answers
2k views

BoxCollider2D fails verification, where CircleCollider2D does not

I have a 2D game object with no parent and a 2D box collider set with trigger enables. The dimensions are quite large. When I place the game object in the scene, manually, it works just fine. ...
2
votes
0answers
371 views

2d Circle different ARC's Collision detection

I've read about the way to detect collision between 2 circles or circle and line using trigonometry. But now I would like be able to detect which part of the circle arcs I'm hitting. For example I ...
2
votes
0answers
466 views

How to detect collisions with a material in Unity 5?

I've got a simple car game with 3 different surfaces: grass, tar and sand. I have a basic skid smoke system, but I want the color of the skid smoke to change depending on the surface, for example on ...
2
votes
0answers
557 views

My collision detection is not working when I rotate my mesh in three.js

I am trying to move a ball mesh through a maze. The maze belongs to a parent object3d. My issue is that when I move the ball I can't detect collision right well because in the rotation, the axis ...
2
votes
0answers
139 views

Mouse Interaction in 3D space (ray)

I use this code ...
2
votes
0answers
101 views

What is the most efficient way to determine collision path

I am trying to create a game in which I need to know if two objects will collide in the future, and when. I have both object's position, radius (they are circles) and velocity. A specific example of ...
2
votes
0answers
56 views

Field of vision - Objective-c

Here's where I'm at. Here's where I want to be Here's how it's drawn ...
2
votes
0answers
747 views

Implementing Separating Axis Theorem to Detect and Handle Sliding Collisions

I am having a bit of difficulty detecting collisions properly with separating axis theorem. My code seems to be giving a lot of false alarms. Also, I've looked into implementing sliding collisions ...
2
votes
0answers
822 views

Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?

I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster. The player has a hurtbox and the sword ...
2
votes
0answers
656 views

2D Distance Field as collision handler method

Pixeljunk Shooter has really cool fluid simulation. I found the dev's video explaining what they did. Here I understand that it is particle based simulation Smoothed Particle Hydrodynamic I can ...
2
votes
0answers
272 views

How do I compute the angle between a pixel on an irregular curve and a circle colliding with it?

I'm building a custom physics engine to accompany a level-editor. This image shows how the level-editor outputs levels: Now, some explanation is in order. The curve is defined by the red points. ...
2
votes
0answers
410 views

beginContact triggered more than once on some objects

Short version: It looks like beginContact is detecting continuous collisions. I'd like to avoid that. Long version : I use Box2Dweb to write a 2D platformer. It's my first game using this lib, and, ...
2
votes
0answers
277 views

scale rotating boundingbox

I want to use basic rectangular collision detection. I have a rotating sprite and a method that calculates the bounding box every time in the Update() method. I simply check for intersection between ...
2
votes
0answers
617 views

Why does my RigidBody collision fail depending on which entity is moving?

I am working on a UDK project and have a collision problem. I have a Crate which is a kActor with RigidBody physics and my player who is a Pawn. When my player moves and collides with the crate, the ...
2
votes
1answer
594 views

Collision in PyGame for spinning rectangular object.touching circles

I'm creating a variation of Pong. One of the differences is that I use a rectangular structure as the object which is being bounced around, and I use circles as paddles. So far, all the collision ...