Scene.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. function Scene() {
  2. Object.defineProperties(this, {
  3. 'clearColor': { enumerable: true, configurable: true, get: Scene.prototype.__get_clearColor, set: Scene.prototype.__set_clearColor},
  4. 'useClearColor': { enumerable: true, configurable: true, get: Scene.prototype.__get_useClearColor, set: Scene.prototype.__set_useClearColor},
  5. 'useClearDepth': { enumerable: true, configurable: true, get: Scene.prototype.__get_useClearDepth, set: Scene.prototype.__set_useClearDepth},
  6. 'ambientColor': { enumerable: true, configurable: true, get: Scene.prototype.__get_ambientColor, set: Scene.prototype.__set_ambientColor},
  7. 'fogColor': { enumerable: true, configurable: true, get: Scene.prototype.__get_fogColor, set: Scene.prototype.__set_fogColor},
  8. 'enabled': { enumerable: true, configurable: true, get: Scene.prototype.__get_enabled, set: Scene.prototype.__set_enabled},
  9. 'ownsChildren': { enumerable: true, configurable: true, get: Scene.prototype.__get_ownsChildren, set: Scene.prototype.__set_ownsChildren},
  10. 'rootEntity': { enumerable: true, configurable: true, get: Scene.prototype.__get_rootEntity, set: Scene.prototype.__set_rootEntity},
  11. 'sceneMouseRect': { enumerable: true, configurable: true, get: Scene.prototype.__get_sceneMouseRect, set: Scene.prototype.__set_sceneMouseRect},
  12. 'remapMouse': { enumerable: true, configurable: true, get: Scene.prototype.__get_remapMouse, set: Scene.prototype.__set_remapMouse},
  13. 'constrainPickingToViewport': { enumerable: true, configurable: true, get: Scene.prototype.__get_constrainPickingToViewport, set: Scene.prototype.__set_constrainPickingToViewport}
  14. })
  15. }
  16. Scene.prototype.__get_clearColor = function() {
  17. var retVal = new Color()
  18. retVal.__ptr = Polycode.Scene__get_clearColor(this.__ptr)
  19. return retVal
  20. }
  21. Scene.prototype.__set_clearColor = function(val) {
  22. Polycode.Scene__set_clearColor(this.__ptr, val.__ptr)
  23. }
  24. Scene.prototype.__get_useClearColor = function() {
  25. return Polycode.Scene__get_useClearColor(this.__ptr)
  26. }
  27. Scene.prototype.__set_useClearColor = function(val) {
  28. Polycode.Scene__set_useClearColor(this.__ptr, val)
  29. }
  30. Scene.prototype.__get_useClearDepth = function() {
  31. return Polycode.Scene__get_useClearDepth(this.__ptr)
  32. }
  33. Scene.prototype.__set_useClearDepth = function(val) {
  34. Polycode.Scene__set_useClearDepth(this.__ptr, val)
  35. }
  36. Scene.prototype.__get_ambientColor = function() {
  37. var retVal = new Color()
  38. retVal.__ptr = Polycode.Scene__get_ambientColor(this.__ptr)
  39. return retVal
  40. }
  41. Scene.prototype.__set_ambientColor = function(val) {
  42. Polycode.Scene__set_ambientColor(this.__ptr, val.__ptr)
  43. }
  44. Scene.prototype.__get_fogColor = function() {
  45. var retVal = new Color()
  46. retVal.__ptr = Polycode.Scene__get_fogColor(this.__ptr)
  47. return retVal
  48. }
  49. Scene.prototype.__set_fogColor = function(val) {
  50. Polycode.Scene__set_fogColor(this.__ptr, val.__ptr)
  51. }
  52. Scene.prototype.__get_enabled = function() {
  53. return Polycode.Scene__get_enabled(this.__ptr)
  54. }
  55. Scene.prototype.__set_enabled = function(val) {
  56. Polycode.Scene__set_enabled(this.__ptr, val)
  57. }
  58. Scene.prototype.__get_ownsChildren = function() {
  59. return Polycode.Scene__get_ownsChildren(this.__ptr)
  60. }
  61. Scene.prototype.__set_ownsChildren = function(val) {
  62. Polycode.Scene__set_ownsChildren(this.__ptr, val)
  63. }
  64. Scene.prototype.__get_rootEntity = function() {
  65. var retVal = new Entity()
  66. retVal.__ptr = Polycode.Scene__get_rootEntity(this.__ptr)
  67. return retVal
  68. }
  69. Scene.prototype.__set_rootEntity = function(val) {
  70. Polycode.Scene__set_rootEntity(this.__ptr, val.__ptr)
  71. }
  72. Scene.prototype.__get_sceneMouseRect = function() {
  73. var retVal = new Rectangle()
  74. retVal.__ptr = Polycode.Scene__get_sceneMouseRect(this.__ptr)
  75. return retVal
  76. }
  77. Scene.prototype.__set_sceneMouseRect = function(val) {
  78. Polycode.Scene__set_sceneMouseRect(this.__ptr, val.__ptr)
  79. }
  80. Scene.prototype.__get_remapMouse = function() {
  81. return Polycode.Scene__get_remapMouse(this.__ptr)
  82. }
  83. Scene.prototype.__set_remapMouse = function(val) {
  84. Polycode.Scene__set_remapMouse(this.__ptr, val)
  85. }
  86. Scene.prototype.__get_constrainPickingToViewport = function() {
  87. return Polycode.Scene__get_constrainPickingToViewport(this.__ptr)
  88. }
  89. Scene.prototype.__set_constrainPickingToViewport = function(val) {
  90. Polycode.Scene__set_constrainPickingToViewport(this.__ptr, val)
  91. }
  92. Scene.prototype.addEntity = function(entity) {
  93. Polycode.Scene_addEntity(this.__ptr, entity)
  94. }
  95. Scene.prototype.addChild = function(entity) {
  96. Polycode.Scene_addChild(this.__ptr, entity)
  97. }
  98. Scene.prototype.removeEntity = function(entity) {
  99. Polycode.Scene_removeEntity(this.__ptr, entity)
  100. }
  101. Scene.prototype.getDefaultCamera = function() {
  102. var retVal = new Camera()
  103. retVal.__ptr = Polycode.Scene_getDefaultCamera(this.__ptr)
  104. return retVal
  105. }
  106. Scene.prototype.getActiveCamera = function() {
  107. var retVal = new Camera()
  108. retVal.__ptr = Polycode.Scene_getActiveCamera(this.__ptr)
  109. return retVal
  110. }
  111. Scene.prototype.setActiveCamera = function(camera) {
  112. Polycode.Scene_setActiveCamera(this.__ptr, camera)
  113. }
  114. Scene.prototype.enableFog = function(enable) {
  115. Polycode.Scene_enableFog(this.__ptr, enable)
  116. }
  117. Scene.prototype.setFogProperties = function(fogMode,color,density,startDepth,endDepth) {
  118. Polycode.Scene_setFogProperties(this.__ptr, fogMode,color,density,startDepth,endDepth)
  119. }
  120. Scene.prototype.setSceneType = function(newType) {
  121. Polycode.Scene_setSceneType(this.__ptr, newType)
  122. }
  123. Scene.prototype.fixedUpdate = function() {
  124. Polycode.Scene_fixedUpdate(this.__ptr)
  125. }
  126. Scene.prototype.Update = function() {
  127. Polycode.Scene_Update(this.__ptr)
  128. }
  129. Scene.prototype.setVirtual = function(val) {
  130. Polycode.Scene_setVirtual(this.__ptr, val)
  131. }
  132. Scene.prototype.isVirtual = function() {
  133. return Polycode.Scene_isVirtual(this.__ptr)
  134. }
  135. Scene.prototype.isEnabled = function() {
  136. return Polycode.Scene_isEnabled(this.__ptr)
  137. }
  138. Scene.prototype.setEnabled = function(enabled) {
  139. Polycode.Scene_setEnabled(this.__ptr, enabled)
  140. }
  141. Scene.prototype.Render = function(targetCamera,targetFramebuffer,overrideMaterial,sendLights) {
  142. Polycode.Scene_Render(this.__ptr, targetCamera,targetFramebuffer,overrideMaterial,sendLights)
  143. }
  144. Scene.prototype.setOverrideMaterial = function(material) {
  145. Polycode.Scene_setOverrideMaterial(this.__ptr, material)
  146. }
  147. Scene.prototype.projectRayFromCameraAndViewportCoordinate = function(camera,coordinate) {
  148. var retVal = new Ray()
  149. retVal.__ptr = Polycode.Scene_projectRayFromCameraAndViewportCoordinate(this.__ptr, camera,coordinate)
  150. return retVal
  151. }
  152. Scene.prototype.addLight = function(light) {
  153. Polycode.Scene_addLight(this.__ptr, light)
  154. }
  155. Scene.prototype.removeLight = function(light) {
  156. Polycode.Scene_removeLight(this.__ptr, light)
  157. }
  158. Scene.prototype.getNumLights = function() {
  159. return Polycode.Scene_getNumLights(this.__ptr)
  160. }
  161. Scene.prototype.getLight = function(index) {
  162. var retVal = new SceneLight()
  163. retVal.__ptr = Polycode.Scene_getLight(this.__ptr, index)
  164. return retVal
  165. }
  166. Scene.prototype.doVisibilityChecking = function(val) {
  167. Polycode.Scene_doVisibilityChecking(this.__ptr, val)
  168. }
  169. Scene.prototype.doesVisibilityChecking = function() {
  170. return Polycode.Scene_doesVisibilityChecking(this.__ptr)
  171. }