Triple trace magic?

[sp]Interesting choice of title? I don’t honestly care…
I’ve been requesting answers with no salvation.[/sp] You don’t want to hear that.

I’m an idiot I guess, I can’t get this working. Well, there are two things really.

Número uno: I made an entity like the sEnt ball, but with a much different functionality. When it bounces it starts spinning around insanely. I want to prevent that!

Número dos: I want to make three infinite distance traces that run at the same time; the directions are relative to the direction it’s moving. Forward trace, left trace, and right trace. They will be fired every .1 seconds preferably using PhysUpdate

[editline]5th December 2013[/editline]

You have NO IDEA how many different methods I’ve tried! The most I got was the same number thrice, even though I used :forward for 1, :right for 3… You know the rest, no errors.

What’s the question? All I see is a jumble of words

You cant make infinite tracers, the map size limit its 32*1024 units (16k each direction from the center) as for spinning, remove the physics init sphere bit from the code

16384, but the total max edge to edge is 33768
Without physics init sphere is have horrible collision! What I meant by infinite was that no matter what direction it traces it will go as far as is possible!

For that matter, I still don’t know how to get the different trace directions working for unique values for all three (simultaneous traces)

I don’t know if that confused you

[editline]5th December 2013[/editline]

[sp]Brandonj4 is annoying. He says stupid things and rates me dumb no matter what I say![/sp]

There’s othet way around it. You can try SetRenderAngles, but I doubt it will do anything useful. And I still dont have a slightest idea what or why you are trying to do with the tracers.

I have a plan that requires the distance to the left right and forward directions. You’ll see when it’s done.

Why the fuck you ask for help and then say “You’ll see when it’s done”? If you do not need help, do not post.

[lua]
–Get the angle you are facing, or moving in, or whatever you want
local MyAng = ent:GetAngles()
local MyPos = ent:GetPos()

–Get the fwd/right/up normal vectors
local fwd = MyAng:Forward()
local right = MyAng:Right()
local up = MyAng:Up()

–Do three traces
local fTrace = util.TraceLine( { start=MyPos, endpos=MyPos+fwd64000 })
local rTrace = util.TraceLine( { start=MyPos, endpos=MyPos+right
64000 })
local uTrace = util.TraceLine( { start=MyPos, endpos=MyPos+up64000 })
–You should maybe add a 4th trace for left? (MyPos+right
-64000)

–Do whatever you want with the results
print( “Front distance”, (fTrace.HitPos-MyPos):Length() )
print( “Rightdistance”, (rTrace.HitPos-MyPos):Length() )
print( “Up distance”, (uTrace.HitPos-MyPos):Length() )
[/lua]

Thanks! If it works you’ve helped a lot!

Edited:

According to pythagoreans theorum the distance between corners (-16384, -16384, 0) and (16384, 16384, 0) is approximately 46340.950011841578559133736114903 units. The actual number just has a much longer decimal.
Rounded, 46341 units from corner to corner.
Of course, 32768 units from side to side straight.

Because of this, I will only use 46500, 47000, or 50000. I’m a math geek with OCD!

Edited:

√[32768² + 32768²] ≈ 46340.95 ≈ 46341

[editline]5th December 2013[/editline]

I never really considered I might need up and down traces, I graphed the plan out on a plane model, not a perspective grid model.

[editline]5th December 2013[/editline]

Worked like a charm, wh1t3rabbit! Domo Arigato, Merci beaucoup, muchos gracias, thanks you very much!

[editline]5th December 2013[/editline]


			local fTrace = util.TraceLine( { start=MyPos, filter = { self, self.Owner }, endpos=MyPos+fwd*50000 })		-- Forward
			local lTrace = util.TraceLine( { start=MyPos, filter = { self, self.Owner }, endpos=MyPos+right*50000 })	-- Right
			local rTrace = util.TraceLine( { start=MyPos, filter = { self, self.Owner }, endpos=MyPos+right*-50000 })	-- Left
			local uTrace = util.TraceLine( { start=MyPos, filter = { self, self.Owner }, endpos=MyPos+up*50000 })		-- Up
			local dTrace = util.TraceLine( { start=MyPos, filter = { self, self.Owner }, endpos=MyPos+up*-50000 })		-- Down

[editline]5th December 2013[/editline]

without the filters it says 0,0,0 a lot