1 /** 2 Default environment properties for the entire scene (post-processing effects, lightning and background settings). 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.worldenvironment; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.node; 24 import godot.environment; 25 /** 26 Default environment properties for the entire scene (post-processing effects, lightning and background settings). 27 28 The `WorldEnvironment` node is used to configure the default $(D Environment) for the scene. 29 The parameters defined in the `WorldEnvironment` can be overridden by an $(D Environment) node set on the current $(D Camera). Additionally, only one `WorldEnvironment` may be instanced in a given scene at a time. 30 The `WorldEnvironment` allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. 31 */ 32 @GodotBaseClass struct WorldEnvironment 33 { 34 enum string _GODOT_internal_name = "WorldEnvironment"; 35 public: 36 @nogc nothrow: 37 union { godot_object _godot_object; Node _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct _classBinding 42 { 43 __gshared: 44 @GodotName("set_environment") GodotMethod!(void, Environment) setEnvironment; 45 @GodotName("get_environment") GodotMethod!(Environment) getEnvironment; 46 } 47 bool opEquals(in WorldEnvironment other) const { return _godot_object.ptr is other._godot_object.ptr; } 48 WorldEnvironment opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 49 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 50 mixin baseCasts; 51 static WorldEnvironment _new() 52 { 53 static godot_class_constructor constructor; 54 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("WorldEnvironment"); 55 if(constructor is null) return typeof(this).init; 56 return cast(WorldEnvironment)(constructor()); 57 } 58 @disable new(size_t s); 59 /** 60 61 */ 62 void setEnvironment(Environment env) 63 { 64 checkClassBinding!(typeof(this))(); 65 ptrcall!(void)(_classBinding.setEnvironment, _godot_object, env); 66 } 67 /** 68 69 */ 70 Ref!Environment getEnvironment() const 71 { 72 checkClassBinding!(typeof(this))(); 73 return ptrcall!(Environment)(_classBinding.getEnvironment, _godot_object); 74 } 75 /** 76 The $(D Environment) resource used by this `WorldEnvironment`, defining the default properties. 77 */ 78 @property Environment environment() 79 { 80 return getEnvironment(); 81 } 82 /// ditto 83 @property void environment(Environment v) 84 { 85 setEnvironment(v); 86 } 87 }