Questions tagged [raycasting]
A technique for using rays to determine points of intersection. Often used in lighting simulation.
455
questions
0
votes
1
answer
27
views
How to filter/ignore child objects from an ML Agents RayPerceptionSensor in 3D?
I am making a snake AI with Unity ML Agents. There will be lots of snakes who will eat and dodge each other.
A 3D RayPerceptionSensor detects everything, but there is a specific case where a problem ...
0
votes
1
answer
32
views
BSP Tree Troubles and Unpredictable Results
I've been trying to fix this problem myself for ages, but I really do need help. I'm creating a BSP tree for my 3D game (baked in the map files, quake style) to replace my existing naïve collision &...
0
votes
0
answers
57
views
Why doesn't my Raycast detect AABB collision?
I have the following struct that calculates Raycasting:
...
0
votes
1
answer
94
views
Mouse Ray Picking: Z-Coordinate of Projected vector (glm::unproject)
I've run into a curious issue when implementing ray picking in my game engine.
It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
0
votes
1
answer
51
views
Finding the index in a material where a raycast hit
I have a gameobject with a mesh collider. The mesh is simply a flat plane.
I raycast to the mesh and I'd like to get the index on the material's basemap where I got a hit.
I assumed ...
0
votes
0
answers
56
views
How to align to 2D ground surface directly underneath?
I'm out of ideas at this point.
I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
0
votes
0
answers
34
views
Ray-Sphere Intersection Always States Ray Origin Is Point Nearest Sphere Center
I am writing a simple graphics engine using Rusts WGPU. I have a Sphere rendering at the origin of my scene like so:
...
0
votes
0
answers
58
views
Red raycast despite valid target in Unity VR
I have a question regarding Unity VR and Interaction Toolkit.
When I point at a UI canvas element, the raycast turns from red to white (indicating that it is a valid target). However, when I create a ...
0
votes
0
answers
46
views
Raycasting unable to detect water layer
I'm having issues detecting the ocean in my Unity scene (screenshot below) using Raycasting. In the image below, I've attached my script to a child object and set the layer for the Ocean object to ...
1
vote
1
answer
55
views
How to detect colored pixel of Sprite3D texture with perspective camera ray?
I've tried to ray cast my mouse position to Sprite3D on screen but I have some problems with it.
...
0
votes
2
answers
108
views
Detecting collisions with trajectories
What if an object were to have collision detection implemented as so: A ray in the direction the object is moving in, and a ray in the direction of gravity.
1
vote
1
answer
209
views
Raycast suspension simulation rebounds car on landing
I'm expecting the car to land and engage the suspension to dampen the landing. The code I'm using currently has this effect:
...
0
votes
0
answers
21
views
How to stretch a cylinder when dragging with a Ray Interactor?
I'm making a VR game in Unity.
I want to select a cylinder with ray interactor and drag it, and as I drag, it should stretch.
This is the code I have currently for 2D:
...
0
votes
0
answers
47
views
Casting out vision rays for 2D car in pyglet to return distance from objects?
I am working on a machine learning project that involves training a 2D car to drive around a top-down racing track. I'll be training neural networks using different algorithms and one essential form ...
1
vote
0
answers
45
views
Offset in a raycasting algorithm
I'm trying to implement a function that takes a ray as its start and end position and returns all intersections with the map grid.
I wrote following code and got a problem. Function returns correct ...