These are chat archives for highfidelity/hifi

2nd
Jul 2014
Clément Brisset
@Atlante45
Jul 02 2014 00:05
Got the commit number?
@AlericInglewood ^
Sean Devin
@SeanDevin
Jul 02 2014 01:08
Did he answer that? Just in case... Looks at his IRC session with Aleric as he was bisecting It was [73a1e759a4983bf714c40cacbe74d727ddd03cf0] Include an additional bit with the objects that says whether what follows is a delta. The clients may be retaining references to the objects, so we can't rely on their having been deleted.
MLuminos
@MLuminos
Jul 02 2014 07:32

Just wanted to leave a message here. Almost 6 years ago shortly after logging in to SL for the first time my mind was blown because I could create a-one sided object in virtual space. 5 years and 7 months later I've learned scripting and building, role played, made friends across the world and met people who have changed me forever. Second Life is something special and through its experiences I've learned a lot about myself in some profound ways.

I eagerly await High Fidelity and a new greater awe than I felt when I first began Second Life.
I've submitted my alpha application and hope to hear back in the months to come. This is something I want to help make happen for the world no matter how large or small a part.

AlericInglewood @AlericInglewood absorbs http://qt-project.org/wiki/JavaScript
Ryan Huffman
@huffman
Jul 02 2014 18:02
Was the oculus dependency updated to the latest?
Clément Brisset
@Atlante45
Jul 02 2014 18:03
yup
Ryan Huffman
@huffman
Jul 02 2014 18:03
Ok, thanks
AlericInglewood
@AlericInglewood
Jul 02 2014 18:44
How can I declare an array of unsigned ints in javascript?
Clément Brisset
@Atlante45
Jul 02 2014 18:45
There is no type in JS, well not really.
AlericInglewood
@AlericInglewood
Jul 02 2014 18:45
I read/used https://developer.mozilla.org/en-US/docs/Web/API/Uint32Array but nothing I try works. Seems it doesn't understand Uint32Array at all.
Clément Brisset
@Atlante45
Jul 02 2014 18:45
just use : var myArray = new Array()
AlericInglewood
@AlericInglewood
Jul 02 2014 18:45
Oh new...
Clément Brisset
@Atlante45
Jul 02 2014 18:45
yep
AlericInglewood
@AlericInglewood
Jul 02 2014 18:46
[2014-07-02T20:46:09] Uncaught exception at ( "/opt/highfidelity/hifi/scripts/lookWithMouse.js" ) line 21 : "ReferenceError: Can't find variable: Uint32Array"
Why does this not work then? Shouldn't javascript understand Uint32Array? It should according to https://developer.mozilla.org/en-US/docs/Web/API/Uint32Array
Clément Brisset
@Atlante45
Jul 02 2014 18:47
then you fill it up with :
for (var i = 0; i < 42; ++i) {
myArray[myArray.length] = i;
}
AlericInglewood
@AlericInglewood
Jul 02 2014 18:47
line 21 is:
var keys = new Uint32Array(4);
Clément Brisset
@Atlante45
Jul 02 2014 18:49
That’s mozilla API standard, Qt uses the ECMAScript-262 statndard
AlericInglewood
@AlericInglewood
Jul 02 2014 18:56
@Atlante45 Thanks. Another question, this clearly doesn't work:
keys[indx] |= mask;
How should I do that?
Or.. maybe this doesn't work:
var indx = misckey / 32;
That gives me a real, but I want an integer :\
Clément Brisset
@Atlante45
Jul 02 2014 19:01
Not sure you can do bit operations.
I might be wrong though
David Rowe
@ctrlaltdavid
Jul 02 2014 19:04
In JavaScript there is just one single number type, internally represented as a 64-bit floating point
AlericInglewood
@AlericInglewood
Jul 02 2014 19:04

@ctrlaltdavid
This code:
print("mask = " + mask);
print("indx = " + indx);
keys[indx] |= mask;
print("1. keys[0] = " + keys[0]);
print("2. keys[0] = " + keys[0].asString(16));

Gives this output:

[2014-07-02T21:02:06] script:print()<< "keyPressEvent event.key=16777223" 
[2014-07-02T21:02:06] script:print()<< "mask = 128" 
[2014-07-02T21:02:06] script:print()<< "indx = 0" 
[2014-07-02T21:02:06] script:print()<< "1. keys[0] = 128" 
[2014-07-02T21:02:06] Application::keyReleaseEvent(1000007)

Why does the line print("2. keys[0] = " + keys[0].asString(16)); not give any output?

I want to print the array keys as four hexadecimal values, how can I do that?
I Googled for how to print hex in javascript and found that you just have to put .asString(16) behind...
David Rowe
@ctrlaltdavid
Jul 02 2014 19:08
That sounds about right
AlericInglewood
@AlericInglewood
Jul 02 2014 19:09
Why does the line print("2. keys[0] = " + keys[0].asString(16)); not give any output?
http://www.ecma-international.org/ecma-262/5.1/ doesn't even mention "asString"!
Clément Brisset
@Atlante45
Jul 02 2014 19:12
You should use toString()
AlericInglewood
@AlericInglewood
Jul 02 2014 19:13
Yeah, I just found that
Clément Brisset
@Atlante45
Jul 02 2014 19:13
there is a bunch of stuff there
AlericInglewood
@AlericInglewood
Jul 02 2014 19:13
looks
AlericInglewood
@AlericInglewood
Jul 02 2014 20:29
Where can I find which members event arguments have in javascript?
For example, I found examples in hifi/examples where one does:
Controller.mousePressEvent.connect(mousePressEvent);
which then causes the function mousePressEvent(event) to be called,
and APPARENTLY event.x and event.y exist. I just randomly tried
event.button and it existed too - but I'd really like to know what exactly
exists without having to try every word in the dictionary (not to mention
that there are a lot more other events)
David Rowe
@ctrlaltdavid
Jul 02 2014 20:51
AlericInglewood
@AlericInglewood
Jul 02 2014 21:39
Hmmm
[2014-07-02T23:39:14] script:print()<< "ac_rot_rc = 0,0,0.0019999986980110407,0.9999979734420776"
[2014-07-02T23:39:14] script:print()<< "MyAvatar.orientation = 0,0.0019999986980110407,0,0.9999979734420776"
The y and z are swapped... I created ac_rot_rc with:
var ac_rot_rc = Quat.fromVec3Degrees( { x: MyAvatar.bodyRoll, y: MyAvatar.bodyPitch, z: MyAvatar.bodyYaw } );
which is how it should be according to http://www.utdallas.edu/~tres/integ/sen5/9_23.jpg
Surely hifi isn't swapping Yaw and Pitch? confused
Clément Brisset
@Atlante45
Jul 02 2014 21:43
No, this is your link that is wrong.
y should be vertical
AlericInglewood
@AlericInglewood
Jul 02 2014 21:43
omg - really?
Clément Brisset
@Atlante45
Jul 02 2014 21:45
Yep, that’s what OpenGL and most of the 3D engines do
AlericInglewood
@AlericInglewood
Jul 02 2014 21:45
The MyAvatar.orientation is in world coordinates I guess? So, if y should be vertical then the world would have the y axis pointing up - that seems pretty weird! :)
Ah ok - thanks for the clarification! This is different from SL then.
Clément Brisset
@Atlante45
Jul 02 2014 21:46
No pb
Think about it that way, on a graph X point right and Y points up. Here we the depth Z pointing toward you.
Wich means that the default rotation points toward -Z.
AlericInglewood
@AlericInglewood
Jul 02 2014 21:48
@Atlante45 Do you happen to know from the top of your head, if the orientation is 0,0,0,1 - is the avatar facing -x, x, -z or z?
Oh, so the avatar would be facing (walking forward to) -Z then?
Hmm no... cause the screen coordinates as you explained them (which makes it plausible to choose +y as 'up') has no reference. You can face any direction. The default orientation can still be anything imho (x or z that is)
Clément Brisset
@Atlante45
Jul 02 2014 22:07
Yes, but we choose to use the same conventions that OpenGL so yes, the avatar in default rotation is facing -Z
you can try it by pressing space bar to reset all your joints and avatar rotations.
Arf, just tested it and looks like we don’t reset the avatar orientation anymore xD
AlericInglewood
@AlericInglewood
Jul 02 2014 22:22
@Atlante45 Help! :\ ... I print MyAvatar.orientation:
"MyAvatar.orientation = 0,0,0,1"
So that is the unit rotation.
Then I print my avatar position, as x,y,z:
"MyAvatar.position = 5218.9345703125,2154.8349609375,6515.04541015625"
Then I move forwards a considerable distance and print the position again:
"MyAvatar.position = 5218.9345703125,2157.189697265625,6510.38330078125"
The delta is <0, 2.35, -4.66>
So, the -Z theory seems to hold partially (it surely isn't X), but I moved upwards (Y) roughly half of the distance traveled to -Z ???
Hmm - isn't it that if you press forwards that you travel in the direction your cam is pointing to? The cam is behind my avatar, but slight below the horizon. I could be moving upwards I guess :\
Sean Devin
@SeanDevin
Jul 02 2014 22:29
one would think moving up should be pure z, without regards to the camera though Ale
Pure Y* this will be hard to change one's thinking
AlericInglewood
@AlericInglewood
Jul 02 2014 22:32
@SeanDevin It comes from the 2D history: before there were 3D video cards, the screen was like a graph: X horizontally and Y vertically (up). When later depth was introduced they used Z for that. Apparently hifi has chosen to expose those internal "openGL" coordinates to the user (scripter) too. I agree isn't not the best choice :/ It would not have been that hard to change the orientation of the axis for scripting purposes.
Sean Devin
@SeanDevin
Jul 02 2014 22:33
I can live with it. Just concerns that if you press PgUp only Y should increase.
Clément Brisset
@Atlante45
Jul 02 2014 22:33
moving controls relate to the avatar orientation, something must have gone wrong when you printed the avatar orientation
AlericInglewood
@AlericInglewood
Jul 02 2014 22:35
Well, then it's really weird. And I don't think something went wrong with the printing - that's fairly straightforward :P
print("MyAvatar.orientation = " + MyAvatar.orientation.x + "," + MyAvatar.orientation.y + "," + MyAvatar.orientation.z + "," + MyAvatar.orientation.w);
If that prints 0,0,0,1 and then pressing arrow UP changes both z and y coordinates.. well :. Seems to counter what you said @Atlante45
Sean Devin
@SeanDevin
Jul 02 2014 22:36
arrow up is forward, so unless you face a cardinal that's expected
what about PgUp?
AlericInglewood
@AlericInglewood
Jul 02 2014 22:37
Lemme try that.
Sean Devin
@SeanDevin
Jul 02 2014 22:37
well, forward and a drift down or up, depending on if you obey gravity I guess. I notice I sink very slowly if I turn on gravity.
AlericInglewood
@AlericInglewood
Jul 02 2014 22:38
begin: "MyAvatar.position = 5242.30810546875,2155.0068359375,6514.7041015625"
after pgUp: "MyAvatar.position = 5242.30810546875,2156.451416015625,6514.7041015625"
Sean Devin
@SeanDevin
Jul 02 2014 22:38
good.
so thats pure upwards
AlericInglewood
@AlericInglewood
Jul 02 2014 22:40
Yeah - something is wrong with moving forward :P. At least I know the orientation now, I guess.
With avatar rotation at ZERO_ROTATION (:P LSL) .. +X is to the right (ear), +Y is upwards, and +Z is backwards.
Sean Devin
@SeanDevin
Jul 02 2014 22:40
the previous numbers had an upwards component on just a UpArrow. I guess a row of voxels to fly along? see if you rise as you fly pure forward.
Clément Brisset
@Atlante45
Jul 02 2014 22:41
Sorry, I don’t get, just tried and if I set my orientation to the default quat and then move up/down fwd/bck left/right I only move along one single axis.
SeanDevin @SeanDevin blames Ale then, hehe
AlericInglewood
@AlericInglewood
Jul 02 2014 22:42
Ale is wrong!
Oh well, it doesn't matter for what I'm doing :P. Continues with the script
Sean Devin
@SeanDevin
Jul 02 2014 22:45
totally off topic, one of our international planes, A380, LAX to MEL sprung a water leak in flight. tries to imagine passengers swimming down the aisle at 35,000 ft
Ryan Huffman
@huffman
Jul 02 2014 22:45
FWIW, I don't have the problem either, using latest upstream