Mesh.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. function Mesh() {
  2. }
  3. Mesh.prototype.Copy = function() {
  4. var retVal = new Mesh()
  5. retVal.__ptr = Polycode.Mesh_Copy(this.__ptr)
  6. return retVal
  7. }
  8. Mesh.prototype.loadMesh = function(fileName) {
  9. Polycode.Mesh_loadMesh(this.__ptr, fileName)
  10. }
  11. Mesh.prototype.saveToFile = function(fileName,writeNormals,writeTangents,writeColors,writeBoneWeights,writeUVs,writeSecondaryUVs) {
  12. Polycode.Mesh_saveToFile(this.__ptr, fileName,writeNormals,writeTangents,writeColors,writeBoneWeights,writeUVs,writeSecondaryUVs)
  13. }
  14. Mesh.prototype.loadFromFile = function(inFile) {
  15. Polycode.Mesh_loadFromFile(this.__ptr, inFile)
  16. }
  17. Mesh.prototype.addSubmesh = function(newSubmesh) {
  18. Polycode.Mesh_addSubmesh(this.__ptr, newSubmesh)
  19. }
  20. Mesh.prototype.removeSubmeshAtIndex = function(index) {
  21. Polycode.Mesh_removeSubmeshAtIndex(this.__ptr, index)
  22. }
  23. Mesh.prototype.getNumSubmeshes = function() {
  24. return Polycode.Mesh_getNumSubmeshes(this.__ptr)
  25. }
  26. Mesh.prototype.getSubmeshAtIndex = function(index) {
  27. var retVal = new MeshGeometry()
  28. retVal.__ptr = Polycode.Mesh_getSubmeshAtIndex(this.__ptr, index)
  29. return retVal
  30. }
  31. Mesh.prototype.getSubmeshPointer = function(index) {
  32. var retVal = new shared_ptr<MeshGeometry>()
  33. retVal.__ptr = Polycode.Mesh_getSubmeshPointer(this.__ptr, index)
  34. return retVal
  35. }
  36. Mesh.prototype.clearMesh = function() {
  37. Polycode.Mesh_clearMesh(this.__ptr)
  38. }
  39. Mesh.prototype.calculateBBox = function() {
  40. var retVal = new Vector3()
  41. retVal.__ptr = Polycode.Mesh_calculateBBox(this.__ptr)
  42. return retVal
  43. }
  44. Mesh.prototype.getRadius = function() {
  45. return Polycode.Mesh_getRadius(this.__ptr)
  46. }