2
votes
1answer
70 views

Detect obstacles in path on a tile-based map

I'm creating a 2d game with a tile-based map, but smooth movement. I currently use A* in combination with some other tricks for pathfinding, and one issue what I've been dealing with is getting the ...
0
votes
1answer
88 views

How to find objects in front of my player

I am trying to find an object that is in front of my player sprite using the following code RaycastHit2D hit = Physics2D.Raycast(transform.position,Vector2.right,EnemyLayer); //EnemyLayer is the ...
0
votes
1answer
118 views

How does Raycasting work in XNA Farseer and player collision?

Wanting to know how to figure out if player's bottom is colliding with object so that I could allow the player to jump. I was trying to use OnCollision but was referred to ray-casting, I looked ...
0
votes
1answer
200 views

Platformer raycast collision detection

I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
2
votes
3answers
150 views

Strategy for detecting hits from a “cylinder ray”?

I was planning on using ray casting for collision detection in my game. However, when I use an attack similar to this: (which would project something like a cylinder), how would I go about ...
1
vote
0answers
129 views

How to identify whether the boundingvolume intersects with walls or floor when it doesnt return normals?

My game in jMonkey is the kind that use will have to place objects in a scene (which consist of walls and slabs and floor). All my models are centered at origin. When the user click a point I use ray ...
0
votes
1answer
128 views

How to place an object so that it does not overlap the objects in my scene?

In my game, the user has to click at a point to place an object (mesh). I can cast a ray and find the horizontal point where the object can be translated and then attached to rootNode to display it. ...
8
votes
3answers
762 views

Narrow-phase collision detection algorithms

There are three phases of collision detection. Broadphase: It loops between all objecs that can interact, false positives are allowed, if it would speed up the loop. Narrowphase: Determines whether ...
6
votes
1answer
2k views

Why doesn't Unity's OnCollisionEnter give me surface normals, and what's the most reliable way to get them?

Unity's on collision event gives you a Collision object that gives you some information about the collision that happened (including a list of ContactPoints with hit normals). But what you don't get ...
1
vote
2answers
2k views

How to handle 3D collisions using raycasting (with a reflection vector?)

I'm making a game using THREE.JS, and I want my character to walk on the terrain, and collide with static 3D objects (=AABB boxes) that are on that terrain. The problem is: THREE.JS has only a ...
1
vote
1answer
2k views

Raycasting Collision Detection

I need to check for collisions when firing a bullet, but I have a few questions first. My game is 2D and tile based, it also uses the XNA framework. From what I've read raycasting or continuous ...
4
votes
1answer
1k views

Finding if a point is inside of a mesh (Point-in-polyhedron)

How can I find if a point (Vector3) is inside of a mesh? Would this work for both concave and convex objects? I read somewhere that if you raycast in both directions of every axis (X, -X, Y, -Y, Z, ...
0
votes
2answers
621 views

3D collision detection with meshes using only raycasting?

I'm building a game using WebGL and Three.js, and so far I have a terrain with a guy walking on it. I simply cast a ray downwards to know the terrain height. How can I do this for other 3D objects, ...
3
votes
2answers
333 views

What are the technologies that makes physics engines so good for raycasting?

again. This question is strictly related to this one so, what is the technology that makes physics engines suitable for raycasting? It is a particular data structure? Has it to do with the engine's ...
4
votes
3answers
3k views

Why do we use physics engines for collision testing or raycasting?

There is a thing I don't understand about game engines: why it is so common to use physics engines to do raycasting or collision testing? Say that you have a 3D scene loaded in your scene manager ...