class Prism::ModelData
- Prism::ModelData
- Reference
- Object
Defined in:
prism/model/model_data.crprism/stdlib/cube.cr
prism/stdlib/plane.cr
prism/stdlib/terrain.cr
Constant Summary
-
TERRAIN_MAX_HEIGHT =
40
-
TERRAIN_MAX_PIXEL_COLOR =
(256 * 256) * 256
-
TERRAIN_SIZE =
800
Constructors
Class Method Summary
- .generate_cube(size : Float32, texture_coords : TextureCoords) : Prism::ModelData
-
.generate_cube(size : Float32) : Prism::ModelData
Generates a cube model TODO: finish migrating this
-
.generate_plane(size : Int32)
Generates a square plane
-
.generate_terrain(grid_x : Int32, grid_z : Int32, height_map : String, textures : Prism::TerrainTexturePack) : Prism::Entity
Generates a new terrain entity.
Instance Method Summary
- #furthest_point : Float32
- #indices : Array(Int32)
- #normals : Array(Float32)
- #texture_coords : Array(Float32)
- #vertices : Array(Float32)
Constructor Detail
def self.new(vertices : Array(Float32), texture_coords : Array(Float32), normals : Array(Float32), indices : Array(Int32), furthest_point : Float32)
#
Class Method Detail
def self.generate_cube(size : Float32) : Prism::ModelData
#
Generates a cube model
TODO finish migrating this
def self.generate_terrain(grid_x : Int32, grid_z : Int32, height_map : String, textures : Prism::TerrainTexturePack) : Prism::Entity
#
Generates a new terrain entity.
TODO this should just create the model data. The rest of the terrain should be created elsewhere.