<commit_before>;;;; jMonkeyEngine 3 Tutorial (10) - Hello Terrain
;;;; http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_terrain

(ns maqueta.hello.terrain
  (:use (maqueta application assets))
  (:import com.jme3.terrain.heightmap.ImageBasedHeightMap
           (com.jme3.terrain.geomipmap TerrainQuad TerrainLodControl)))

(def patch-size 65)

(defn init-app
  [app]
  (let [fly-cam (.getFlyByCamera app)
        mat-terrain (load-material "Common/MatDefs/Terrain/Terrain.j3md")
        grass (load-texture "Textures/Terrain/splat/grass.jpg")
        dirt (load-texture "Textures/Terrain/splat/dirt.jpg")
        rock (load-texture "Textures/Terrain/splat/road.jpg")
        hmap-img (load-texture "Textures/Terrain/splat/mountains512.png")
        heightmap (doto (ImageBasedHeightMap. (.getImage hmap-img)) .load)
        terrain (TerrainQuad. "my terrain" patch-size 513 (.getHeightMap heightmap))]
    (.setMoveSpeed fly-cam 50)
    (.setWrap grass com.jme3.texture.Texture$WrapMode/Repeat)
    (.setWrap dirt com.jme3.texture.Texture$WrapMode/Repeat)
    (.setWrap rock com.jme3.texture.Texture$WrapMode/Repeat)
    (doto mat-terrain
      (.setTexture "Alpha" (load-texture "Textures/Terrain/splat/alphamap.png"))
      (.setTexture "Tex1" grass)
      (.setFloat "Tex1Scale" 64)
      (.setTexture "Tex2" dirt)
      (.setFloat "Tex2Scale" 32)
      (.setTexture "Tex3" rock)
      (.setFloat "Tex3Scale" 128))
    (.attachChild (.getRootNode app) (doto terrain
                                       (.setMaterial mat-terrain)
                                       (.setLocalTranslation 0 -100 0)
                                       (.setLocalScale 2 1 2)))
    (.addControl terrain (TerrainLodControl. terrain (.getCamera app)))))

(defn -main
  [& args]
  (.start (make-app :init init-app)))
<commit_msg>imported Texture$WrapMode<commit_after>;;;; jMonkeyEngine 3 Tutorial (10) - Hello Terrain
;;;; http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_terrain

(ns maqueta.hello.terrain
  (:use (maqueta application assets))
  (:import com.jme3.texture.Texture$WrapMode
           com.jme3.terrain.heightmap.ImageBasedHeightMap
           (com.jme3.terrain.geomipmap TerrainQuad TerrainLodControl)))

(def patch-size 65)

(defn init-app
  [app]
  (let [fly-cam (.getFlyByCamera app)
        mat-terrain (load-material "Common/MatDefs/Terrain/Terrain.j3md")
        grass (load-texture "Textures/Terrain/splat/grass.jpg")
        dirt (load-texture "Textures/Terrain/splat/dirt.jpg")
        rock (load-texture "Textures/Terrain/splat/road.jpg")
        hmap-img (load-texture "Textures/Terrain/splat/mountains512.png")
        heightmap (doto (ImageBasedHeightMap. (.getImage hmap-img)) .load)
        terrain (TerrainQuad. "my terrain" patch-size 513 (.getHeightMap heightmap))]
    (.setMoveSpeed fly-cam 50)
    (.setWrap grass Texture$WrapMode/Repeat)
    (.setWrap dirt Texture$WrapMode/Repeat)
    (.setWrap rock Texture$WrapMode/Repeat)
    (doto mat-terrain
      (.setTexture "Alpha" (load-texture "Textures/Terrain/splat/alphamap.png"))
      (.setTexture "Tex1" grass)
      (.setFloat "Tex1Scale" 64)
      (.setTexture "Tex2" dirt)
      (.setFloat "Tex2Scale" 32)
      (.setTexture "Tex3" rock)
      (.setFloat "Tex3Scale" 128))
    (.attachChild (.getRootNode app) (doto terrain
                                       (.setMaterial mat-terrain)
                                       (.setLocalTranslation 0 -100 0)
                                       (.setLocalScale 2 1 2)))
    (.addControl terrain (TerrainLodControl. terrain (.getCamera app)))))

(defn -main
  [& args]
  (.start (make-app :init init-app)))

{'fraction_non_alphanumeric': 0.13209606986899564, 'fraction_numerical': 0.021834061135371178, 'mean_word_length': 2.679718875502008, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '98465', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1211, 'n_words': 246}