SceneLight.js 4.3 KB

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