BoneTrack.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. function BoneTrack(bone,length) {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.BoneTrack(bone,length)
  4. }
  5. Object.defineProperties(this, {
  6. 'position': { enumerable: true, configurable: true, get: BoneTrack.prototype.__get_position, set: BoneTrack.prototype.__set_position},
  7. 'scale': { enumerable: true, configurable: true, get: BoneTrack.prototype.__get_scale, set: BoneTrack.prototype.__set_scale},
  8. 'boneQuat': { enumerable: true, configurable: true, get: BoneTrack.prototype.__get_boneQuat, set: BoneTrack.prototype.__set_boneQuat},
  9. 'weight': { enumerable: true, configurable: true, get: BoneTrack.prototype.__get_weight, set: BoneTrack.prototype.__set_weight}
  10. })
  11. }
  12. BoneTrack.prototype.__get_position = function() {
  13. var retVal = new Vector3("__skip_ptr__")
  14. retVal.__ptr = Polycode.BoneTrack__get_position(this.__ptr)
  15. return retVal
  16. }
  17. BoneTrack.prototype.__set_position = function(val) {
  18. Polycode.BoneTrack__set_position(this.__ptr, val.__ptr)
  19. }
  20. BoneTrack.prototype.__get_scale = function() {
  21. var retVal = new Vector3("__skip_ptr__")
  22. retVal.__ptr = Polycode.BoneTrack__get_scale(this.__ptr)
  23. return retVal
  24. }
  25. BoneTrack.prototype.__set_scale = function(val) {
  26. Polycode.BoneTrack__set_scale(this.__ptr, val.__ptr)
  27. }
  28. BoneTrack.prototype.__get_boneQuat = function() {
  29. var retVal = new Quaternion("__skip_ptr__")
  30. retVal.__ptr = Polycode.BoneTrack__get_boneQuat(this.__ptr)
  31. return retVal
  32. }
  33. BoneTrack.prototype.__set_boneQuat = function(val) {
  34. Polycode.BoneTrack__set_boneQuat(this.__ptr, val.__ptr)
  35. }
  36. BoneTrack.prototype.__get_weight = function() {
  37. return Polycode.BoneTrack__get_weight(this.__ptr)
  38. }
  39. BoneTrack.prototype.__set_weight = function(val) {
  40. Polycode.BoneTrack__set_weight(this.__ptr, val)
  41. }
  42. Duktape.fin(BoneTrack.prototype, function (x) {
  43. if (x === BoneTrack.prototype) {
  44. return;
  45. }
  46. Polycode.BoneTrack__delete(x.__ptr)
  47. })
  48. BoneTrack.prototype.Play = function(once) {
  49. Polycode.BoneTrack_Play(this.__ptr, once)
  50. }
  51. BoneTrack.prototype.Stop = function() {
  52. Polycode.BoneTrack_Stop(this.__ptr)
  53. }
  54. BoneTrack.prototype.Update = function(elapsed) {
  55. Polycode.BoneTrack_Update(this.__ptr, elapsed)
  56. }
  57. BoneTrack.prototype.Reset = function() {
  58. Polycode.BoneTrack_Reset(this.__ptr)
  59. }
  60. BoneTrack.prototype.setSpeed = function(speed) {
  61. Polycode.BoneTrack_setSpeed(this.__ptr, speed)
  62. }