| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- function Vector2() {
- Object.defineProperties(this, {
- 'x': { enumerable: true, configurable: true, get: Vector2.prototype.__get_x, set: Vector2.prototype.__set_x},
- 'y': { enumerable: true, configurable: true, get: Vector2.prototype.__get_y, set: Vector2.prototype.__set_y}
- })
- }
- Vector2.prototype.__get_x = function() {
- return Polycode.Vector2__get_x(this.__ptr)
- }
- Vector2.prototype.__set_x = function(val) {
- Polycode.Vector2__set_x(this.__ptr, val)
- }
- Vector2.prototype.__get_y = function() {
- return Polycode.Vector2__get_y(this.__ptr)
- }
- Vector2.prototype.__set_y = function(val) {
- Polycode.Vector2__set_y(this.__ptr, val)
- }
- Vector2.prototype.set = function(x,y) {
- Polycode.Vector2_set(this.__ptr, x,y)
- }
- Vector2.prototype.distance = function(vec2) {
- return Polycode.Vector2_distance(this.__ptr, vec2)
- }
- Vector2.prototype.length = function() {
- return Polycode.Vector2_length(this.__ptr)
- }
- Vector2.prototype.dot = function(u) {
- return Polycode.Vector2_dot(this.__ptr, u)
- }
- Vector2.prototype.crossProduct = function(vec2) {
- return Polycode.Vector2_crossProduct(this.__ptr, vec2)
- }
- Vector2.prototype.angle = function(vec2) {
- return Polycode.Vector2_angle(this.__ptr, vec2)
- }
- Vector2.prototype.Normalize = function() {
- Polycode.Vector2_Normalize(this.__ptr)
- }
|