HeightMapShape3D

package
v0.0.0-...-c909628 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package HeightMapShape3D provides methods for working with HeightMapShape3D object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsHeightMapShape3D() Instance
}

type Instance

type Instance [1]gdclass.HeightMapShape3D

A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D]. This is useful for terrain, but it is limited as overhangs (such as caves) cannot be stored. Holes in a [HeightMapShape3D] are created by assigning very low values to points in the desired area. [b]Performance:[/b] [HeightMapShape3D] is faster to check collisions against than [ConcavePolygonShape3D], but it is significantly slower than primitive shapes like [BoxShape3D]. A heightmap collision shape can also be build by using an [Image] reference: [codeblocks] [gdscript] var heightmap_texture: Texture = ResourceLoader.load("res://heightmap_image.exr") var heightmap_image: Image = heightmap_texture.get_image() heightmap_image.convert(Image.FORMAT_RF)

var height_min: float = 0.0 var height_max: float = 10.0

update_map_data_from_image(heightmap_image, height_min, height_max) [/gdscript] [/codeblocks]

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsHeightMapShape3D

func (self Instance) AsHeightMapShape3D() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsShape3D

func (self Instance) AsShape3D() Shape3D.Instance

func (Instance) GetMaxHeight

func (self Instance) GetMaxHeight() Float.X

Returns the largest height value found in [member map_data]. Recalculates only when [member map_data] changes.

func (Instance) GetMinHeight

func (self Instance) GetMinHeight() Float.X

Returns the smallest height value found in [member map_data]. Recalculates only when [member map_data] changes.

func (Instance) MapData

func (self Instance) MapData() []float32

func (Instance) MapDepth

func (self Instance) MapDepth() int

func (Instance) MapWidth

func (self Instance) MapWidth() int

func (Instance) SetMapData

func (self Instance) SetMapData(value []float32)

func (Instance) SetMapDepth

func (self Instance) SetMapDepth(value int)

func (Instance) SetMapWidth

func (self Instance) SetMapWidth(value int)

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) UpdateMapDataFromImage

func (self Instance) UpdateMapDataFromImage(image [1]gdclass.Image, height_min Float.X, height_max Float.X)

Updates [member map_data] with data read from an [Image] reference. Automatically resizes heightmap [member map_width] and [member map_depth] to fit the full image width and height. The image needs to be in either [constant Image.FORMAT_RF] (32 bit), [constant Image.FORMAT_RH] (16 bit), or [constant Image.FORMAT_R8] (8 bit). Each image pixel is read in as a float on the range from [code]0.0[/code] (black pixel) to [code]1.0[/code] (white pixel). This range value gets remapped to [param height_min] and [param height_max] to form the final height value.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL