Mathematical Bounce

HydraRancher

Truth begins in lies
Reaction score
197
I havent been able to find a good system which calculates a projectile bouncing off the wall, can anybody help?
 

Nexor

...
Reaction score
74
system for a bounce?

the main issue with the bounce off walls is the wall, not the calculation.
 

LearningCode

New Member
Reaction score
24
Oh, the irony;

1) Man asks question about bouncing
2) Another Man replies and the guy's avatar is of a ball.
 

DrEvil

FCRI Associate!
Reaction score
111
Somebody trolling much :cool: ? (Hands up your Busted! *pow pow* :D )

To properly calculate bouncing off walls , you need to check around the unit ( in a few directions ) for pathable ,to find the way it was going and calculate the bounce off .
I think one of the meathook spells had something like that... maybe someone else can help more ..
 

LearningCode

New Member
Reaction score
24
Calculating like that only makes you go, like, a light ray.
As in, the dummy will bounce unnaturally.

Unless it is off a wall..
Does he mean bouncing up and down or off walls? o.0

[EDIT]
Wait-
I just re-read the first post xD

[EDIT=2]
Hmm..
Place invisible path blockers that you want the ball to bounce off of.
With the trigger, make the ball move (I assume you already can do that)
Then, every 0.03125 seconds, check if the ball is within a certain AoE of the pathing block, (A small value and make sure it gets the nearest pathng blocker)
if so, Get the angle between the ball and blocker and inverse it, then, send the ball that direction.
 

Laiev

Hey Listen!!
Reaction score
188
@Learning..

what do you smoke? :nuts:

you don't need to create doodads in all maps to block someunit to walk..

just check if is walkable

also if you check with this time lol

of course the map will lag :rolleyes:
 

Romek

Super Moderator
Reaction score
964
This is probably what you want, and isn't overkill like a full physics system.
 

HydraRancher

Truth begins in lies
Reaction score
197
The only thing I want it to bounce off is Camera bounds, which I know you can check by checking 100.00 units ahead, then seeing if that distance is less than or equal to 10. All I need to know, is how to get it to bounce.

Note: If emjlr3's calculation is correct, can somebody write it up in GUI? Or in a non-JASS type :eek:
 
Reaction score
333
x0,y0,z0 is the direction of the incoming projectile.
x1,y1,z1 is the direction the wall is facing.
x2,y2,z2 is the new direction of the projectile after colliding with the wall.

d = x0*x1 + y0*y1 + z0*z1
x2 = x0 - 2*x1*d
y2 = y0 - 2*y1*d
z2 = z0 - 2*z1*d
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top