[ODE] Newbie question

Robson Ito agemaniac at yahoo.com.br
Wed Sep 24 15:16:15 MST 2003


ok. i'm using ODE to build an fly simulation and got some problems:
1) I use the little piece of code in the user guide that go throught each space testing if there is collision bettewen their Geons. Ok, but when i try to compile it i got some errors. 
void nearCallback (void *data, dGeomID o1, dGeomID o2)
  {
    if (dGeomIsSpace (o1) || dGeomIsSpace (o2)) {
      // colliding a space with something
      dSpaceCollide2 (o1,o2,data,&nearCallback);
      // collide all geoms internal to the space(s)
      if (dGeomIsSpace (o1)) dSpaceCollide (o1,data,&nearCallback);
      if (dGeomIsSpace (o2)) dSpaceCollide (o2,data,&nearCallback);
    }
    else {
      // colliding two non-space geoms, so generate contact
      // points between o1 and o2
      int num_contact = dCollide (o1,o2,max_contacts,contact_array,skip);
      // add these contact points to the simulation
      ...
    }
  }

  ...

  // collide all objects together
  dSpaceCollide (top_level_space,0,&nearCallback);

 
In the line 
      if (dGeomIsSpace (o1)) dSpaceCollide (o1,data,&nearCallback);
if o1 is a space the function dSpaceCollide will be called and the error :
o1 is not a Space occurrs. it's because o1 is not a Space in this scope. it is a Geom. Ok...can i do this cast:
      if (dGeomIsSpace (o1)) (dxSpace*)dSpaceCollide (o1,data,&nearCallback);



---------------------------------
Desafio AntiZona: participe do jogo de perguntas e respostas que vai dar
 1 Renault Clio, computadores, câmeras digitais, videogames e muito mais!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webserver.computershop.calgary.ab.ca/pipermail/ode/attachments/20030924/cafc382d/attachment.htm


More information about the ODE mailing list