Hi there,
I have the following code to bounce an object:
While bouncing works well, I'm stucked getting sliding working. How do I need to fit the line vector into this to get the sliding velocity? Best of all would be to have a modifier bounce# to define the amount of bounce/slide (e.g. bounce=0 means full sliding, bounce=0.5 means the angle halfway between full bounce and slide).
I'm aware of the existing threads about this topic, but I can't produce a working solution out of them, so maybe someone can push me in the right direction.
Thanks
Jake
I have the following code to bounce an object:
'Vx/y= Velocity (incoming object) 'normalx/y = surface-normal 'linex/y = line vector dotprod=Vx*normalx+Vy*normaly resx=-2*dotprod*normalx + Vx resy=-2*dotprod*normaly + Vy Vx= resx * (1-Damping) Vy= resy * (1-Damping)
While bouncing works well, I'm stucked getting sliding working. How do I need to fit the line vector into this to get the sliding velocity? Best of all would be to have a modifier bounce# to define the amount of bounce/slide (e.g. bounce=0 means full sliding, bounce=0.5 means the angle halfway between full bounce and slide).
I'm aware of the existing threads about this topic, but I can't produce a working solution out of them, so maybe someone can push me in the right direction.
Thanks
Jake