OK so after looking at QuadRootsRevG.cpp I see your cython functions return the smallest, positive real root else return -31.0
I think this does the same thing. For many things numpy will be FASTER than cython or even C. Also using this function should enable you to simplify the conditional calls (if x4:... elif x3 etc)
def solve_polynomial(p):
''' p is array of polynomial coefficients
'''
r = np.roots(p)
real_pos = r[(r.imag == 0.0j) & (r.real >= 0.0)]
return real_pos.real.min() if len(real_pos) > 0 else -31.0 # no real positive roots, ho-hum
I'm not sure if I'm doing something wrong but when coloured balls go in a pocket they just stick there, when the cue balls goes in a pocket it drops to the floor. Subsequent strokes put the ball back on the table but the F line drawing stays on the floor and although the cue ball bounces off the cushions it doesn't hit other balls. I suppose you just have to make sure you don't pot the cue ball - like in the real game!
It might be nicer with 'tweening' for the camera movement. i.e. it moves towards the target camera position as if drawn by elastic rather than the rigid sudden movement.
Not sure about the rendering of the table and balls. I notice that you use mat_reflect but don't supply a reflection or bump (normal) map or specify bump repeat and shiny coeff. I will look at this and get back to you.
All in all it looks to be quite excellent (but undeniably very complicated!)
Paddy