Mesh.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. require('Polycode/Resource')
  2. function Mesh() {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.Mesh()
  5. }
  6. }
  7. Mesh.prototype = Object.create(Resource.prototype)
  8. Mesh.prototype.addSubmesh = function(newSubmesh) {
  9. Polycode.Mesh_addSubmesh(this.__ptr, newSubmesh)
  10. }
  11. Mesh.prototype.removeSubmeshAtIndex = function(index) {
  12. Polycode.Mesh_removeSubmeshAtIndex(this.__ptr, index)
  13. }
  14. Mesh.prototype.getNumSubmeshes = function() {
  15. return Polycode.Mesh_getNumSubmeshes(this.__ptr)
  16. }
  17. Mesh.prototype.getSubmeshAtIndex = function(index) {
  18. var retVal = new MeshGeometry("__skip_ptr__")
  19. retVal.__ptr = Polycode.Mesh_getSubmeshAtIndex(this.__ptr, index)
  20. return retVal
  21. }
  22. Mesh.prototype.getSubmeshPointer = function(index) {
  23. var retVal = new MeshGeometry("__skip_ptr__")
  24. retVal.__ptr = Polycode.Mesh_getSubmeshPointer(this.__ptr, index)
  25. return retVal
  26. }
  27. Mesh.prototype.clearMesh = function() {
  28. Polycode.Mesh_clearMesh(this.__ptr)
  29. }
  30. Mesh.prototype.calculateBBox = function() {
  31. var retVal = new Vector3("__skip_ptr__")
  32. retVal.__ptr = Polycode.Mesh_calculateBBox(this.__ptr)
  33. return retVal
  34. }
  35. Mesh.prototype.getRadius = function() {
  36. return Polycode.Mesh_getRadius(this.__ptr)
  37. }