SceneMesh.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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.getShaderPass = function(index) {
  60. var retVal = new ShaderPass("__skip_ptr__")
  61. retVal.__ptr = Polycode.SceneMesh_getShaderPass(this.__ptr, index)
  62. return retVal
  63. }
  64. SceneMesh.prototype.getNumShaderPasses = function() {
  65. return Polycode.SceneMesh_getNumShaderPasses(this.__ptr)
  66. }
  67. SceneMesh.prototype.addShaderPass = function(pass) {
  68. Polycode.SceneMesh_addShaderPass(this.__ptr, pass)
  69. }
  70. SceneMesh.prototype.removeShaderPass = function(shaderIndex) {
  71. Polycode.SceneMesh_removeShaderPass(this.__ptr, shaderIndex)
  72. }
  73. SceneMesh.prototype.getMesh = function() {
  74. var retVal = new Mesh("__skip_ptr__")
  75. retVal.__ptr = Polycode.SceneMesh_getMesh(this.__ptr)
  76. return retVal
  77. }
  78. SceneMesh.prototype.getMaterial = function() {
  79. var retVal = new Material("__skip_ptr__")
  80. retVal.__ptr = Polycode.SceneMesh_getMaterial(this.__ptr)
  81. return retVal
  82. }
  83. SceneMesh.prototype.loadSkeleton = function(fileName) {
  84. var retVal = new Skeleton("__skip_ptr__")
  85. retVal.__ptr = Polycode.SceneMesh_loadSkeleton(this.__ptr, fileName)
  86. return retVal
  87. }
  88. SceneMesh.prototype.clearMaterial = function() {
  89. Polycode.SceneMesh_clearMaterial(this.__ptr)
  90. }
  91. SceneMesh.prototype.setMaterial = function(material) {
  92. Polycode.SceneMesh_setMaterial(this.__ptr, material)
  93. }
  94. SceneMesh.prototype.setMesh = function(mesh) {
  95. Polycode.SceneMesh_setMesh(this.__ptr, mesh)
  96. }
  97. SceneMesh.prototype.setSkeleton = function(skeleton) {
  98. Polycode.SceneMesh_setSkeleton(this.__ptr, skeleton)
  99. }
  100. SceneMesh.prototype.getSkeleton = function() {
  101. var retVal = new Skeleton("__skip_ptr__")
  102. retVal.__ptr = Polycode.SceneMesh_getSkeleton(this.__ptr)
  103. return retVal
  104. }
  105. SceneMesh.prototype.setLineWidth = function(newWidth) {
  106. Polycode.SceneMesh_setLineWidth(this.__ptr, newWidth)
  107. }
  108. SceneMesh.prototype.getFilename = function() {
  109. return Polycode.SceneMesh_getFilename(this.__ptr)
  110. }
  111. SceneMesh.prototype.setFilename = function(fileName) {
  112. Polycode.SceneMesh_setFilename(this.__ptr, fileName)
  113. }
  114. SceneMesh.prototype.loadFromFile = function(fileName) {
  115. Polycode.SceneMesh_loadFromFile(this.__ptr, fileName)
  116. }
  117. SceneMesh.prototype.customHitDetection = function(ray) {
  118. return Polycode.SceneMesh_customHitDetection(this.__ptr, ray)
  119. }
  120. SceneMesh.prototype.setForceMaterial = function(forceMaterial) {
  121. Polycode.SceneMesh_setForceMaterial(this.__ptr, forceMaterial)
  122. }
  123. SceneMesh.prototype.getForceMaterial = function() {
  124. return Polycode.SceneMesh_getForceMaterial(this.__ptr)
  125. }