gltf_light.cpp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*************************************************************************/
  2. /* gltf_light.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #include "gltf_light.h"
  31. void GLTFLight::_bind_methods() {
  32. ClassDB::bind_method(D_METHOD("get_color"), &GLTFLight::get_color);
  33. ClassDB::bind_method(D_METHOD("set_color", "color"), &GLTFLight::set_color);
  34. ClassDB::bind_method(D_METHOD("get_intensity"), &GLTFLight::get_intensity);
  35. ClassDB::bind_method(D_METHOD("set_intensity", "intensity"), &GLTFLight::set_intensity);
  36. ClassDB::bind_method(D_METHOD("get_type"), &GLTFLight::get_type);
  37. ClassDB::bind_method(D_METHOD("set_type", "type"), &GLTFLight::set_type);
  38. ClassDB::bind_method(D_METHOD("get_range"), &GLTFLight::get_range);
  39. ClassDB::bind_method(D_METHOD("set_range", "range"), &GLTFLight::set_range);
  40. ClassDB::bind_method(D_METHOD("get_inner_cone_angle"), &GLTFLight::get_inner_cone_angle);
  41. ClassDB::bind_method(D_METHOD("set_inner_cone_angle", "inner_cone_angle"), &GLTFLight::set_inner_cone_angle);
  42. ClassDB::bind_method(D_METHOD("get_outer_cone_angle"), &GLTFLight::get_outer_cone_angle);
  43. ClassDB::bind_method(D_METHOD("set_outer_cone_angle", "outer_cone_angle"), &GLTFLight::set_outer_cone_angle);
  44. ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); // Color
  45. ADD_PROPERTY(PropertyInfo(Variant::REAL, "intensity"), "set_intensity", "get_intensity"); // float
  46. ADD_PROPERTY(PropertyInfo(Variant::STRING, "type"), "set_type", "get_type"); // String
  47. ADD_PROPERTY(PropertyInfo(Variant::REAL, "range"), "set_range", "get_range"); // float
  48. ADD_PROPERTY(PropertyInfo(Variant::REAL, "inner_cone_angle"), "set_inner_cone_angle", "get_inner_cone_angle"); // float
  49. ADD_PROPERTY(PropertyInfo(Variant::REAL, "outer_cone_angle"), "set_outer_cone_angle", "get_outer_cone_angle"); // float
  50. }
  51. Color GLTFLight::get_color() {
  52. return color;
  53. }
  54. void GLTFLight::set_color(Color p_color) {
  55. color = p_color;
  56. }
  57. float GLTFLight::get_intensity() {
  58. return intensity;
  59. }
  60. void GLTFLight::set_intensity(float p_intensity) {
  61. intensity = p_intensity;
  62. }
  63. String GLTFLight::get_type() {
  64. return type;
  65. }
  66. void GLTFLight::set_type(String p_type) {
  67. type = p_type;
  68. }
  69. float GLTFLight::get_range() {
  70. return range;
  71. }
  72. void GLTFLight::set_range(float p_range) {
  73. range = p_range;
  74. }
  75. float GLTFLight::get_inner_cone_angle() {
  76. return inner_cone_angle;
  77. }
  78. void GLTFLight::set_inner_cone_angle(float p_inner_cone_angle) {
  79. inner_cone_angle = p_inner_cone_angle;
  80. }
  81. float GLTFLight::get_outer_cone_angle() {
  82. return outer_cone_angle;
  83. }
  84. void GLTFLight::set_outer_cone_angle(float p_outer_cone_angle) {
  85. outer_cone_angle = p_outer_cone_angle;
  86. }