class Prism::ModelData

Defined in:

prism/model/model_data.cr
prism/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

Instance Method Summary

Constructor Detail

def self.new(vertices : Array(Float32), texture_coords : Array(Float32), normals : Array(Float32), indices : Array(Int32), furthest_point : Float32) #

[View source]

Class Method Detail

def self.generate_cube(size : Float32, texture_coords : TextureCoords) : Prism::ModelData #

[View source]
def self.generate_cube(size : Float32) : Prism::ModelData #

Generates a cube model

TODO finish migrating this


[View source]
def self.generate_plane(size : Int32) #

Generates a square plane


[View source]
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.


[View source]

Instance Method Detail

def furthest_point : Float32 #

[View source]
def indices : Array(Int32) #

[View source]
def normals : Array(Float32) #

[View source]
def texture_coords : Array(Float32) #

[View source]
def vertices : Array(Float32) #

[View source]