1 /** 2 A type of $(D Sky) used to draw a background texture. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.panoramasky; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.sky; 25 import godot.texture; 26 /** 27 A type of $(D Sky) used to draw a background texture. 28 29 A resource referenced in an $(D Environment) that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. 30 Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (`.hdr`) and OpenEXR (`.exr`) image formats for this purpose. 31 You can use $(D url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html)this tool$(D /url) to convert a cube map to an equirectangular sky map. 32 */ 33 @GodotBaseClass struct PanoramaSky 34 { 35 package(godot) enum string _GODOT_internal_name = "PanoramaSky"; 36 public: 37 @nogc nothrow: 38 union { /** */ godot_object _godot_object; /** */ Sky _GODOT_base; } 39 alias _GODOT_base this; 40 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 41 package(godot) __gshared bool _classBindingInitialized = false; 42 package(godot) static struct GDNativeClassBinding 43 { 44 __gshared: 45 @GodotName("get_panorama") GodotMethod!(Texture) getPanorama; 46 @GodotName("set_panorama") GodotMethod!(void, Texture) setPanorama; 47 } 48 /// 49 pragma(inline, true) bool opEquals(in PanoramaSky other) const 50 { return _godot_object.ptr is other._godot_object.ptr; } 51 /// 52 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 53 { _godot_object.ptr = n; return null; } 54 /// 55 pragma(inline, true) bool opEquals(typeof(null) n) const 56 { return _godot_object.ptr is n; } 57 /// 58 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 59 mixin baseCasts; 60 /// Construct a new instance of PanoramaSky. 61 /// Note: use `memnew!PanoramaSky` instead. 62 static PanoramaSky _new() 63 { 64 static godot_class_constructor constructor; 65 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("PanoramaSky"); 66 if(constructor is null) return typeof(this).init; 67 return cast(PanoramaSky)(constructor()); 68 } 69 @disable new(size_t s); 70 /** 71 72 */ 73 Ref!Texture getPanorama() const 74 { 75 checkClassBinding!(typeof(this))(); 76 return ptrcall!(Texture)(GDNativeClassBinding.getPanorama, _godot_object); 77 } 78 /** 79 80 */ 81 void setPanorama(Texture texture) 82 { 83 checkClassBinding!(typeof(this))(); 84 ptrcall!(void)(GDNativeClassBinding.setPanorama, _godot_object, texture); 85 } 86 /** 87 $(D Texture) to be applied to the PanoramaSky. 88 */ 89 @property Texture panorama() 90 { 91 return getPanorama(); 92 } 93 /// ditto 94 @property void panorama(Texture v) 95 { 96 setPanorama(v); 97 } 98 }