All Questions
Tagged with ray-casting or raycasting
455 questions
0
votes
0
answers
88
views
How to Implement Ray Casting and Aim Assist Scaling in UE5 Using C++ for FPS Mechanics?
I'm developing an FPS shooter in Unreal Engine 5 and currently working on the aiming mechanics for keyboard and mouse (KBM). I want to implement an aim assist system that uses ray casting to detect ...
0
votes
2
answers
163
views
How to make a raycaster render complex scenes?
I have written a simple raycaster in C++ which can render wall based scenes like 3d mazes. On YouTube I saw a video showcasing 3D games made in Scratch. One of the games were a 3d racing game where ...
0
votes
0
answers
58
views
How to use sensors and ray casting for collision detection in Pygame (using a custom Mask/sensor class)?
I am making a Sonic game in Pygame and I have recently gotten my hands on a Python class that uses pygame.rect and pygame.mask in unison to create sensors that can be used to accurately detect the ...
0
votes
0
answers
95
views
Raycast DDA: Wall rendering and floor rendering out of sync
I come for theory help with a classic raycast algorithm (currently, based on DDA). The problem is not with the algorithm itself, but with the floor rendering code.
I left the code of my raycast render ...
1
vote
1
answer
125
views
Why is my raycast not working?
I'm trying to ray-cast mouse clicks to the surface of a sphere (from which point, I'm going to get the coordinates of the vertex of the sphere's mesh that are closest to the click). The following ...
0
votes
1
answer
84
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
171
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
1
answer
342
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
106
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
129
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
47
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
95
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 ...
1
vote
1
answer
96
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
152
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.
0
votes
0
answers
49
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:
...