Vector3.js 851 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. function Vector3() {
  2. }
  3. Vector3.prototype.set = function(x,y,z) {
  4. Polycode.Vector3_set(this.__ptr, x,y,z)
  5. }
  6. Vector3.prototype.distance = function(vec2) {
  7. Polycode.Vector3_distance(this.__ptr, vec2)
  8. }
  9. Vector3.prototype.angleBetween = function(dest) {
  10. Polycode.Vector3_angleBetween(this.__ptr, dest)
  11. }
  12. Vector3.prototype.length = function() {
  13. Polycode.Vector3_length(this.__ptr)
  14. }
  15. Vector3.prototype.lengthSquared = function() {
  16. Polycode.Vector3_lengthSquared(this.__ptr)
  17. }
  18. Vector3.prototype.setLength = function(newLength) {
  19. Polycode.Vector3_setLength(this.__ptr, newLength)
  20. }
  21. Vector3.prototype.dot = function(u) {
  22. Polycode.Vector3_dot(this.__ptr, u)
  23. }
  24. Vector3.prototype.crossProduct = function(vec2) {
  25. Polycode.Vector3_crossProduct(this.__ptr, vec2)
  26. }
  27. Vector3.prototype.Normalize = function() {
  28. Polycode.Vector3_Normalize(this.__ptr)
  29. }