2
0

SceneMesh.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. require('Polycode/Entity')
  2. function SceneMesh(fileName) {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.SceneMesh(fileName)
  5. }
  6. Object.defineProperties(this, {
  7. 'lineWidth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineWidth, set: SceneMesh.prototype.__set_lineWidth},
  8. 'lineSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineSmooth, set: SceneMesh.prototype.__set_lineSmooth},
  9. 'pointSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_pointSmooth, set: SceneMesh.prototype.__set_pointSmooth},
  10. 'useGeometryHitDetection': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_useGeometryHitDetection, set: SceneMesh.prototype.__set_useGeometryHitDetection},
  11. 'alphaTest': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_alphaTest, set: SceneMesh.prototype.__set_alphaTest},
  12. 'backfaceCulled': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_backfaceCulled, set: SceneMesh.prototype.__set_backfaceCulled},
  13. 'sendBoneMatricesToMaterial': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_sendBoneMatricesToMaterial, set: SceneMesh.prototype.__set_sendBoneMatricesToMaterial}
  14. })
  15. }
  16. SceneMesh.prototype = Object.create(Entity.prototype);
  17. SceneMesh.prototype.__get_lineWidth = function() {
  18. return Polycode.SceneMesh__get_lineWidth(this.__ptr)
  19. }
  20. SceneMesh.prototype.__set_lineWidth = function(val) {
  21. Polycode.SceneMesh__set_lineWidth(this.__ptr, val)
  22. }
  23. SceneMesh.prototype.__get_lineSmooth = function() {
  24. return Polycode.SceneMesh__get_lineSmooth(this.__ptr)
  25. }
  26. SceneMesh.prototype.__set_lineSmooth = function(val) {
  27. Polycode.SceneMesh__set_lineSmooth(this.__ptr, val)
  28. }
  29. SceneMesh.prototype.__get_pointSmooth = function() {
  30. return Polycode.SceneMesh__get_pointSmooth(this.__ptr)
  31. }
  32. SceneMesh.prototype.__set_pointSmooth = function(val) {
  33. Polycode.SceneMesh__set_pointSmooth(this.__ptr, val)
  34. }
  35. SceneMesh.prototype.__get_useGeometryHitDetection = function() {
  36. return Polycode.SceneMesh__get_useGeometryHitDetection(this.__ptr)
  37. }
  38. SceneMesh.prototype.__set_useGeometryHitDetection = function(val) {
  39. Polycode.SceneMesh__set_useGeometryHitDetection(this.__ptr, val)
  40. }
  41. SceneMesh.prototype.__get_alphaTest = function() {
  42. return Polycode.SceneMesh__get_alphaTest(this.__ptr)
  43. }
  44. SceneMesh.prototype.__set_alphaTest = function(val) {
  45. Polycode.SceneMesh__set_alphaTest(this.__ptr, val)
  46. }
  47. SceneMesh.prototype.__get_backfaceCulled = function() {
  48. return Polycode.SceneMesh__get_backfaceCulled(this.__ptr)
  49. }
  50. SceneMesh.prototype.__set_backfaceCulled = function(val) {
  51. Polycode.SceneMesh__set_backfaceCulled(this.__ptr, val)
  52. }
  53. SceneMesh.prototype.__get_sendBoneMatricesToMaterial = function() {
  54. return Polycode.SceneMesh__get_sendBoneMatricesToMaterial(this.__ptr)
  55. }
  56. SceneMesh.prototype.__set_sendBoneMatricesToMaterial = function(val) {
  57. Polycode.SceneMesh__set_sendBoneMatricesToMaterial(this.__ptr, val)
  58. }
  59. SceneMesh.prototype.SceneMeshFromMesh = function(mesh) {
  60. var retVal = new SceneMesh()
  61. retVal.__ptr = Polycode.SceneMesh_SceneMeshFromMesh(mesh)
  62. return retVal
  63. }
  64. SceneMesh.prototype.Render = function(buffer) {
  65. Polycode.SceneMesh_Render(this.__ptr, buffer.__ptr)
  66. }
  67. SceneMesh.prototype.getShaderPass = function(index) {
  68. var retVal = new ShaderPass()
  69. retVal.__ptr = Polycode.SceneMesh_getShaderPass(this.__ptr, index)
  70. return retVal
  71. }
  72. SceneMesh.prototype.getNumShaderPasses = function() {
  73. return Polycode.SceneMesh_getNumShaderPasses(this.__ptr)
  74. }
  75. SceneMesh.prototype.addShaderPass = function(pass) {
  76. Polycode.SceneMesh_addShaderPass(this.__ptr, pass)
  77. }
  78. SceneMesh.prototype.removeShaderPass = function(shaderIndex) {
  79. Polycode.SceneMesh_removeShaderPass(this.__ptr, shaderIndex)
  80. }
  81. SceneMesh.prototype.getMesh = function() {
  82. var retVal = new Mesh()
  83. retVal.__ptr = Polycode.SceneMesh_getMesh(this.__ptr)
  84. return retVal
  85. }
  86. SceneMesh.prototype.getMaterial = function() {
  87. var retVal = new Material()
  88. retVal.__ptr = Polycode.SceneMesh_getMaterial(this.__ptr)
  89. return retVal
  90. }
  91. SceneMesh.prototype.loadSkeleton = function(fileName) {
  92. var retVal = new Skeleton()
  93. retVal.__ptr = Polycode.SceneMesh_loadSkeleton(this.__ptr, fileName)
  94. return retVal
  95. }
  96. SceneMesh.prototype.clearMaterial = function() {
  97. Polycode.SceneMesh_clearMaterial(this.__ptr)
  98. }
  99. SceneMesh.prototype.setMaterial = function(material) {
  100. Polycode.SceneMesh_setMaterial(this.__ptr, material)
  101. }
  102. SceneMesh.prototype.setMaterialByName = function(materialName,resourcePool) {
  103. Polycode.SceneMesh_setMaterialByName(this.__ptr, materialName, resourcePool.__ptr)
  104. }
  105. SceneMesh.prototype.setMesh = function(mesh) {
  106. Polycode.SceneMesh_setMesh(this.__ptr, mesh)
  107. }
  108. SceneMesh.prototype.setSkeleton = function(skeleton) {
  109. Polycode.SceneMesh_setSkeleton(this.__ptr, skeleton)
  110. }
  111. SceneMesh.prototype.getSkeleton = function() {
  112. var retVal = new Skeleton()
  113. retVal.__ptr = Polycode.SceneMesh_getSkeleton(this.__ptr)
  114. return retVal
  115. }
  116. SceneMesh.prototype.setLineWidth = function(newWidth) {
  117. Polycode.SceneMesh_setLineWidth(this.__ptr, newWidth)
  118. }
  119. SceneMesh.prototype.getFilename = function() {
  120. return Polycode.SceneMesh_getFilename(this.__ptr)
  121. }
  122. SceneMesh.prototype.setFilename = function(fileName) {
  123. Polycode.SceneMesh_setFilename(this.__ptr, fileName)
  124. }
  125. SceneMesh.prototype.loadFromFile = function(fileName) {
  126. Polycode.SceneMesh_loadFromFile(this.__ptr, fileName)
  127. }
  128. SceneMesh.prototype.customHitDetection = function(ray) {
  129. return Polycode.SceneMesh_customHitDetection(this.__ptr, ray)
  130. }
  131. SceneMesh.prototype.setForceMaterial = function(forceMaterial) {
  132. Polycode.SceneMesh_setForceMaterial(this.__ptr, forceMaterial)
  133. }
  134. SceneMesh.prototype.getForceMaterial = function() {
  135. return Polycode.SceneMesh_getForceMaterial(this.__ptr)
  136. }
  137. SceneMesh.prototype.Clone = function(deepClone,ignoreEditorOnly) {
  138. var retVal = new Entity()
  139. retVal.__ptr = Polycode.SceneMesh_Clone(this.__ptr, deepClone, ignoreEditorOnly)
  140. return retVal
  141. }
  142. SceneMesh.prototype.applyClone = function(clone,deepClone,ignoreEditorOnly) {
  143. Polycode.SceneMesh_applyClone(this.__ptr, clone.__ptr, deepClone, ignoreEditorOnly)
  144. }