Skip to content

Commit

Permalink
fix Failure
Browse files Browse the repository at this point in the history
  • Loading branch information
FooB4r committed May 12, 2017
1 parent 6320b30 commit cb846f9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,14 @@ let compute_position pos colList linkList =
then r.length *: (direction r.position pos) +: r.position
else pos
| Block(bl) -> let l = Collide.polygon_circle bl.vertices pos Mlgrope.ball_radius in
let (a,b) = List.hd l in
begin
try
let (a,b) = List.hd l in
let n = Collide.circle_seg_norm a b pos in
(2. *. Mlgrope.ball_radius *: n)
(*
List.fold_left (fun acc (a,b) ->
let n = Collide.circle_seg_norm a b pos in
acc +: (2. *. Mlgrope.ball_radius *: n)
) pos l
*)
with
| Failure(_) -> pos
end
| _ -> pos
) pos colList

Expand Down

0 comments on commit cb846f9

Please sign in to comment.