[ODE] Ray as Sensor (Please help)
Pablo Barbáchano
pablobarbachano at yahoo.es
Mon May 30 18:26:50 MST 2005
--- Megan Fox <shalinor at gmail.com> escribió:
> 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.
> >
AFAIK, (dx,dy,dz) specifies the direction vector, so the end point of your
ray would be:
(px,py,pz) + (dx,dy,dz) * length
(supposing (dx,dy,dz) is a unit vector)
(0,0,0) happens to have no direction at all (correct me).
z-axis-direction would be (0,0,1)
> >
> > --
> > 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
> >
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
______________________________________________
Renovamos el Correo Yahoo!
1GB de capacidad, nuevos servicios y más seguridad
http://correo.yahoo.es
More information about the ODE
mailing list