[ODE] Ray as Sensor (Please help)

Megan Fox shalinor at gmail.com
Mon May 30 09:18:51 MST 2005


Unless you have modified your collision callback to ignore rays, they
can and will still collide.  You've got to make collisions involving
rays make sure to not generate contacts, if you want rays as sensors.

-Megan Fox

On 5/30/05, Eugen Lofing <lofing at gmx.net> wrote:
> Hello!
> 
> I tried to implement a sensor using ODE-ray - it tries to affect the
> objects, that are near to it.
> 
> It throws away them (the objects) ;-)
> 
> somebody know, how I can disable this affecting?
> 
> Code:
> 
> // create a ray
> dGeomRaySet(m_raygeom, pos->x, pos->y, pos->z, dir->x, dir->y, dir->z);
> // fire it
> dSpaceCollide2(m_raygeom, (dGeomID)IPhEngine::m_theSpace, this,
> &raySensorCallback);
> 
> // and its callback:
> void raySensorCallback(void* data, dGeomID o1, dGeomID o2) {
>   if (o1 == o2) return;
> 
>   dContactGeom contactArray[1];
>   int numContacts = dCollide(o1, o2, 1, contactArray,
> sizeof(dContactGeom));
> 
>   if (0 == numContacts) {   return;   }
>   else {
>      RaySensor * r = (RaySensor *)data;
>      r->m_collided = true;
>      r->m_distance = contactArray[0].depth;
>   }
> 
> 
> }
> 
> I mean a sensor should just get an information, not trying push them
> 
> ... and do somebody know, what the parameters do:
> 
> 
> void dGeomRaySet (dGeomID ray, dReal px, dReal py, dReal pz,
>      dReal dx, dReal dy, dReal dz);
>            ^^        ^^        ^^
> 
> Quote: "...direction (dx,dy,dz) of the given ray. The ray's rotation matrix
> will be adjusted so that the local Z-axis is aligned with the direction."
> 
> - I don't understand, what it does mean. Are the parameters (dx,dy,dz)
> really a Rotation-matrix or a 2-nd. point? Because the ray does not
> seem to exist if I set this params to (0,0,0) -> Z-axis-direction ...
> 
> Please help me somebody. Thank u.
> 
> 
> --
> 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
> +++ GMX - die erste Adresse für Mail, Message, More +++
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list