Crystal Space
Welcome, Guest. Please login or register.
October 23, 2017, 05:07:36 am

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77774 Members
Latest Member: Personalinjurylawsuits15710d0
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / Support / Re: "InitCD" action in "pcmove.linear" property class on: June 18, 2008, 02:40:16 pm
> Yes. I write that:
Shit! iPcLinearMovement::InitCD() didn`t work.

It works well on player (player entity can collide with other entities (their meshes loaded using <meshobj/>), except CrystalAlpha):
player_entity = pl->CreateEntity ("player", bl, "player_behave",
  if (!player_entity)
    return ReportError ("Error creating player entity!");


  csRef<iPcZoneManager> pczonemgr = CEL_QUERY_PROPCLASS_ENT (
        level_entity, iPcZoneManager);

  // Get iPcCamera interface
  csRef<iPcCamera> pccamera = CEL_QUERY_PROPCLASS_ENT (player_entity, iPcCamera);

  // Get the iPcMesh interface so we can create the right mesh
  // for our player.

  csRef<iPcMesh> pcmesh = CEL_QUERY_PROPCLASS_ENT (
        player_entity, iPcMesh);
  csBox3 team_box (csVector3 (0.7f, 1.5f, 0.5f));
  pcmesh->CreateNullMesh ("team_mesh", team_box);
    if (!pcmesh->GetMesh ())
    return ReportError ("Error loading model!");

  scfString regionname, startname;
  pczonemgr->GetLastStartLocation (&regionname, &startname);
  // Put player into the world
  pccamera->SetZoneManager (pczonemgr, true, regionname, startname);

  // Set mesh to start position
  if (pczonemgr->PointMesh ("player", regionname, "Spawn"))
    return ReportError ("Can't find region or start position in region!");

  // Get iPcLinearMovement so we can setup the movement system.
  csRef<iPcLinearMovement> pclinmove = CEL_QUERY_PROPCLASS_ENT (
        player_entity, iPcLinearMovement);
  pclinmove->InitCD (
     csVector3 (0.8f,0.8f,0.5f),
     csVector3 (0.6f,0.7f,0.5f),
     csVector3 (0,0,0));

  // Get the iPcActorMove interface so that we can set some parameters
  csRef<iPcActorMove> pcactormove = CEL_QUERY_PROPCLASS_ENT (
        player_entity, iPcActorMove);

But it`s not work on other entities (CrystalAlpha, for example):
BehaviourItem::BehaviourItem (iCelEntity* entity, ProjectBL* bl, iCelPlLayer* pl)
    : BehaviourCommon (entity, bl, pl)
  if (mesh_select)
    csRef<iPcCamera> player_camera = CEL_QUERY_PROPCLASS_ENT (
          pl->FindEntity("player"), iPcCamera);
    mesh_select->SetMaxSelectionDistance (1.5f);
  pcmeshsel_down_id = pl->FetchStringID ("pcmeshsel_down");

  // Test lines
  csRef<iPcLinearMovement> linmov = CEL_QUERY_PROPCLASS_ENT (entity, iPcLinearMovement);
  if (linmov) linmov->InitCD (csVector3 (0.7f, 0.35f, 0.7f),
                csVector3 (0.7f, 0.35f, 0.7f), csVector3 (0.0f, 0.0f, 0.0f));
2  Crystal Space Development / Support / Re: "InitCD" action in "pcmove.linear" property class on: June 18, 2008, 02:12:20 pm
> The entities in walktut don't have CD enabled on them.
Realy? See $CEL/share/cel*/data/walktut_entities

<addon plugin="celentity" entityname="badone">

      <propclass name="pcobject.mesh">
        <action name="LoadMesh">
     <par name="filename" string="monkey" />
     <par name="factoryname" string="monkey" />

      <propclass name="" />

      <propclass name="">
        <property name="pos1" vector="9,2,8" />
        <property name="pos2" vector="6,2,8" />
      <propclass name="pcmove.linear">
        <action name="InitCD">
     <par name="body" vector=".2,.2,.2" />
     <par name="legs" vector=".2,.2,.2" />
     <par name="offset" vector="0,-.3,0" />
        <action name="SetPosition">
     <par name="position" vector="9,3,8" />
     <par name="sector" string="Scene" />
     <par name="yrot" float="0" />

      <behaviour name="badone_behave" />


> Can you show us the C++ code that makes the InitCD work?
Yes. I write that:

BehaviourItem::BehaviourItem (iCelEntity* entity, ProjectBL* bl, iCelPlLayer* pl)
    : BehaviourCommon (entity, bl, pl)
  csRef<iPcLinearMovement> linmov = CEL_QUERY_PROPCLASS_ENT (entity, iPcLinearMovement);
  linmov->InitCD (csVector3(xb, yb, zb), csVector3(xl, yl, zl), csVector3(0, 0, 0));
3  Crystal Space Development / Support / Re: "InitCD" action in "pcmove.linear" property class on: June 18, 2008, 10:18:18 am

Yep, I write it by hand. But as I said before, walk tutorial doesn`t detect collides with entities too. Also I added "offset" to "InitCD" action and changed "vector3" to "vector" (it is the same) but nothing changes. I think, I have not any dependences, that is needed to do collision detection, but I don`t know what it can be. Is it possible to do collision detection with bullet?
4  Crystal Space Development / Support / "InitCD" action in "pcmove.linear" property class on: June 17, 2008, 09:39:53 am
Hi there!

I have a problem with "InitCD" action in "pcmove.linear" property class.

I try to initialize collision detection via "InitCD" action but collision detection doesn`t work.
My entity from xml file:
  <addon entityname="CrystalAlpha" plugin="cel.addons.celentity">
      <propclass name="pcobject.mesh">
        <action name="LoadMeshPath">
          <par string="/mydata/worlds/planetcontrolcenter/factories" name="path"/>
          <par string="Crystal" name="filename"/>
          <par string="Crystal" name="factoryname"/>
      <propclass name=""/>
      <propclass name="">
        <property name="ITEM" bool="yes"/>
        <!--<property name="NPC" bool="no"/>-->
      <propclass name="pcmove.linear">
        <action name="SetPosition">
           <par string="Scene" name="sector"/>
           <par name="yrot" float="0"/>
           <par name="position" vector3="1,1,1"/>
        <action name="InitCD">
          <par name="body" vector3="0.7,0.35,0.7"/>
          <par name="legs" vector3="0.7,0.35,0.7"/>
      <behaviour name="item_behave"/>
Result is properly loaded and properly located mesh but without collision detection. If I place mesh into the world with <meshobj/> from <sector/> section or invoke iPcLinearMovement::InitCD from c++ code collision detection works ok.

Another strange thing is that collision detection don`t work with entities from WALKTUT but collision detection works well with walls and floor.
I build crystal space with ODE with OPCODE support, but without bullet.
Is my problem in dependences? Or maybe I do something wrong in describing "pcmove.linear" property class? Why Walktut doen`t work? Please help me.
5  Crystal Space Development / General Crystal Space Discussion / Re: Help me! Problem with sound on: June 01, 2008, 09:36:17 am
Thanks, Zuck.
6  Crystal Space Development / General Crystal Space Discussion / Re: Help me! Problem with sound on: May 30, 2008, 05:54:49 am
Unfortunately, I can`t provide buildable variant because it have size of 180MB and because of strange promblem with forum: I can`t upload anything. I think all I can to do, it is give you some pieces of code if you need.

NB:Last post I forgot say you that I set up sound listener properly: it always follows the player mesh.
7  Crystal Space Development / General Crystal Space Discussion / Help me! Problem with sound on: May 29, 2008, 02:51:54 pm
I can`t play sounds in Crystal Space using CEL. First I attach all needed plugins.
Second I load my sound wrapper.

CsRef<iLoader> loader;
CsRef<iSndSysRenderer> sndrdr;
CsRef<iSndSysManager> sndmgr;
CsRef<iCelPlLayer> pl;
CsRef <MyBehaviourLayer> bl;
loader->LoadSoundWrapper ("background", "/mydata/music/tarck02.ogg");

Third, I create music playing entity:

pl->CreateEntity ("music_player", bl, "item", "pcsound.source", CEL_PROPCLASS_END);
csRef<iPcSoundSource> bgsound_source = CEL_QUERY_PROPCLASS_ENT (pl->FindEntity ("music_player"), iPcSoundSource);

Fourth, play sound

bgsound_source->SetSoundName ("background");
bgsound_source->GetSoundSource()->SetVolume (1.0f);
bgsound_source->GetSoundSource()->GetStream()->SetLoopState (

On string "bgsound_source->GetSoundSource()->SetVolume (1.0f);" my game crashes.

I can play sounds with iSysSndRenderer and iSysSndManager:
csRef<iSndSysStream> stream = sndrdr->CreateStream (
      sndmgr->FindSoundByName ("background")->GetData(), CS_SND3D_DISABLE);
csRef<iSndSysSource> source = sndrdr->CreateSource (stream);
All works perfect, but I want play sounds using CEL. What I am doing wrong? Please help me to learn how to create playable sound source using sound wrappers and CEL.
8  Associate Projects / CrystalBlend Discussion / Re: Crystal2blender problem on: May 29, 2008, 02:27:37 pm
Ya, I install Crystal Space into /opt/crystalspace because of large size of build directory. I made patch (for Gnu patch/Gnu diff) for crystal2blender from current svn revision. All works good.
9  Crystal Space Development / General Crystal Space Discussion / Help me! on: April 09, 2008, 05:15:24 pm
Help me here,1625.0.html
10  Associate Projects / CrystalBlend Discussion / Crystal2blender problem on: April 07, 2008, 12:43:24 pm
I download crystal2blender and have some problems. When I want to export my mesh into crystal space format, i got "E: Make sure you set your CRYSTAL environment variable before loading blender" error.

I was trying to launch blender this way (I use Linux):
> CRYSTAL=/opt/crystalspace (path to crystal space)
> export CRYSTAL
> blender

but i still get this message. What is wrong?          Sorry for bad English
Pages: [1]
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 6.353 seconds with 17 queries.