diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-02-25 02:01:49 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-02-25 02:01:49 +0300 |
commit | 47d79b04d1deda821925da98319984211920210e (patch) | |
tree | f23c5e7480b82080c7583673214d28f158687520 /source/gameengine | |
parent | b78b12b7aea1e50fdf47875f17e7e1a959444890 (diff) |
BGE Dome: Console arguments: angle, tilt, mode and warpdata (not working yet)
2Do:
(1) open external warpdata file
(2) documentation
(3) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
otherwise it's a nightmare to update all your files every time you change your projection system. See note.
Maybe SYS_WriteCommandLineInt/Float/String can be used for that. Gotta investigate further.
* Note: an external warpdata file is a must ! Currently every time you need to calibrate your system you have to update the warp file in all your demo files. This is terrible. I'm glad I *now* have a dome near by to test it ;)
* FYI: A recent 'Yo Frankie in a dome' video if you want to see how it works: http://www.vimeo.com/9629626 I'm going to record a better one tomorrow.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 88 |
1 files changed, 82 insertions, 6 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index a1fa810e73a..ce80036de8f 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -195,6 +195,17 @@ void usage(const char* program) printf(" anaglyph (Red-Blue glasses)\n"); printf(" vinterlace (Vertical interlace for autostereo display)\n"); printf(" depending on the type of stereo you want\n\n"); + printf(" -D: start player in dome mode\n"); + printf(" --Optional parameters--\n"); + printf(" angle = field of view in degrees\n"); + printf(" tilt = tilt angle in degrees\n"); + printf(" warpdata = a file to use for warping the image\n"); + printf(" mode: fisheye (Fisheye)\n"); + printf(" truncatedfront (Front-Truncated)\n"); + printf(" truncatedrear (Rear-Truncated)\n"); + printf(" cubemap (Cube Map)\n"); + printf(" sphericalpanoramic (Spherical Panoramic)\n"); + printf(" depending on the type of dome you are using\n\n"); #ifndef _WIN32 printf(" -i: parent windows ID \n\n"); #endif @@ -310,6 +321,11 @@ int main(int argc, char** argv) RAS_IRasterizer::StereoMode stereomode = RAS_IRasterizer::RAS_STEREO_NOSTEREO; bool stereoWindow = false; bool stereoParFound = false; + int stereoFlag = STEREO_NOSTEREO; + int domeFov = -1; + int domeTilt = -200; + int domeMode = 0; + char* domeWarp = NULL; int windowLeft = 100; int windowTop = 100; int windowWidth = 640; @@ -525,30 +541,31 @@ int main(int argc, char** argv) stereomode = RAS_IRasterizer::RAS_STEREO_NOSTEREO; // only the hardware pageflip method needs a stereo window - if(!strcmp(argv[i], "hwpageflip")) { + else if(!strcmp(argv[i], "hwpageflip")) { stereomode = RAS_IRasterizer::RAS_STEREO_QUADBUFFERED; stereoWindow = true; } - if(!strcmp(argv[i], "syncdoubling")) + else if(!strcmp(argv[i], "syncdoubling")) stereomode = RAS_IRasterizer::RAS_STEREO_ABOVEBELOW; - if(!strcmp(argv[i], "anaglyph")) + else if(!strcmp(argv[i], "anaglyph")) stereomode = RAS_IRasterizer::RAS_STEREO_ANAGLYPH; - if(!strcmp(argv[i], "sidebyside")) + else if(!strcmp(argv[i], "sidebyside")) stereomode = RAS_IRasterizer::RAS_STEREO_SIDEBYSIDE; - if(!strcmp(argv[i], "vinterlace")) + else if(!strcmp(argv[i], "vinterlace")) stereomode = RAS_IRasterizer::RAS_STEREO_VINTERLACE; #if 0 // future stuff - if(strcmp(argv[i], "stencil") + else if(!strcmp(argv[i], "stencil") stereomode = RAS_STEREO_STENCIL; #endif i++; stereoParFound = true; + stereoFlag = STEREO_ENABLED; } else { @@ -556,6 +573,47 @@ int main(int argc, char** argv) printf("error: too few options for stereo argument.\n"); } break; + case 'D': + stereoFlag = STEREO_DOME; + stereomode = RAS_IRasterizer::RAS_STEREO_DOME; + i++; + if ((i + 1) < argc) + { + if(!strcmp(argv[i], "angle")){ + i++; + domeFov = atoi(argv[i++]); + } + if(!strcmp(argv[i], "tilt")){ + i++; + domeTilt = atoi(argv[i++]); + } + if(!strcmp(argv[i], "warpdata")){ + i++; + domeWarp = argv[i++]; + } + if(!strcmp(argv[i], "mode")){ + i++; + if(!strcmp(argv[i], "fisheye")) + domeMode = DOME_FISHEYE; + + else if(!strcmp(argv[i], "truncatedfront")) + domeMode = DOME_TRUNCATED_FRONT; + + else if(!strcmp(argv[i], "truncatedrear")) + domeMode = DOME_TRUNCATED_REAR; + + else if(!strcmp(argv[i], "cubemap")) + domeMode = DOME_ENVMAP; + + else if(!strcmp(argv[i], "sphericalpanoramic")) + domeMode = DOME_PANORAM_SPH; + + else + printf("error: %s is not a valid dome mode.\n", argv[i]); + } + i++; + } + break; default: printf("Unkown argument: %s\n", argv[i++]); break; @@ -714,6 +772,24 @@ int main(int argc, char** argv) stereoWindow = true; } } + else + scene->gm.stereoflag = STEREO_ENABLED; + + if (stereoFlag == STEREO_DOME){ + stereomode = RAS_IRasterizer::RAS_STEREO_DOME; + scene->gm.stereoflag = STEREO_DOME; + if (domeFov > 89) + scene->gm.dome.angle = domeFov; + if (domeTilt > -180) + scene->gm.dome.tilt = domeTilt; + if (domeMode > 0) + scene->gm.dome.mode = domeMode; + if (domeWarp) + { + printf("using external file as dome warping. Not implemented yet"); + //scene->gm.dome.warptext + } + } // GPG_Application app (system, maggie, startscenename); app.SetGameEngineData(maggie, scene, argc, argv); /* this argc cant be argc_py_clamped, since python uses it */ |