A technique for using rays to determine points of intersection. Often used in lighting simulation.

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

Is it possible in Unity to Flip a 2D Sprite Without Flipping the Object it is Assigned to?

I 'built' (followed a tutorial) on a collision detection system, and when I flip the object to go left and right the collision messes up. So I have three options; find a way to modify the collision ...
-1
votes
1answer
29 views

Simple voxel-block melee removing script

I'm trying to create a voxel based game, now I want my character to remove blocks with a melee weapon, but I'm not sure which way to go. I mean is it the only way to get the Block with a raycast? I ...
0
votes
1answer
54 views

Raypicking / raytracing in OpenGL

Alright, so before you down vote saying that OpenGL doesn't support rays for rendering, please read: So I want to detect a quad in opengl 1.1( I don't want to use opengl 3.0). I wanted to detect it ...
0
votes
0answers
8 views

Unreal engine: How to get FHitResult.FaceIndex?

When I do PlayerController->GetHitResultUnderCursor(ECollisionChannel::ECC_WorldDynamic, false, TraceResult); TraceResult.FaceIndex is always -1. Here @OriCohen says that I have to "use a ...
0
votes
0answers
21 views

Unreal Engine 4 Line Trace Error

This is the error that I am currently facing: PlayerPawn.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl APlayerPawn::Trace(struct FHitResult,class AActor *,struct FVector ...
2
votes
3answers
54 views

Unity - Check if object is facing Vector3 coordinates

I am having a hard time figuring this out, I want to have objects that move around randomly, and when they get new coordinates to move towards, face them, and then move. Here's explained: Target ...
0
votes
0answers
17 views

Problem with cameracliping unity

Hello GameDev Community, i've got a small problem with figuring out a way to do cameracliping in the unityengine with raycasting i got two main problems the first being that my camera flicks ...
0
votes
1answer
21 views

Collision resolution moving Point to AABB with raycasting

This is probably trivial, but I'm having trouble making it work. I have a 3-coordinate world of particles simulated with Verlet Velocity. I only care for collision between their centers and a few ...
0
votes
0answers
95 views

How do you set up the physics for a tank?

My goal is to make some tank like vehicle since there is not a suitable one in unity5 store yet. First I tried wheel collider, could not get it to work. I tried to use raycasting and fixed joint, ...
1
vote
1answer
57 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 ...
1
vote
1answer
37 views

How to resolve collisions when using ray-casting to predict the location of future collisions?

I ran into a question I can't seem to solve, while implementing the movement/ collision checking code for my game. The game is in 2D and all objects in my game use either AABBs or circles as collision ...
0
votes
1answer
46 views

OpenTK Ray Picking

I just can't get ray picking to work (I need to drop old working faedback mode, and replace it with color pick, but because my scene can have up to 300K+ objects it is reasonable to filter (it's a ...
1
vote
0answers
40 views

Issues with 2D raycasting lighting under limitations of HLSL 3.0 pixel shader

I've been writing my own HLSL pixel shader for dynamic lighting using raycasting. Unfortunately, since I'm using this out of XNA, I can only use up to ps_3_0. As you can see, the limitations ...
0
votes
1answer
71 views

How to Reciprocally draw on a 3D mesh and 2D UI Image in Unity?

My question is a bit involved so I'm going to split it into parts and attach a picture. 1) In Unity I'd like to be able to draw a line on a 3D worldspace mesh with the mouse. 2) As I'm drawing on ...
0
votes
1answer
49 views

Would Raycast suffice for a game clock based on sun position?

I need help with some logic in my script. I created a dynamic day/night cycle that works fine in itself, but I want to add a game clock that works off the initial position of the sun (Directional ...
1
vote
1answer
53 views

Raycast, UI and Update Question

I have movable objects in a scene. When Raycast hits an object, I have a hovering UI that moves to a retaliative distance from the hit object. When the object is dragged, the UI's position is moved ...
4
votes
2answers
144 views

Best way of writing pixel manipuliting-intensive applications with OpenGL/Direct3D

Recently I have been making little experiments with engines similar to old Wolfenstein 3D, Doom and Build, engines where the 3D rendering is entirely done in software and therefore you need full ...
1
vote
0answers
59 views

Can I render 3D objects in Ray Casting engines?

I was gathering some information on the glorious Ray Casting technique. As far as I've understood it's not a complete 3D rendering, and that's why objects and NPC's are often displayed as simple ...
2
votes
1answer
264 views

Is Physics2D.BoxCast a safe alternative to a row of raycasting?

Raycasting in rows is a common practice. Is using the Physics 2D BoxCast function a good alternative to using multiple raycasts spread out (an example use being collision detection in a custom ...
0
votes
1answer
105 views

How would I check the range against the entirety of an enemy object, and not just it's transform.position?

I want to be able to do range checks against the entirety of an enemy object, and not just it's transform.position. The enemy object can have it's side or nose within range, but range detection will ...
0
votes
1answer
36 views

Given a ray-intersect position on morphed mesh, how to compute that position at each morph target?

I'm working on an annotation system that allows a user to click on a mesh to attach a pin with a label hanging off it. It must be possible to pin an annotation on an object that's being morphed with ...
0
votes
1answer
136 views

Raycast Masks not working Unity3D

I'm having a problem with filters/masks when raycasting. I've created a LayerMask and then in the inspector selected the layer I want to ignore when Raycasting. however then I print out the name of ...
2
votes
1answer
193 views

Simple Doom style engine question

I've just started making a 'raycast' engine, a pseudo 3D FPS engine similar to Wolfenstein/Doom. I haven't done much reading so my implementation is likely very naive. My current working prototype ...
0
votes
0answers
91 views

Trouble with Raycast Selection using OpenGL

I am currently having trouble with a custom model editor in which I want to implement model selection (eventually featuring face selection to have something like "click-and-drag" to extend the cubes). ...
0
votes
1answer
172 views

My Raycast will not detect collisions in my Unity 2D project. What am I doing wrong?

I appreciate any help you can offer me. I created a script for a character controller that casts two rays below the player's gameobject. The rays extend infinitely and should collide with another ...
0
votes
2answers
161 views

Fast Ray Sphere collision code

I am looking at here and while it's well organized a lot of links are broken: http://www.realtimerendering.com/intersections.html I am trying to find fast code that will give me the hit point and the ...
0
votes
2answers
104 views

RayCast method always outputting False

I am having trouble executing a raycast to check if there is anything between the player sprite and a second sprite. This is my code : void Start () { play1 = GameObject.Find("player"); ...
1
vote
0answers
89 views

parented/constrained object transform lags when moving character in unity3D

Hi I have a simple raycast-base gun that emits particles along it's path to fake bullets. Whenever I move the camera/character- the particles are misaligned, as well as anything else I try to modify ...
4
votes
1answer
1k views

Blocking Physics Raycasts with Unity's 4.6 UI?

I use raycasts to determine hit objects and object selection in our game. I want these to be blocked by UI elements. Before I had a crude form of that where I just excluded rects of the screen, though ...
0
votes
1answer
56 views

How to represent ray and line segment in parametric form?(Visibility)

I am trying to implement this algorithm but am not sure how I am supposed to represent my ray and my line segments(walls). For the r_px/r_py do I just use the position of the light? For the ...
0
votes
1answer
84 views

Get fragment from mouse position

I have a painting app for texture artists that I am working on. I am able to paint to a flat canvas that updates the texture of a 3d object in an object viewer. Now I want to be able to paint directly ...
0
votes
1answer
98 views

How to reference the right object in Unity

So, I'm developing this small 2D project where I have a sphere that detects if objects get close to it from three different directions. I have successfully found a way to detect if an object ...
1
vote
2answers
102 views

How can I create a precise touch in Unity

Is there a way so that I can touch an object precisely? I have these aerial cars and there pretty tiny like 32 by 32 and it's hard to touch them using a raycast. I thought I'd spawn an object with a ...
1
vote
1answer
2k views

Graphics Raycaster of Unity; How does it work?

I'm making a small game for the first time and enjoying it thus far. The only thing that keeps bothering me is that I can't find a human explanation of what the graphics raycaster does. What's the ...
1
vote
1answer
56 views

Finding the side of a shape a ray intersects

For some simple 3D shapes (cubes, prisms) how can I determine which side a ray intersects, knowing the direction of the ray, and the normals of the shapes' sides. I thought of using plane ...
1
vote
1answer
223 views

What is the correct way to raycast on click?

I am using raycast from screen point to detect if the user has clicked/touched on something. The following fails 1/10 times; at first I thought due to the raycast missing the subject below, but after ...
-1
votes
1answer
146 views

2D bouncing formula doesn't work properly

am new to unity, and i am trying to create a bouncing ball, so i've did many researches about bouncing realted physics and i found a formula : Formula: -2*(V dot N)*N + V Where V is the velocity ...
0
votes
2answers
351 views

Raycasting on Z in 2D

I'm making an isometric game in Unity. So far I have managed to render a diamond shaped board, with tiles that are aligned on the x and y axis (and the camera looks down the Z axis). I am spawning ...
1
vote
1answer
152 views

Problems with Raycasting Requirements

Im working on a script which kinda works like an Enemy AI. Its kinda like a detection system with requirements that are required to be met. This is a recent question i asked using my code Raycast ...
0
votes
0answers
56 views

Ray casting: need to find start and end vectors

So I have a 3D object and I'm trying to implement Maximum Intensity Projection on it. I already started of using a default vector to show per pixel, namely: pixelCoord[0] = uVec[0] * (i - ...
1
vote
1answer
138 views

Raycast Flashing problem

Can anyone tell me what is wrong with me code? If you can see, whenever the player is in range of the raycast, the enemy turns red. But for some reason, even when the player has meet the requirement ...
0
votes
0answers
51 views

Why Reducing fragments by increasing geometry vertices turn out to be slow?

I am developing a ray-casting program by OpenGL. At first I made a large bounding box including the whole volume and render this box, which triggers the ray-casting. I'm trying to optimize this ...
-3
votes
1answer
79 views

Direct raycasting from moving point A and moving Point B

I am attempting to raycast from Point A to Point A (both moving points). I dont understand the comcept of raycasting (direction). Update() { player = GameObject.FindGameObjectWithTag ("Player"); ...
0
votes
1answer
2k views

How can I raycast between two moving objects in Unity?

How can I raycast between two moving objects? I want to raycast from a moving enemy to a moving player. I dont know how to actually code to make the direction work. using UnityEngine; using ...
0
votes
0answers
33 views

Creating a ray with angle movement restrictions

In Unity is it possible to create a ray which has movement restrictions. As in creating a ray which is fixed to one point. When this point is moved around. The line is also moved around. But when the ...
2
votes
3answers
532 views

Unity Raycast shoots right through some objects

I made a melee combat system for my game. The code looks like this: var hit:RaycastHit; if(Physics.Raycast(transform.position,transform.forward,hit)) { if(hit.distance<=2.0) { ...
5
votes
2answers
219 views

How can I consistently identify location on a mesh from a raycast hit?

I am using RaycastHit.triangleIndex to identify a location on a mesh (very low poly). However, I have discovered that a given triangle on the mesh does not have the same triangleIndex value from one ...
3
votes
2answers
187 views

Intersection between moving circle and some squares

I'm developing a 2D game made of squares. What I need to do is check if a circle collides with any of the squares as it moves. I have a raycast function to check the same idea, but using a point. I ...
3
votes
3answers
215 views

Is there algorithm for boxcasting or thickray casting?

I am not sure what the correct name is called but here is my problem: I have implemented a casting ray function that works as expected. However, because I am using a loose grid structure, (ie, objects ...
0
votes
1answer
122 views

Ray casting problem using JOGL

I'm trying to port an old perfectly functioning ray casting implementation from my lwjgl project (FF pipeline) to a new project using JOGL and shaders. My problem is that my ray no longer intersects ...