SceneLight.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. require('Polycode/Entity')
  2. function SceneLight(type,intensity,constantAttenuation,linearAttenuation,quadraticAttenuation,depthMapMaterial) {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.SceneLight(type,intensity,constantAttenuation,linearAttenuation,quadraticAttenuation,depthMapMaterial)
  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.getZBufferTexture = function() {
  32. var retVal = new Texture("__skip_ptr__")
  33. retVal.__ptr = Polycode.SceneLight_getZBufferTexture(this.__ptr)
  34. return retVal
  35. }
  36. SceneLight.prototype.setSpecularLightColor = function(r,g,b,a) {
  37. Polycode.SceneLight_setSpecularLightColor(this.__ptr, r, g, b, a)
  38. }
  39. SceneLight.prototype.setDiffuseLightColor = function(r,g,b,a) {
  40. Polycode.SceneLight_setDiffuseLightColor(this.__ptr, r, g, b, a)
  41. }
  42. SceneLight.prototype.setLightColor = function(r,g,b,a) {
  43. Polycode.SceneLight_setLightColor(this.__ptr, r, g, b, a)
  44. }
  45. SceneLight.prototype.setSpotlightProperties = function(spotlightCutoff,spotlightExponent) {
  46. Polycode.SceneLight_setSpotlightProperties(this.__ptr, spotlightCutoff, spotlightExponent)
  47. }
  48. SceneLight.prototype.getSpotlightCutoff = function() {
  49. return Polycode.SceneLight_getSpotlightCutoff(this.__ptr)
  50. }
  51. SceneLight.prototype.getSpotlightExponent = function() {
  52. return Polycode.SceneLight_getSpotlightExponent(this.__ptr)
  53. }
  54. SceneLight.prototype.enableShadows = function(val,resolution) {
  55. Polycode.SceneLight_enableShadows(this.__ptr, val, resolution)
  56. }
  57. SceneLight.prototype.setShadowMapFOV = function(fov) {
  58. Polycode.SceneLight_setShadowMapFOV(this.__ptr, fov)
  59. }
  60. SceneLight.prototype.getShadowMapFOV = function() {
  61. return Polycode.SceneLight_getShadowMapFOV(this.__ptr)
  62. }
  63. SceneLight.prototype.getShadowMapResolution = function() {
  64. return Polycode.SceneLight_getShadowMapResolution(this.__ptr)
  65. }
  66. SceneLight.prototype.areShadowsEnabled = function() {
  67. return Polycode.SceneLight_areShadowsEnabled(this.__ptr)
  68. }
  69. SceneLight.prototype.getLightType = function() {
  70. return Polycode.SceneLight_getLightType(this.__ptr)
  71. }
  72. SceneLight.prototype.setLightImportance = function(newImportance) {
  73. Polycode.SceneLight_setLightImportance(this.__ptr, newImportance)
  74. }
  75. SceneLight.prototype.getLightImportance = function() {
  76. return Polycode.SceneLight_getLightImportance(this.__ptr)
  77. }
  78. SceneLight.prototype.setLightType = function(lightType) {
  79. Polycode.SceneLight_setLightType(this.__ptr, lightType)
  80. }
  81. SceneLight.prototype.getLightInfo = function() {
  82. var retVal = new LightInfo("__skip_ptr__")
  83. retVal.__ptr = Polycode.SceneLight_getLightInfo(this.__ptr)
  84. return retVal
  85. }