• How do I hit a func_brush which isn't solid (and is textured with nodraw) with a trace?
    19 replies, posted
I have no idea how to do this. The part about masks on [url=http://wiki.garrysmod.com/?title=Trace]this page[/url] doesn't really help me. Any ideas?
A custom trace with [b][url=http://wiki.garrysmod.com/?title=Util.PointContents]Util.PointContents [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]? Edit : Yeah nevermind, dumb idea.
[QUOTE=Crazy Quebec;21347842]A custom trace with [b][url=http://wiki.garrysmod.com/?title=Util.PointContents]Util.PointContents [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]? Edit : Yeah nevermind, dumb idea.[/QUOTE] Just returns CONTENTS_EMPTY :saddowns:
And of course you have no way to know beforehand where said brush will always be?
[QUOTE=Crazy Quebec;21348506]And of course you have no way to know beforehand where said brush will always be?[/QUOTE] I do, actually. I just want to hit an invisible, not solid brush which is always in a set place.
The face that is covered in nodraw will not exist. [editline]06:28PM[/editline] No matter what you try to do, the only thing that will work (Theoretically) is comparing co-ordinates.
[QUOTE=|FlapJack|;21348779]The face that is covered in nodraw will not exist. [editline]06:28PM[/editline] No matter what you try to do, the only thing that will work (Theoretically) is comparing co-ordinates.[/QUOTE] What would happen if I textured it with tools_invisible?
It would be compiled, therefore would exist. [editline]06:56PM[/editline] Might work.
Invisible works, but then it's solid again... I also tried playerclip, but then the trace doesn't hit it... Maybe I should just do calculations. I will just tell what I want to do: I want to be able to hit a large, imaginary plane by using the trace mentioned in the OP, but since using traces is a bitch I'll have to calculate the position on the plane. But I have no idea how to do this...
You could always set it to func_illusionary. Though, I'm not sure if that would work for what you're wanting.
Found something interesting. [url]http://en.wikipedia.org/wiki/Line-plane_intersection[/url] But my limited math knowledge doesn't know how to translate this math language to Lua :crying: [editline]08:42PM[/editline] Perhaps I can figure this out myself: [url]http://www.thepolygoners.com/tutorials/lineplane/lineplane.html[/url]
That might sound dumb, but can't you just place a SENT there that is invisible and no-collides with everything? Traces would still hit it.
OK, I will explain it with a diagram. Because a diagram makes everything 100x clearer. [img]http://www.cubeupload.com/files/13bc00diagramlineplane2.png[/img] See where I'm going here? In my situation, the trace goes right through the plane and hits the skybox instead. Placing a SENT there wouldn't be a perfect solution. The box's width & height almost touch the Hammer grid.
Try setting the brush's collision group to GROUP_DEBRIS_TRIGGER
[QUOTE=|FlapJack|;21350634]Try setting the brush's collision group to GROUP_DEBRIS_TRIGGER[/QUOTE] Nope, although the trace hits it, the brush is still solid.
[QUOTE=Dlaor;21351158]Nope, although the trace hits it, the brush is still solid.[/QUOTE] Odd. The brush should only collide with debris.
Wait, it DOES work, I made a typo. FINALLY! :buddy: Thanks a ton!
You know you probably could not do it hackily by: Trace first without any checking against the imaginary plane. If the trace hit's about the plane's y you know it can not hit the plane. Then do the math for a ray/plane intersection test. Then you don't need to hack about with brushes, etc.
use a solid func_brush with a given name, then locate it and set some kind of flag (.nocollide or w/e) on it in InitPostEntity() and then make shit not collide if it's got the flag in ShouldCollide()?
[QUOTE=Lexic;21353992]use a solid func_brush with a given name, then locate it and set some kind of flag (.nocollide or w/e) on it in InitPostEntity() and then make shit not collide if it's got the flag in ShouldCollide()?[/QUOTE] That's a pretty clever idea actually, but my current solution seems to work fine.
Sorry, you need to Log In to post a reply to this thread.