Crystal Space
Welcome, Guest. Please login or register.
July 25, 2014, 06:03:16 am

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8229 Members
Latest Member: Kula999lidia
* Home Help Search Login Register
  Show Posts
Pages: [1] 2 3 ... 5
1  Crystal Space Development / Support / Re: why I can't run the CEL example "nettest"? on: October 09, 2008, 11:20:27 am
I would also suggest not to use nettest.
There at least a few issues that are not solved.
About 2 years ago i contacted the guy who wrote this part of the code. He mentioned that there are indeed issues, but that he doesn't work on it anymore.
So i think there isn't anyone working on this plugin anymore.
This was enough reason for me to look for an alternative.
I started with torquenet, but had problems with combining it with the CS libraries.
Then i tried RakNet, which turns out to works fine.
I would suggest to download the code, study the examples and use it for your CS-application.
I would not use HawNL: although it abstracts the "core" network communication, the level of abstraction is too low. RakNet does "object-synchronisation" out of the box.
So basicaly you define classes that contain the state of the objects to be shared (like position, orienation etc) and connect these to your CS objects, like the Actor. Raknet will take care of synchronising the updates of the state to all objects on the network...
In case you are working on a commercial product, the licence fee for using RakNet is quite low
(btw, i do not work for RakNet wink
2  Crystal Space Development / General Crystal Space Discussion / CrystalSpace on android? on: February 19, 2008, 04:48:51 pm
it would be great if CS could be used as engine for 3d applications (games smiley for example) on upcoming generation of mobile phones.
The android framework (http://code.google.com/android/what-is-android.html) uses OpenGL ES 1.0 (which is basicaly OpenGL1.3)
Android runs on Linux. The modular approach of CS could make it well suited for this purpose.

What do you think of this?
3  Crystal Space Development / Game Content Creation / Re: Loading CEL entities into a non-CEL level. on: February 13, 2008, 10:49:54 am
i used the cel-example "walktut" as reference for my integration with CS.
As far as i understand, it (and the event distribution) works as follows:
There must be 1 object with the iCelBlLayer interface that is responsible for creating the behaviours of the entities that you want to create (also with the iCelBLLayer interface). Therefore, this class only implements the "CreateBehaviour" and the "GetName" methods. This object is registered at the physical layer:
Code:
  pl->RegisterBehaviourLayer (bl);

From now on, when a entity creation is requested, the creation of the "corresponding" behaviour is defered to the iCelBlLayer object that was registered above.
If one of the specified property-classes generates events of any kind, these will effectively be send to the behaviour associated to this entity. For example, if a pccommand property class is specified, keybord events will be send to the behaviours SendMessage method. The behaviour object has to do something with it, for example updating the position of the mesh.

So i don't think that the level-entity has some special purpose in relation to the event mechanism.
The physical layer should be able to send any "subscribed" events to the behaviours.
I would suggest to set a breakpoint at the "CreateBehaviour" method, to be sure that the correct behaviour will be created when you request a new entity.
Another breakpoint at the SendMessage method of the behaviour-object to check if events arrive. 

Until now i haven't switched levels at runtime, so i don't know if this works when using level entities, it is interesting to try. As far as i remember, switching levels still is problematic even in plain cs (things with unreleased renderloops of the previous levels or something like that). I don't know what the status is of these issues...
4  Crystal Space Development / Game Content Creation / Re: Loading CEL entities into a non-CEL level. on: February 12, 2008, 02:21:44 pm
How are you creating the actor entity without a pre-existing level entity?
i do create the level entity first:
Code:
  pl = csQueryRegistry<iCelPlLayer> (object_reg);
  bl.AttachNew (new BehaviourLayer(pl));

  // We also need to register it to the object registry.
  if (!GetObjectRegistry()->Register (bl, "iCelBlLayer"))
    return ReportError ("Can't register our behaviour layer!");

  pl->RegisterBehaviourLayer (bl);

  // etc

  // Load all used propertyclass factorries
  if (!pl->LoadPropertyClassFactory ("cel.pcfactory.zonemanager"))
    return ReportError ("Error loading pczonemanager factory!");
  // etc.
  level_entity = pl->CreateEntity ("level", bl, "level_behave",
    "pczonemanager",
    CEL_PROPCLASS_END);
  if (!level_entity)
    return ReportError ("Error creating level entity!");

  // Now get the iPcZoneManager interface so we can setup the level.
 
  csRef<iPcZoneManager> zonemgr = CEL_QUERY_PROPCLASS_ENT (level_entity,
  iPcZoneManager);
  iCelZone* zone = zonemgr->CreateZone ("main");
  iCelRegion* region = zonemgr->CreateRegion ("main");
  zone->LinkRegion (region);

  iCelMapFile* mapfile = region->CreateMapFile ();
  mapfile->SetPath ("/this/level");
  mapfile->SetFile ("world");   
5  Crystal Space Development / Game Content Creation / Re: Loading CEL entities into a non-CEL level. on: February 11, 2008, 04:04:50 pm
I think that in order to receive the mesh selection event you also have to register the "meshselect" property class:
 
Code:
muck1_entity = pl->CreateEntity("Muck_ent", bl, "box_behave",
"pcobject.mesh",
                         "pcobject.mesh.select"
//"pcmove.linear",
//"pcmove.actor.standard",
CEL_PROPCLASS_END);
the entity should now receive the selection event
Code:
bool BehaviourBox::SendMessage (csStringID msg_id,
iCelPropertyClass* pc,
  celData& ret, iCelParameterBlock* params, va_list arg)
{
  if (msg_id == id_pcmeshsel_down)
  {
    // do something...
    return true;
  }

  return BehaviourCommon::SendMessage (msg_id, pc, ret, params, arg);
}

Using CEL in combination with "straight CS" works great, in this way you can have "best of both worlds", using CEL if you can find something there that does what you want, and using CS if you cannot do it with CEL. You can also consider defining a new property-class for the "feature". Even in that case it is not a bad idea to first code it in CS, and define a property-class for it later only if it is "general enough" so you (and others) can use the feature in a convenient way...
 At the moment i only use CEL for the actor, in this way i get the nice camera modes, animation control and collistion detection for "free".
6  Associate Projects / CEL Discussion / How to switch camera & input between multiple actors? on: January 11, 2008, 11:38:01 am
Hi,

i use several actors in a networked multi-user application, the actors are defined as follows:
Code:
  _entity = pl->CreateEntity ("player", bl, "player_behave",
    "pcdefaultcamera",
    "pcmesh",
    "pclinearmovement",
    "pcactormove",
    "pccommandinput",
    "pcinventory",
    CEL_PROPCLASS_END);
One of these actors is controlled locally, the other ones are controled remote by other players in the network.
I don't know how to couple the camera and input to 1 particular actor in the scene.

For the input part i can check in the SendMessage method of the "PlayerBehavior class" to only update the actor position if the actor is "active". Not very elegant but it should work. A nicer solution would be to disable the "pccommandinput" propertyclass so that no kb-events will be sent to this entity. Can this be done?

The camera is something that is now only controlled by the cel-part, i can switch between the several camera modes,using the "m" keybinding of the pcdefaultcamera propertyclass, i didn't have to code anything for this  (which is great). I don't know however how to connect my view to 1 particular camera (belonging 1 particular actor).

Does somebody knows how to do this?
Thanks
7  Crystal Space Development / Support / Re: CS plugin for webbrowser on: December 05, 2007, 09:54:32 am
Hi Pablo,

thanks for the info!
I will check both projects to see where to continue, mozcrystal looks most promising.
And indeed, personal overload is often the critical factor for opensource development...
I wiil contact you as soon i have "some feeling" for your code, for me the primary platform will be windows.

Rick.
8  Crystal Space Development / Support / CS plugin for webbrowser on: December 04, 2007, 10:07:35 am
i can remember that there were some ideas for creating a web-browser plugin, such that you can click a link, and see the cs scene/app in a
window or in the browser.
Does somebody know what the status is? is there already something that can be tried?
 
9  Crystal Space Development / Game Content Creation / How should the tangents and binormals be specified? on: November 30, 2007, 02:44:11 pm
Several shaders (like parallaxAt) refer to the normal, tangent and binormal as vertex input parameters. The normals can be either calculated automaticaly or defined in the vertex tag:
Code:
<v x="-6.878592" y="-1.970000" z="2.705635" u="0.138820" v="-0.683297" nx="-0.000000" ny="0.000000" nz="-1.000000"/>
this is clear, but how about the tangents and binormals?
10  Crystal Space Development / Support / Re: Multithreading confusion... on: November 28, 2007, 05:04:55 pm
As far as i know cs is -as res already mentioned- single threaded: it is basically a big event dispatcher that distributes events to registered plugins. Processing all events is done by 1 thread. So CS classes are not designed to be thread safe (this would involve embedding expensive synchronisation methods).  Each plugin is however free to use other threads, as long as these threads don't use objects that are used by the main thread (effectively meaning all cs objects) it can do whatever it wants to help speeding up some processing for the plugin.
Communication/synchronisation between the plugin and its thread can be done on many ways, 1 of them is using  message qeues. There are many libraries that abstract this in a platform independent way. I mainly use the opensource Poco library for this.

If you use the RakNet library, most of the processing will already be done by other thread(s) , the API functions (which are "executed" by the main cs thread)  communicate with the network processing thread(s) through message queues, you don't see anything of this from the "outside". As such there is no expensive processing being done by the "main cs thread" (that executes all plugin event handlers).
11  Crystal Space Development / Support / Re: Defining a submesh within a genmesh factory on: November 28, 2007, 11:55:40 am
i implemented it now using the indexbuffer, as suggested by bookeater2.
I followed the genmesh factory loader using walktest with the VS2005 debugger: indeed the <t> tag (as described in the CS documentation) does not exist, the only way is to specifying submeshes in genmesh factories is using the indexbuffers.
Many 3D modellers may work like this. Hardware doesn't. CS follows what the HW is doing.
i guess you are right: if it is implemented in terms of OpenGL vertexarrays (which is the most efficient way) then the vertex positions and other vertex attributes are indeed coupled.
12  Crystal Space Development / Support / Re: problem showing a splash screen on: November 28, 2007, 11:02:08 am
...a more likely opportunity for this will be the next cs conference in Aachen (unless  you can convince the cs-team to go to Talinn next year  smiley )
13  Crystal Space Development / Support / Re: problem showing a splash screen on: November 27, 2007, 09:56:23 am
After loading the plugins you could use the following code snippet:
Code:
  // We need a View to the virtual world.
  view.AttachNew(new csView (engine, g3d));

  iGraphics2D* g2d = g3d->GetDriver2D ();

  // We use the full window to draw the world.
  view->SetRectangle (0, 0, g2d->GetWidth (), g2d->GetHeight ());

  // Get splash image file from configuration file
  const char* splashFile = cfg->GetStr ("Credosim.Settings.SplashScreenFile","");

  if (splashFile)
  {
    // Load splash screen
    loader->LoadTexture ("splash", splashFile);

    // Create a 2D sprite
    iTextureWrapper *texWrapper;
    iTextureHandle* phTexHandle;

    csPixmap* csSplash;
    texWrapper = engine->GetTextureList ()->FindByName ("splash");
    if (texWrapper)
    {
      texWrapper->SetFlags (CS_TEXTURE_2D);
      phTexHandle = texWrapper->GetTextureHandle();
      if (phTexHandle)
      {
        csSplash = new csSimplePixmap (phTexHandle);
        g2d->BeginDraw();
        csSplash->DrawScaled (g3d, 0, 0, g2d->GetWidth(), g2d->GetHeight());
        g3d->FinishDraw();
        const csRect area;
        g3d->Print(&area);
      }
    }
  }
  // Here we load our world from a map file.
  if (!LoadMap ()) return false;
14  Crystal Space Development / Support / Re: Defining a submesh within a genmesh factory on: November 26, 2007, 02:48:08 pm
i just realized that it is ofcourse possible to refer to the "redundant" vertices.
This should work just as for the "non-submesh" situation, although "just as inefficient"....
15  Crystal Space Development / Support / Re: Defining a submesh within a genmesh factory on: November 26, 2007, 01:56:24 pm
There is a problem with specifying the texture coordinates.
From the documentation and examples i understand that the preferred way to specify texture coordinates for genmesh factories is in the "v" tags, for example:
Code:
<v x="-0.338703" y="-0.637001" z="6.718997" u="0.562855" v="0.616343" nx="-0.050111" ny="-0.094241" nz="0.994263"/>
texture coordinates however should be "tied" to triangles, and not to vertices.
In an example like in file "castle\factories\genCube" this is solved by repeating the vertex definition for each triangle:
Code:
<v x="-0.338703" y="-0.637001" z="6.718997" u="0.562855" v="0.616343" nx="-0.050111" ny="-0.094241" nz="0.994263"/>
<v x="-0.338703" y="-0.637001" z="6.734554" u="0.562855" v="-1.302350" nx="0.000000" ny="-0.816492" nz="-0.577349"/>
<v x="-0.323146" y="-0.637001" z="6.718997" u="0.552967" v="-1.302350" nx="0.000000" ny="0.000000" nz="-1.000000"/>
<t v1="2" v2="1" v3="0"/>
<v x="-0.338703" y="-0.637001" z="6.734554" u="0.552967" v="-1.302350" nx="0.000000" ny="-0.816492" nz="-0.577349"/>
<v x="-0.338703" y="-0.637001" z="6.718997" u="0.574173" v="-1.302350" nx="-0.050111" ny="-0.094241" nz="0.994263"/>
<v x="-0.354259" y="-0.637001" z="6.718997" u="0.552967" v="0.616343" nx="1.000000" ny="0.000000" nz="0.000000"/>
<t v1="5" v2="4" v3="3"/>
Although this is inefficient it works.

For the submesh however it is a problem, because you can only specify vertex indices (for the triangles). I don't know how to specify "triangle specific" texture
coordinates.

Is there a solution for this?
Pages: [1] 2 3 ... 5
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 9.617 seconds with 15 queries.