SceneLight.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. require('Polycode/Entity')
  2. function SceneLight(type,parentScene,intensity,constantAttenuation,linearAttenuation,quadraticAttenuation) {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.SceneLight(type,parentScene,intensity,constantAttenuation,linearAttenuation,quadraticAttenuation)
  5. }
  6. }
  7. SceneLight.POINT_LIGHT = 0
  8. SceneLight.SPOT_LIGHT = 1
  9. SceneLight.prototype = Object.create(Entity.prototype)
  10. SceneLight.prototype.getIntensity = function() {
  11. return Polycode.SceneLight_getIntensity(this.__ptr)
  12. }
  13. SceneLight.prototype.setIntensity = function(newIntensity) {
  14. Polycode.SceneLight_setIntensity(this.__ptr, newIntensity)
  15. }
  16. SceneLight.prototype.setAttenuation = function(constantAttenuation,linearAttenuation,quadraticAttenuation) {
  17. Polycode.SceneLight_setAttenuation(this.__ptr, constantAttenuation, linearAttenuation, quadraticAttenuation)
  18. }
  19. SceneLight.prototype.getConstantAttenuation = function() {
  20. return Polycode.SceneLight_getConstantAttenuation(this.__ptr)
  21. }
  22. SceneLight.prototype.getLinearAttenuation = function() {
  23. return Polycode.SceneLight_getLinearAttenuation(this.__ptr)
  24. }
  25. SceneLight.prototype.getQuadraticAttenuation = function() {
  26. return Polycode.SceneLight_getQuadraticAttenuation(this.__ptr)
  27. }
  28. SceneLight.prototype.getType = function() {
  29. return Polycode.SceneLight_getType(this.__ptr)
  30. }
  31. SceneLight.prototype.renderDepthMap = function(scene) {
  32. Polycode.SceneLight_renderDepthMap(this.__ptr, scene.__ptr)
  33. }
  34. SceneLight.prototype.getZBufferTexture = function() {
  35. var retVal = new Texture()
  36. retVal.__ptr = Polycode.SceneLight_getZBufferTexture(this.__ptr)
  37. return retVal
  38. }
  39. SceneLight.prototype.setSpecularLightColor = function(r,g,b,a) {
  40. Polycode.SceneLight_setSpecularLightColor(this.__ptr, r, g, b, a)
  41. }
  42. SceneLight.prototype.setDiffuseLightColor = function(r,g,b,a) {
  43. Polycode.SceneLight_setDiffuseLightColor(this.__ptr, r, g, b, a)
  44. }
  45. SceneLight.prototype.setLightColor = function(r,g,b,a) {
  46. Polycode.SceneLight_setLightColor(this.__ptr, r, g, b, a)
  47. }
  48. SceneLight.prototype.setSpotlightProperties = function(spotlightCutoff,spotlightExponent) {
  49. Polycode.SceneLight_setSpotlightProperties(this.__ptr, spotlightCutoff, spotlightExponent)
  50. }
  51. SceneLight.prototype.getSpotlightCutoff = function() {
  52. return Polycode.SceneLight_getSpotlightCutoff(this.__ptr)
  53. }
  54. SceneLight.prototype.getSpotlightExponent = function() {
  55. return Polycode.SceneLight_getSpotlightExponent(this.__ptr)
  56. }
  57. SceneLight.prototype.enableShadows = function(val,resolution) {
  58. Polycode.SceneLight_enableShadows(this.__ptr, val, resolution)
  59. }
  60. SceneLight.prototype.setShadowMapFOV = function(fov) {
  61. Polycode.SceneLight_setShadowMapFOV(this.__ptr, fov)
  62. }
  63. SceneLight.prototype.getShadowMapFOV = function() {
  64. return Polycode.SceneLight_getShadowMapFOV(this.__ptr)
  65. }
  66. SceneLight.prototype.getShadowMapResolution = function() {
  67. return Polycode.SceneLight_getShadowMapResolution(this.__ptr)
  68. }
  69. SceneLight.prototype.areShadowsEnabled = function() {
  70. return Polycode.SceneLight_areShadowsEnabled(this.__ptr)
  71. }
  72. SceneLight.prototype.getLightType = function() {
  73. return Polycode.SceneLight_getLightType(this.__ptr)
  74. }
  75. SceneLight.prototype.setLightImportance = function(newImportance) {
  76. Polycode.SceneLight_setLightImportance(this.__ptr, newImportance)
  77. }
  78. SceneLight.prototype.getLightImportance = function() {
  79. return Polycode.SceneLight_getLightImportance(this.__ptr)
  80. }
  81. SceneLight.prototype.setLightType = function(lightType) {
  82. Polycode.SceneLight_setLightType(this.__ptr, lightType)
  83. }
  84. SceneLight.prototype.Clone = function(deepClone,ignoreEditorOnly) {
  85. var retVal = new Entity()
  86. retVal.__ptr = Polycode.SceneLight_Clone(this.__ptr, deepClone, ignoreEditorOnly)
  87. return retVal
  88. }
  89. SceneLight.prototype.applyClone = function(clone,deepClone,ignoreEditorOnly) {
  90. Polycode.SceneLight_applyClone(this.__ptr, clone.__ptr, deepClone, ignoreEditorOnly)
  91. }
  92. SceneLight.prototype.getParentScene = function() {
  93. var retVal = new Scene()
  94. retVal.__ptr = Polycode.SceneLight_getParentScene(this.__ptr)
  95. return retVal
  96. }
  97. SceneLight.prototype.setParentScene = function(scene) {
  98. Polycode.SceneLight_setParentScene(this.__ptr, scene.__ptr)
  99. }
  100. SceneLight.prototype.getSpotlightCamera = function() {
  101. var retVal = new Camera()
  102. retVal.__ptr = Polycode.SceneLight_getSpotlightCamera(this.__ptr)
  103. return retVal
  104. }
  105. SceneLight.prototype.getLightInfo = function() {
  106. var retVal = new LightInfo()
  107. retVal.__ptr = Polycode.SceneLight_getLightInfo(this.__ptr)
  108. return retVal
  109. }