Show Posts
|
|
Pages: 1 [2] 3 4 ... 7
|
|
21
|
Crystal Space Development / General Crystal Space Discussion / Re: Minimal code to use Emitter, Fountain, Fire, Snow, Rain, etc. mesh objects?
|
on: April 16, 2006, 08:45:23 am
|
- - - - if (!loader->LoadTexture ("rain_tex", "/lib/std/spark.png")) ReportError ("Failed to load \"rain\" texture"); csRef<iMaterialWrapper> rain_tex_mw = engine->GetMaterialList ()->FindByName ( "rain_tex");
csRef<iMeshFactoryWrapper> rain_mfw = engine->CreateMeshFactory ( "crystalspace.mesh.object.rain", "rain"); if (!rain_mfw) cout << "no rain_mfw initialized!\n"; csRef<iMeshWrapper> rain_itself = engine->CreateMeshWrapper (rain_mfw, "rain_itself", 0, csVector3 (0, 0, 0)); rain_itself->SetZBufMode (CS_ZBUF_TEST); cout << "aaa\n"; csRef<iRainState> rain_state = csQueryRegistry<iRainState> (GetObjectRegistry ()); if (!rain_state) cout << "no rain_state!\n"; rain_itself->GetMeshObject ()->SetMaterialWrapper (rain_tex_mw); rain_state->SetMixMode (CS_FX_ADD); rain_itself->GetMeshObject ()->SetColor (csColor (0.5, 0.5, 0.8)); rain_state->SetParticleCount (100); rain_state->SetDropSize (1, 1); rain_state->SetLighting (false); rain_state->SetBox (csVector3 (-5, 0, -5), csVector3 (5, 10, 5)); rain_state->SetFallSpeed (csVector3 (0, -1, 0)); - - - - So the app does say "no rain_state!". Why no rain_state? What am I missing? Thanks.
|
|
|
|
|
22
|
Crystal Space Development / General Crystal Space Discussion / Re: How to rotate an object around itself?
|
on: April 15, 2006, 05:28:55 pm
|
Thanks. Now all works  Here's a "full" code if anyone is interested: - - - - // It's training in using thing mesh obj csRef<iMeshWrapper> cube = engine->CreateThingMesh (room, "cube"); csRef<iMeshObject> cube_object = cube->GetMeshObject (); csRef<iMeshObjectFactory> cube_factory = cube_object->GetFactory (); csRef<iThingFactoryState> cube_state = scfQueryInterface<iThingFactoryState> ( cube_factory);
// create a cube at (0, 0, 0) local position, then we'll move it to the necessary // place //cube_state->AddOutsideBox (csVector3 (7, 0, 7), csVector3 (9, 3, 9)); cube_state->AddOutsideBox (csVector3 (-1, -1.5, -1), csVector3 (1, 1.5, 1));
cube_state->SetPolygonMaterial (csPolygonRange (1, 5), cube_tex_wall_mw); cube_state->SetPolygonTextureMapping (csPolygonRange (1, 5), 1);
cube_state->SetPolygonMaterial (csPolygonRange (0, 0), cube_tex_mw); cube_state->SetPolygonTextureMapping (csPolygonRange (0, 0), csVector2 (0, 0), csVector2 (1, 0), csVector2 (1, 1) );
// It's training in moving a mesh
csRef<iMovable> cube_movable = cube->GetMovable (); cube_movable->SetPosition (csVector3 (7, 1.5, 7)); csVector3 xyz = cube_movable->GetFullPosition (); cout << "xyz = (" << xyz.x << ", " << xyz.y << ", " << xyz.z << ")" << endl; cube_movable->GetTransform ().RotateThis (csVector3 (0, 1, 0), 45 * PI / 180 ); cube_movable->UpdateMove (); - - - -
|
|
|
|
|
26
|
Crystal Space Development / General Crystal Space Discussion / Re: How to rotate an object around itself?
|
on: April 15, 2006, 03:43:29 pm
|
I have: - - - - csRef<iMeshWrapper> cube = engine->CreateThingMesh (room, "cube"); csRef<iMeshObject> cube_object = cube->GetMeshObject (); csRef<iMeshObjectFactory> cube_factory = cube_object->GetFactory (); csRef<iThingFactoryState> cube_state = scfQueryInterface<iThingFactoryState> ( cube_factory);
cube_state->AddOutsideBox (csVector3 (7, 0, 7), csVector3 (9, 3, 9)); - - - - csRef<iMovable> cube_movable = cube->GetMovable (); csVector3 xyz = cube_movable->GetFullPosition (); cout << "xyz = (" << xyz.x << ", " << xyz.y << ", " << xyz.z << ")" << endl; cube_movable->GetTransform ().RotateThis (csVector3 (0, 1, 0), 45 * PI / 180 ); cube_movable->UpdateMove (); - - - - Before-Rotate-This ScreenshotAfter-Rotate-This ScreenshotSo how to rotate the object around itself? Thanks.
|
|
|
|
|
27
|
Crystal Space Development / General Crystal Space Discussion / Does CS map format suits the needs of OSRPG map? Have a look, please.
|
on: April 11, 2006, 04:41:43 pm
|
|
Global map is created with a very low detalization intended to be shown from a bird-flight altitude. Programmers in their turn implement a dynamic detalization (using random) of the global map (dynamic, because in a detalized view it'll occupy just an anormous amount of memory). Then, according to this random map, designers create a set of "patches" which will be applied in order to make map view detalization better. After leaving a location, player enters that "dynamic" global map, and there appears a globe icon at the screen. Starting from this moment player is able to switch to a bird-flight altitude view at any moment (moving on the map with the help of point&click). When using this mode (bird-mode, let's say=)) time starts to run faster which leads to a faster movement from one place to another. At any moment player can return back to a pedestrian view, but in this case the speed of his movement comes back to normal. Also, player will be returned to pedestrian view when meeting a NPC (like Fallout). An example of such a movement is an Arcanum game where you're able, if you wish, travel all the planet by feet.
|
|
|
|
|
28
|
Crystal Space Development / General Crystal Space Discussion / AWS
|
on: April 11, 2006, 06:03:24 am
|
I have this code: - - - - aws->SetupCanvas (0, g2d, g3d); aws->GetPrefMgr ()->Load ("/aws/awstest.def"); aws->GetPrefMgr ()->SelectDefaultSkin ("Normal Windows"); csRef<iAwsWindow> test1 = aws->CreateWindowFrom ("Form1"); if (test1) test1->Show (); //aws->CaptureMouse (aws->ComponentAt (10, 10)); - - - - When I run the app I get these errors: - - - - loading definitions file /aws/awstest.def... aws: Couldn't find sink 'testButtonSink'. aws: Couldn't find sink 'testButtonSink'. aws: Couldn't find sink 'testButtonSink'. aws: Couldn't find sink 'testButtonSink'. aws: Couldn't find sink 'testButtonSink'. aws: Couldn't find sink 'testButtonSink'. load successful (5 windows, 1 skins loaded.) aws-debug: setting up global AWS palette... aws-debug: finished palette setup. - - - - How to fix it? Thanks.
|
|
|
|
|
|