Use a pivot and align it to the collision normals, then get the pitch, roll , yaw from this pivot :
global PIVOT = createpivot() . . . . Nx# = 0 Ny# = 0 Nz# = 0 for c = 1 to countcollisions( Entity ) Nx = Nx + collisionnx( Entity , c ) Ny = Ny + collisionny( Entity, c ) Nz = Nz + collisionnz( Entity, c ) next aligntovector PIVOT, Nx, Ny, Nz, 2, 1 Pitch# = entitypitch( PIVOT ) Yaw# = entityyaw( PIVOT ) Roll# = entityroll( PIVOT )