Bone.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. function Bone() {
  2. Object.defineProperties(this, {
  3. 'parentBoneId': { enumerable: true, configurable: true, get: Bone.prototype.__get_parentBoneId, set: Bone.prototype.__set_parentBoneId},
  4. 'boneMatrix': { enumerable: true, configurable: true, get: Bone.prototype.__get_boneMatrix, set: Bone.prototype.__set_boneMatrix},
  5. 'restMatrix': { enumerable: true, configurable: true, get: Bone.prototype.__get_restMatrix, set: Bone.prototype.__set_restMatrix},
  6. 'baseMatrix': { enumerable: true, configurable: true, get: Bone.prototype.__get_baseMatrix, set: Bone.prototype.__set_baseMatrix},
  7. 'finalMatrix': { enumerable: true, configurable: true, get: Bone.prototype.__get_finalMatrix, set: Bone.prototype.__set_finalMatrix},
  8. 'baseRotation': { enumerable: true, configurable: true, get: Bone.prototype.__get_baseRotation, set: Bone.prototype.__set_baseRotation},
  9. 'baseScale': { enumerable: true, configurable: true, get: Bone.prototype.__get_baseScale, set: Bone.prototype.__set_baseScale},
  10. 'basePosition': { enumerable: true, configurable: true, get: Bone.prototype.__get_basePosition, set: Bone.prototype.__set_basePosition},
  11. 'disableAnimation': { enumerable: true, configurable: true, get: Bone.prototype.__get_disableAnimation, set: Bone.prototype.__set_disableAnimation}
  12. })
  13. }
  14. Bone.prototype.__get_parentBoneId = function() {
  15. return Polycode.Bone__get_parentBoneId(this.__ptr)
  16. }
  17. Bone.prototype.__set_parentBoneId = function(val) {
  18. Polycode.Bone__set_parentBoneId(this.__ptr, val)
  19. }
  20. Bone.prototype.__get_boneMatrix = function() {
  21. var retVal = new Matrix4()
  22. retVal.__ptr = Polycode.Bone__get_boneMatrix(this.__ptr)
  23. return retVal
  24. }
  25. Bone.prototype.__set_boneMatrix = function(val) {
  26. Polycode.Bone__set_boneMatrix(this.__ptr, val.__ptr)
  27. }
  28. Bone.prototype.__get_restMatrix = function() {
  29. var retVal = new Matrix4()
  30. retVal.__ptr = Polycode.Bone__get_restMatrix(this.__ptr)
  31. return retVal
  32. }
  33. Bone.prototype.__set_restMatrix = function(val) {
  34. Polycode.Bone__set_restMatrix(this.__ptr, val.__ptr)
  35. }
  36. Bone.prototype.__get_baseMatrix = function() {
  37. var retVal = new Matrix4()
  38. retVal.__ptr = Polycode.Bone__get_baseMatrix(this.__ptr)
  39. return retVal
  40. }
  41. Bone.prototype.__set_baseMatrix = function(val) {
  42. Polycode.Bone__set_baseMatrix(this.__ptr, val.__ptr)
  43. }
  44. Bone.prototype.__get_finalMatrix = function() {
  45. var retVal = new Matrix4()
  46. retVal.__ptr = Polycode.Bone__get_finalMatrix(this.__ptr)
  47. return retVal
  48. }
  49. Bone.prototype.__set_finalMatrix = function(val) {
  50. Polycode.Bone__set_finalMatrix(this.__ptr, val.__ptr)
  51. }
  52. Bone.prototype.__get_baseRotation = function() {
  53. var retVal = new Quaternion()
  54. retVal.__ptr = Polycode.Bone__get_baseRotation(this.__ptr)
  55. return retVal
  56. }
  57. Bone.prototype.__set_baseRotation = function(val) {
  58. Polycode.Bone__set_baseRotation(this.__ptr, val.__ptr)
  59. }
  60. Bone.prototype.__get_baseScale = function() {
  61. var retVal = new Vector3()
  62. retVal.__ptr = Polycode.Bone__get_baseScale(this.__ptr)
  63. return retVal
  64. }
  65. Bone.prototype.__set_baseScale = function(val) {
  66. Polycode.Bone__set_baseScale(this.__ptr, val.__ptr)
  67. }
  68. Bone.prototype.__get_basePosition = function() {
  69. var retVal = new Vector3()
  70. retVal.__ptr = Polycode.Bone__get_basePosition(this.__ptr)
  71. return retVal
  72. }
  73. Bone.prototype.__set_basePosition = function(val) {
  74. Polycode.Bone__set_basePosition(this.__ptr, val.__ptr)
  75. }
  76. Bone.prototype.__get_disableAnimation = function() {
  77. return Polycode.Bone__get_disableAnimation(this.__ptr)
  78. }
  79. Bone.prototype.__set_disableAnimation = function(val) {
  80. Polycode.Bone__set_disableAnimation(this.__ptr, val)
  81. }
  82. Bone.prototype.getName = function() {
  83. return Polycode.Bone_getName(this.__ptr)
  84. }
  85. Bone.prototype.setParentBone = function(bone) {
  86. Polycode.Bone_setParentBone(this.__ptr, bone)
  87. }
  88. Bone.prototype.addChildBone = function(bone) {
  89. Polycode.Bone_addChildBone(this.__ptr, bone)
  90. }
  91. Bone.prototype.getParentBone = function() {
  92. var retVal = new Bone()
  93. retVal.__ptr = Polycode.Bone_getParentBone(this.__ptr)
  94. return retVal
  95. }
  96. Bone.prototype.getNumChildBones = function() {
  97. return Polycode.Bone_getNumChildBones(this.__ptr)
  98. }
  99. Bone.prototype.getChildBone = function(index) {
  100. var retVal = new Bone()
  101. retVal.__ptr = Polycode.Bone_getChildBone(this.__ptr, index)
  102. return retVal
  103. }
  104. Bone.prototype.getBoneMatrix = function() {
  105. var retVal = new Matrix4()
  106. retVal.__ptr = Polycode.Bone_getBoneMatrix(this.__ptr)
  107. return retVal
  108. }
  109. Bone.prototype.setBoneMatrix = function(matrix) {
  110. Polycode.Bone_setBoneMatrix(this.__ptr, matrix)
  111. }
  112. Bone.prototype.getRestMatrix = function() {
  113. var retVal = new Matrix4()
  114. retVal.__ptr = Polycode.Bone_getRestMatrix(this.__ptr)
  115. return retVal
  116. }
  117. Bone.prototype.getFullRestMatrix = function() {
  118. var retVal = new Matrix4()
  119. retVal.__ptr = Polycode.Bone_getFullRestMatrix(this.__ptr)
  120. return retVal
  121. }
  122. Bone.prototype.getParentRestMatrix = function() {
  123. var retVal = new Matrix4()
  124. retVal.__ptr = Polycode.Bone_getParentRestMatrix(this.__ptr)
  125. return retVal
  126. }
  127. Bone.prototype.getFinalMatrix = function() {
  128. var retVal = new Matrix4()
  129. retVal.__ptr = Polycode.Bone_getFinalMatrix(this.__ptr)
  130. return retVal
  131. }
  132. Bone.prototype.setRestMatrix = function(matrix) {
  133. Polycode.Bone_setRestMatrix(this.__ptr, matrix)
  134. }
  135. Bone.prototype.setBaseMatrix = function(matrix) {
  136. Polycode.Bone_setBaseMatrix(this.__ptr, matrix)
  137. }
  138. Bone.prototype.getBaseMatrix = function() {
  139. var retVal = new Matrix4()
  140. retVal.__ptr = Polycode.Bone_getBaseMatrix(this.__ptr)
  141. return retVal
  142. }
  143. Bone.prototype.getFullBaseMatrix = function() {
  144. var retVal = new Matrix4()
  145. retVal.__ptr = Polycode.Bone_getFullBaseMatrix(this.__ptr)
  146. return retVal
  147. }
  148. Bone.prototype.rebuildFinalMatrix = function() {
  149. Polycode.Bone_rebuildFinalMatrix(this.__ptr)
  150. }
  151. Bone.prototype.buildFinalMatrix = function() {
  152. var retVal = new Matrix4()
  153. retVal.__ptr = Polycode.Bone_buildFinalMatrix(this.__ptr)
  154. return retVal
  155. }
  156. Bone.prototype.intializeBone = function(basePosition,baseScale,baseRotation,restPosition,restScale,restRotation) {
  157. Polycode.Bone_intializeBone(this.__ptr, basePosition,baseScale,baseRotation,restPosition,restScale,restRotation)
  158. }