So the tests are working, the changes had to be made in the Scene object, not sure if the changes I made follow standards, but I simply added the variables to the local object (added this.) and the variables were no longer falling out of scope. This shouldn't cause too much of a problem since these variables are reset every render pass and are hooked into the Octree object, so it shouldn't conflict with anything else. I'll ask for a code review on the change when I make a pull request.
Been analyzing how CubicVR uses its current octree implementation to see what I have to change and where. I was hoping their operations would line up a bit more seamlessly, but its gonna take some modding on both ends (the new octree system as well as many of the CubicVR source files) before I can get them working together correctly. I am hoping to have this finished up by the end of the night, the fact secretrobotron hasn't been on IRC today makes this a little more difficult as he would know the most about what can and cannot be changed in the new octree implementation, but I'll do what I can. If I change something I am not supposed to, hopefully it will be picked up during the code review. Obviously, with the tests now working, I should be able determine if everything is running correctly. I've already benchmarked the old implementation, and am hoping to see some improvements with the new one, if not, I hope to not see a drop in performance, as that would likely indicate I may have messed it up some.
Sunday, December 11, 2011
Progress on CubicVR octree migration
I was assigned issue 26 earlier in the week, which is about migrating a new octree system written by secretrobotron into CubicVR.
I started out by testing that the current octree tests were working, so I could benchmark the current implementation and test and benchmark the new implementation to see that it has been implemented correctly. Unfortunately, almost all the tests were either partly or completely broken. I informed the people in the #paladin channel on Moznet, and I volunteered to get those working as well. This naturally pushed back my schedule, but there really wasn't a way around it.
Thus far I've found one of the bugs, which fixes about half the tests, which was a function call that hadn't been updated to keep with the changes of the octree. The other breaking bug seems to be that a variable is falling out of scope, though I'm not sure why. Once these tests are fully functional again, I'll head to work on the actual migration again.
On another note, the tests for Mouselock weren't added to the patch because they were not working correctly. I had done a test review for one of the tests, but no one noticed that there was a duplicate on the list (of 20 items) and that what I was working on had already been done, so that was a great waste of time. More work needs to be done on the test reviews, but I need to finish my work for CubicVR first. If there is still work to do when I'm done, I'll gladly help finish this out.
I started out by testing that the current octree tests were working, so I could benchmark the current implementation and test and benchmark the new implementation to see that it has been implemented correctly. Unfortunately, almost all the tests were either partly or completely broken. I informed the people in the #paladin channel on Moznet, and I volunteered to get those working as well. This naturally pushed back my schedule, but there really wasn't a way around it.
Thus far I've found one of the bugs, which fixes about half the tests, which was a function call that hadn't been updated to keep with the changes of the octree. The other breaking bug seems to be that a variable is falling out of scope, though I'm not sure why. Once these tests are fully functional again, I'll head to work on the actual migration again.
On another note, the tests for Mouselock weren't added to the patch because they were not working correctly. I had done a test review for one of the tests, but no one noticed that there was a duplicate on the list (of 20 items) and that what I was working on had already been done, so that was a great waste of time. More work needs to be done on the test reviews, but I need to finish my work for CubicVR first. If there is still work to do when I'm done, I'll gladly help finish this out.
Friday, December 9, 2011
Burning the midnight oil....
So, as I figured, the IRC channel came alive later in the night. I noticed no one had grabbed the test_syntheticMouseEvent test review and went underway. After making a series of changes, mostly stylistic and only a few that actually affected code, I configured it to work with the harness and it was ready for testing. rhung had been complaining that he was unable to get the tests to run correctly, so I pulled from his repo and attempted to run them, but it didn't work, not because it would fail, but because the tests would simply lockup and not proceed. Not sure as to why it is failing. Really I am writing this blog to pull myself away from issue for a minute while I try to think of what could be causing the problem...
My posts often lack anything particularly helpful to the reader, so I'm just gonna list some tips I've either found or been given. Just to make this worth your time reading.
1) Its always a good idea to keep your whitespace clean in your code, heres a few regex commands that can help keep your code nice and clean (mind you these are all for vim, but you should be able to translate most of them to other apps(ignore the %, thats vim only)):
-Remove whitespace at the end of a line: %s/\s$//
-Replace tabs with (2)spaces: %s/\t/ /g
-Replace (2)spaces with tabs: %s/ /\t/g
NOTE: These are obviously not made to be safe with string in your code, they will manipulate anything in the file
2) Build tips for linux:
-When using a make file use the -j# argument to specify how many jobs this make uses, generally you should use the number of core your computer has plus one. So on a quad core computer it should look like: make -j5
-For time consuming builds, screen can be a lifesaver. Screen is a linux utility you can use that will essentially make a virtual client, one that does not expire when you close your SSH connection. So you can start a build on a server, and leave it running, close your connection and come back to it later. I'll list the basic commands here, for more detail go here.
$ screen <-- open a new virtual client
(Once in a 'screen') Ctrl+a d <-- detach from the screen
$ screen -R <--Reconnect with the screen
NOTE: if you use screen twice instead of using -R, you will make a second client, and -R will no long work, you will need -r and specify the screen id
Thats all the tips I can think of right now. Hope this helps someone.
My posts often lack anything particularly helpful to the reader, so I'm just gonna list some tips I've either found or been given. Just to make this worth your time reading.
1) Its always a good idea to keep your whitespace clean in your code, heres a few regex commands that can help keep your code nice and clean (mind you these are all for vim, but you should be able to translate most of them to other apps(ignore the %, thats vim only)):
-Remove whitespace at the end of a line: %s/\s$//
-Replace tabs with (2)spaces: %s/\t/ /g
-Replace (2)spaces with tabs: %s/ /\t/g
NOTE: These are obviously not made to be safe with string in your code, they will manipulate anything in the file
2) Build tips for linux:
-When using a make file use the -j# argument to specify how many jobs this make uses, generally you should use the number of core your computer has plus one. So on a quad core computer it should look like: make -j5
-For time consuming builds, screen can be a lifesaver. Screen is a linux utility you can use that will essentially make a virtual client, one that does not expire when you close your SSH connection. So you can start a build on a server, and leave it running, close your connection and come back to it later. I'll list the basic commands here, for more detail go here.
$ screen <-- open a new virtual client
(Once in a 'screen') Ctrl+a d <-- detach from the screen
$ screen -R <--Reconnect with the screen
NOTE: if you use screen twice instead of using -R, you will make a second client, and -R will no long work, you will need -r and specify the screen id
Thats all the tips I can think of right now. Hope this helps someone.
Thursday, December 8, 2011
Freedom and confusion at the end of the day
Luckily I am now done all my work for other courses, so I can pretty much submit all my time to OSD, which I am pretty happy about. Things are moving around quite randomly with the mouselock implementation at the moment, making trying to contribute to it fairly difficult... NorthWind and myself have been trying to get a piece of work for the reviews for the past few hours, but have been unable to find anyone to give us a solid answer on how things are being distributed. The IRC channel has been surprisingly dead considering it is the end of the semester, perhaps not everyone is scrambling to finish work for other courses at the time. So for the time being, I'm avoiding working on it entirely, as I don't want to end up wasting my time or breaking someone else's work. I would have hoped it worked out like the test assignment did, that we all had a central point to contact (in the case of the test assignment, rhung) to figure out who was doing what and how things were supposed to flow together, but alas, no dice.
Instead I am getting back to work on my involvement in the CubicVR project. I have been assigned the task of migrating an octree implementation into CubicVR and removing the current implementation. I am hoping to have this fully implemented and tested before next week, and have it land next week. Hopefully this will suffice for my 0.4 assignment. Luckily I already have a decent understanding of how octrees work, so the migration will hopefully be a piece of cake.
If people start showing up and talking in the IRC channel at some point today, I am likely to redirect my efforts back to the mouselock, but until then, I'll put myself to work on CubicVR.
Instead I am getting back to work on my involvement in the CubicVR project. I have been assigned the task of migrating an octree implementation into CubicVR and removing the current implementation. I am hoping to have this fully implemented and tested before next week, and have it land next week. Hopefully this will suffice for my 0.4 assignment. Luckily I already have a decent understanding of how octrees work, so the migration will hopefully be a piece of cake.
If people start showing up and talking in the IRC channel at some point today, I am likely to redirect my efforts back to the mouselock, but until then, I'll put myself to work on CubicVR.
Saturday, November 26, 2011
0.3 material testing system
I got all the common material types working into the testing system, and got the camera controls working so the materials could be more accurately checked. Not much else was added to the tester. I attempted to get another bug to work on, but the ones listed were either already taken or seemed like to large of bugs to pick up at this one. I'll leave ccliffe a message in hopes he can get me some more work to do. I feel the work done in this tester wasn't good enough to account for 0.3, so I guess my only option is to do an extra amount of work for 0.4 to make up for this.
Thursday, November 24, 2011
Getting 0.3 caught up
Ya know, as a programmer, being separated from your computer, and thus your ability to work, for several days can make you feel awful helpless... but thats neither here nor there.
Still working on 0.3 as of now, though it was due a few days ago. Still trying to fix up the testing platform, though the tester and fix I made for 0.2 landed early last week. I want to get this tester to a point that I think it is actually worth while, capable of testing all the materials and with the ability to fine tweak the testing environment without actually changing code... So far I've changed the interface to better reflect how it will be controlled, added camera controls, and did some more research on the material system in CubicVR. I still have to get the materials all in and working, and I wanted to implement both an automation process and a environment dump into the testing platform, so I still got a day of work on it. This could have been done on time, yet my inability to remember to pack my laptop when I leave severely hampered it.
Even when I get the tester done... I don't feel it will be enough for me to justify my 0.3, so I'll take a glance through the CubicVR bugs, and see if I can nab one that I can fix in a day and bundle that in with the tester as 0.3. I have become pretty familiar with the way CubicVR works that I can't imagine it will be difficult to finish. I guess I am hoping do a bit extra will excuse my tardiness.
As a cool side note, the Doom 3 source code was released. I am pretty excited to get a chance to dig through it, see if I can find any patterns or conventions use that I can learn from and adopt.
Still working on 0.3 as of now, though it was due a few days ago. Still trying to fix up the testing platform, though the tester and fix I made for 0.2 landed early last week. I want to get this tester to a point that I think it is actually worth while, capable of testing all the materials and with the ability to fine tweak the testing environment without actually changing code... So far I've changed the interface to better reflect how it will be controlled, added camera controls, and did some more research on the material system in CubicVR. I still have to get the materials all in and working, and I wanted to implement both an automation process and a environment dump into the testing platform, so I still got a day of work on it. This could have been done on time, yet my inability to remember to pack my laptop when I leave severely hampered it.
Even when I get the tester done... I don't feel it will be enough for me to justify my 0.3, so I'll take a glance through the CubicVR bugs, and see if I can nab one that I can fix in a day and bundle that in with the tester as 0.3. I have become pretty familiar with the way CubicVR works that I can't imagine it will be difficult to finish. I guess I am hoping do a bit extra will excuse my tardiness.
As a cool side note, the Doom 3 source code was released. I am pretty excited to get a chance to dig through it, see if I can find any patterns or conventions use that I can learn from and adopt.
Monday, November 14, 2011
Mouse controls in Firefox: Going from the ground up
So we were tasked with trying to find some way of manipulating the mouse controlling code for the Firefox browser. For those who haven't seen it before, the Firefox code base is massive, so randomly choosing where to start will likely leave you stranded with no way to find what your looking for. It is in your best interest to start from something you are already familiar with and move from there. Even in foreign code, there will be many overlapping tools or code bases you are likely to already be familiar with. So I started from the lowest level I could find, simply because I am most comfortable and knowledgeable there, which in this case was the Windows API.
So I went into this thinking two things:
If anyone wants more information on this, comment and I'll post an updated post with more explanation.
**Update** - If my previous explanation was too wordy, here is a simple code sample.
mozilla-central\widget\src\windows\nsWindows.cpp
bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam,LPARAM lParam, bool aIsContextMenuKey,PRInt16 aButton, PRUint16 aInputSource)
{
bool result = false;
UserActivity();
...
nsIntPoint eventPoint;
eventPoint.x = GET_Y_LPARAM(lParam);
eventPoint.y = GET_X_LPARAM(lParam);
nsMouseEvent event(true, aEventType, this, nsMouseEvent::eReal,aIsContextMenuKey
? nsMouseEvent::eContextMenuKey : nsMouseEvent::eNormal);
...
So I went into this thinking two things:
- I am trying to find where the browser gets the mouse data so I can manipulate it
- This build is compiled on Windows, so it needs to talk to the Windows API to get hardware input
If anyone wants more information on this, comment and I'll post an updated post with more explanation.
**Update** - If my previous explanation was too wordy, here is a simple code sample.
mozilla-central\widget\src\windows\nsWindows.cpp
bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam,LPARAM lParam, bool aIsContextMenuKey,PRInt16 aButton, PRUint16 aInputSource)
{
bool result = false;
UserActivity();
...
nsIntPoint eventPoint;
eventPoint.x = GET_Y_LPARAM(lParam);
eventPoint.y = GET_X_LPARAM(lParam);
nsMouseEvent event(true, aEventType, this, nsMouseEvent::eReal,aIsContextMenuKey
? nsMouseEvent::eContextMenuKey : nsMouseEvent::eNormal);
...
Subscribe to:
Posts (Atom)