]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/terrain/terrain.factor
math.vectors: new word vclamp for clamping vectors
[factor.git] / extra / terrain / terrain.factor
index 2b9e3260250101701d5a49715c7c3d7b53ecf08b..dfc5ffb417a54b2f53783a483b5b2b18d9222486 100644 (file)
@@ -152,7 +152,7 @@ terrain-world H{
     GRAVITY v+ ;
 
 : clamp-coords ( coords dim -- coords' )
-    [ { 0 0 } vmax ] dip { 2 2 } v- vmin ;
+    { 0 0 } swap { 2 2 } v- vclamp ;
 
 :: pixel-indices ( coords dim -- indices )
     coords vfloor v>integer dim clamp-coords :> floor-coords