class Prism::Terrain

Overview

Represents some terrain. Since things will probably travel accross this terrain you can check the height at a point on the terrain to properly position other objects.

height : Float32 = terrain.height_at(entity)

TODO This should be turned into a generic hights component, and not store the transform directly.

Defined in:

prism/stdlib/terrain.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(heights : Array(Array(Float32)), transform : Prism::Transform, terrain_size : Float32) #

[View source]

Instance Method Detail

def height_at(world_x : Float32, world_z : Float32) : Float32 #

Retrieves the height of the terrain at the given world position.


[View source]
def height_at(object : Prism::Entity) #

[View source]
def height_at(position : Vector3f) : Float32 #

[View source]