Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A bigger bouncing ball demo - collision with vector reflection
#6
(09-17-2024, 05:51 AM)bplus Wrote: great!

How is y*y getting > r2 ???

If radius = 0 Then Exit Sub 'a safety bail (thanks bplus!)

Change to

If radius < 1 then exit sub

because .7 * .7 = .49 r2 < r when r < 1

I am using a MacBook Pro M1 Max and doing some further checking by printing values for r2 - y*y, I get a list of positive numbers... mostly.  Eventually a sneaky value very near to 0, but slightly negative pops up (i.e. -2.831865E-06 as one example), which generates an Illegal function call.  It may be that this is due to arithmetic operations in the arm cpu?  Not certain about that.  However, adding the abs() function inside sqr() in line 255 remedies the situation for me.

I would be curious if anyone else is using Apple Silicon and getting a similar result?
Reply


Messages In This Thread
RE: A bigger bouncing ball demo - collision with vector reflection - by sbblank - 09-18-2024, 12:04 AM



Users browsing this thread: 4 Guest(s)