Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevent DRAW-VECTOR from drawing when the vector of interest is zero.

  • Loading branch information...
commit 2c0447ee47eece03f8eddc93b30b598b9fbcd816 1 parent 2dc1254
@Ralith Ralith authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 demo/draw-world.lisp
View
11 demo/draw-world.lisp
@@ -264,11 +264,12 @@
(gl:vertex -0.25 0.75)))
(defun draw-vector (origin vector)
- (gl:with-pushed-matrix
- (gl:translate (vec-x origin) (vec-y origin) 0)
- (gl:rotate (- (* (vec->angle vector) (/ 180 pi)) 90) 0 0 1)
- (gl:scale 10 (vec-length vector) 1)
- (draw-arrow)))
+ (unless (vec-zerop vector)
+ (gl:with-pushed-matrix
+ (gl:translate (vec-x origin) (vec-y origin) 0)
+ (gl:rotate (- (* (vec->angle vector) (/ 180 pi)) 90) 0 0 1)
+ (gl:scale 10 (vec-length vector) 1)
+ (draw-arrow))))
(defun draw-velocity (body)
(gl:color 0 0 1)
Please sign in to comment.
Something went wrong with that request. Please try again.