• What are you working on? V7
    2,001 replies, posted
[QUOTE=s0ul0r;20274413]:> [IMG]http://img98.imageshack.us/img98/4623/mountains3d.png[/IMG] Now I'm thinking about building an octree class (Or use the one example I just found online :D) And check the collision between a "player" and the ground so that you can walk around :D[/QUOTE] whoa that REALLY came out nice :0
[QUOTE=s0ul0r;20274413]:> [img_thumb]http://img98.imageshack.us/img98/4623/mountains3d.png[/img_thumb] Now I'm thinking about building an octree class (Or use the one example I just found online :D) And check the collision between a "player" and the ground so that you can walk around :D[/QUOTE] that's niiiice damn I should really get into 3d XNA...but one project at a time. People expect me to finish one game before moving to the next D:
Feedback for the multi-line text: Looks like one line is still cut off (The huge word line.) - Shouldn't this "word" get broken up into multiple words ? Also wrapped lines start further to the left than the first word in the sentence. (E.g. "Lorem" and "tempor".)
Just incase you didn't know, [noparse][img_thumb][/img_thumb][/noparse] Turns the image into a small thumbnail. it's good for quotes.
[QUOTE=Jallen;20274737]Just incase you didn't know, [noparse][img_thumb][/img_thumb][/noparse] Turns the image into a small thumbnail. it's good for quotes.[/QUOTE] Speaking of which, it would be really cool if the forum automatically changed images to them when you quote someone. :D
Does it make a difference if I use the virtual keyword again for a function I'm overwriting? [cpp]class A { virtual void foo(); } class B : public A { virtual void foo();//does it make a difference when I leave this virtual out? } class C : public B { void foo(); }[/cpp]
It needs to be virtual doesn't it? Actually, I dunno, I'm not sure if the method in C overwrites in the method in B or A
[QUOTE=Robber;20274892]Does it make a difference if I use the virtual keyword again for a function I'm overwriting? [cpp]class A { virtual void foo(); } class B : public A { virtual void foo();//does it make a difference when I leave this virtual out? } class C : public B { void foo(); }[/cpp][/QUOTE] People say it has an overhead. But I wouldn't worry about it too much, it's common to leave shit as virtual that might get overridden in the future.
[QUOTE=Robber;20274892]Does it make a difference if I use the virtual keyword again for a function I'm overwriting? [cpp]class A { virtual void foo(); } class B : public A { virtual void foo();//does it make a difference when I leave this virtual out? } class C : public B { void foo(); }[/cpp][/QUOTE] Doesn't virtual mean you have to override it? In that case, you'd have to leave it out unless you only want to derive from that class.
[QUOTE=arienh4;20275440]Doesn't virtual mean you have to override it? In that case, you'd have to leave it out unless you only want to derive from that class.[/QUOTE] No, that's pure virtual. Virtual means you *can* override it.
[QUOTE=arienh4;20275440]Doesn't virtual mean you have to override it? In that case, you'd have to leave it out unless you only want to derive from that class.[/QUOTE] It means you can override it, but you don't have to. [b]Edit:[/b] Ninjas.
Thanks for the answers. I asked because I found a tutorial article that covered that, but it was pretty confusing so I just skipped over it because that wasn't what I was looking for at the time. Now that I had time to properly read it I couldn't find it anymore, but wasn't uncertain how I should do it. I just found it again a minute ago: That's the code it's describing: [cpp]#include <iostream> using namespace std; struct A { virtual void f() { cout << "Class A" << endl; } }; struct B: A { void f(int) { cout << "Class B" << endl; } }; struct C: B { void f() { cout << "Class C" << endl; } }; int main() { B b; C c; A* pa1 = &b; A* pa2 = &c; // b.f(); pa1->f(); pa2->f(); } /* Output: Class A Class C */ [/cpp] And that's the part that confused me: [quote]The function B::f is not virtual. It hides A::f. Thus the compiler will not allow the function call b.f(). The function C::f is virtual; it overrides A::f even though A::f is not visible in C.[/quote] I think I'll just save myself the trouble and keep the virtual.
Garry you so funny
[QUOTE=Robber;20276142]Thanks for the answers.[/QUOTE] Once virtual always virtual. The issue you're seeing above has nothing to do with virtual. Essentially you're trying to call calling f() without any parameters, but class b only has an f() that takes an int parameter. This version overshadows class a's f() function which doesn't take any parameters, so the compiler doesn't see that one and complains. If you don't overshadow it then there won't be a problem, or if you do, you need to explicitly state that you're calling the function from class a: [cpp] struct a_t { void f() { std::cout << "a_t::f()\n"; } }; struct b_t : a_t { void f(int param) { std::cout << "b_t::f()\n"; } }; int main() { b_t b; //b.f(); // error, there's only b_t::f(int) b.f(42); // ok b.a_t::f(); // ok, explicitly call the version from a_t } [/cpp] Another solution would be to bring a's f() into b's scope: [cpp] struct b_t : a_t { void f(int param) { std::cout << "b_t::f()\n"; } using a_t::f; // also using a's version of f(), which doesn't take a parameter }; ... b.f(); // no need to explicitly say it's from a_t [/cpp]
Wow, you are great at explaining this. Thanks a lot.
Here's something I worked on today. Lego robot control with a joystick. Very much a WIP, but I like it. What do you guys think? [media]http://www.youtube.com/watch?v=HIdm_a2iEk8[/media]
[QUOTE=grlira;20277784]Here's something I worked on today. Lego robot control with a joystick. Very much a WIP, but I like it. What do you guys think? [url]http://www.youtube.com/watch?v=HIdm_a2iEk8[/url][/QUOTE] I was very worried it wasn't going to go backwards! :ohdear: Impressive nonetheless :D
[QUOTE=Chandler;20277885]I was very worried it wasn't going to go backwards! :ohdear: Impressive nonetheless :D[/QUOTE] Thanks :D Hmm, why were you worried though? Because it's not 100% responsive?
[QUOTE=grlira;20277964]Thanks :D Hmm, why were you worried though? Because it's not 100% responsive?[/QUOTE] I thought it had broke/was "building up" tension and then was going to race off the desk to it's doom D:
I've build a self stabilizing robot using my old rcx about a half year ago :D (Like the segway things) Even though, since I only had one lightsensor, it only worked on my blank white flat table. BUT it balanced itself on 2 wheels :D
[QUOTE=Chandler;20278112]I thought it had broke/was "building up" tension and then was going to race off the desk to it's doom D:[/QUOTE] Ahahah thankfully it didn't. Although... I had a rcx go crazy on me once and ended up having to rebuild it? That wasn't fun... Either way, strange thing is it was actually more responsive during the tests before I filmed it and after I uploaded the vid. Guess these things always happen at the worse times xD [b]Edit:[/b] @s0ul0r ah ye, those are fun. I never got around to building one though. (strangely, I've done a segway on gmod o.o) OT: facpunch on my phone ftw :D
[QUOTE=Robber;20277346]Wow, you are great at explaining this. Thanks a lot.[/QUOTE] Anytime, feel free to ask any further questions you may have :smile:
[QUOTE=grlira;20278385]OT: facpunch on my phone ftw :D[/QUOTE] I visit this thread on my Droid nearly every day in school. Generally when the days are slowing down, or in that period early in the morning when nobody is there. Only worth checking specific threads though, too slow to browse through the forum easily. That, and the blue bars at the top as well as the gray bars above posts are shortened. Nice job with the lego robot, though. Are you just communicating with the tower (was that what it was called? I haven't played with my mindstorm in years, I'm not even sure if I still have all the parts), or how are you communicating with it? [editline]08:09PM[/editline] [QUOTE=nullsquared;20278422]Anytime, feel free to ask any further questions you may have :smile:[/QUOTE] And I have to agree with Robber, that was a very good explanation. That was one of the questions I hadn't gotten around to answering myself. You did the job for me. You don't deserve most of the contempt you get on here, really, you just get a little irritable from time to time, like everybody else.
I've also been messing around with some guy's XNA tutorial, here's my awesome heightmap! [IMG]http://i4.photobucket.com/albums/y120/CrashBaco/heightmapProject.png[/IMG]
Did some shader work (It was a pain in the ass to add normals to the VertexPositionColored, thanks to riemers tutorials I found out how to create your own VertexDeclaration :D) Without normals, no diffuse shader (obviously) Anyway, here's the video: [b]RISE MY CHILDREN, RIISE!.[/b] [hd]http://www.youtube.com/watch?v=OWJhgomQ_5Y[/hd]
I decided to hop onto the bandwagon (Maybe a bit late but oh well) and write a mandelbrot renderer. [img]http://ace.saxservers.net/stuff/mandelbrot.png[/img] [url=http://ace.saxservers.net/stuff/Mandelbrot.rar]Download[/url] (Included are a windows and linux binary and the SFML DLLs required to run it in windows) Controls are: WASD - Move QE - Zoom F1 - Screenshot (low quality jpg since I didn't feel like writing my own screenshot function)
Yay, finally got my ComodoPoC working :D. Such a nightmare to edit a dll in order to load another one. Before it did work but it was very specific on the OS so like it would only work on a specific patch of SP 3. Now it takes the dependent file from the system and adds the entry itself so it no longer has that limitation :D. (Also, making a video displaying it and posting it on the comodo forums)
Note to self: CCL's threading is still very funky indeed. They don't seem to clean up after themselves properly. I think I'll just emulate the UnrealScript VM again and fake threading. [img_thumb]http://www.cubeupload.com/files/589e00untitled.png[/img_thumb]
Block game editor coming along nicely. The 2 green frames are the cursor, you move it around with arrow keys and press space to place the currently selected object on the side panel. The side panel doesn't fully work yet though. [img]http://i49.tinypic.com/28ums7s.jpg[/img] <3 programmer art
[QUOTE=s0ul0r;20274544]That is some nice test text you got there garry.[/QUOTE] Certainly kicks the shit out of "Lorem Ipsum"
Sorry, you need to Log In to post a reply to this thread.