Anteworld - Outerra Game > JavaScript development
Object
SteelRat:
Hi cameni!
--- Code: ---var Randomizer = function (val) {
this.v = val || 100;
};
Randomizer.prototype = {
constructor: Randomizer,
get: function () {return Math.round(Math.random()*this.v);}
};
var rnd_1 = new Randomizer();
var rnd_2 = new Randomizer(10000000);
rnd_1.get();
rnd_2.get();
--- End code ---
RU: Каждый новый экземпляр объекта Randomizer содержит ссылку на метод get() в объекте Randomizer, или каждый новый экземпляр объекта Randomizer получает свой экземпляр метода get() ?
Translate: Each new instance of Randomizer contains a link to get() method in the object Randomizer, or each new instance of Randomizer gets a copy of the method get() ?
SteelRat:
Hi cameni!
--- Code: ---ERROR: vehicle::init_chassis: C:/Users/Eduard/Outerra/packages/SteelRat/Test_deform/Ptm/Three/math/Matrix4.js(16): ReferenceError: Float32Array is not defined
--- End code ---
How to create an object Float32Array? If this is possible, or is there an alternative?
cameni:
I'm not sure if it was supported in Chromium 27 (the version in OT), but maybe it had a different syntax.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
SteelRat:
Hi Cameni!
I'm a little confused).
It will be right?
Transformation Matrix
--- Code: ---[
/*axle_X*/ 1, 0, 0, 0,
/*axle_Y*/ 0, 1, 0, 0,
/*axle_Z*/ 0, 0, 1, 0,
/*pos*/ 0, 0, 0, 1
]
--- End code ---
or
--- Code: ---[
/*axle_X*/ /*axle_Y*/ /*axle_Z*/ /*pos*/
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
]
--- End code ---
cameni:
Right for what?
Navigation
[0] Message Index
[#] Next page
Go to full version