# Class: dgeomray

A ray is different from all the other geom classes in that it does not represent a solid object. It is an infinitely thin line that starts from the geom's position and extends in the direction of the geom's local Z-axis. Calling dCollide between a ray and another geom will result in at most one contact point. Rays have their own conventions for the contact information in the dContactGeom structure (thus it is not useful to create contact joints from this information):

1. pos - This is the point at which the ray intersects the surface of the other geom, regardless of whether the ray starts from inside or outside the geom.
2. normal - This is the surface normal of the other geom at the contact point. if dCollide is passed the ray as its first geom then the normal will be oriented correctly for ray reflection from that surface (otherwise it will have the opposite sign).
3. depth - This is the distance from the start of the ray to the contact point.

Rays are useful for things like visibility testing, determining the path of projectiles or light rays, and for object placement.

## Hierarchy

    o-+ ode
      o-+ dcollider
        o-+ dgeom
          o-+ dgeomray

## Methods:

### Method overview:

- get
- length
- new
- set

new ([float length],[dspace])
  returns: (dgeomray)
  Create a ray geom of the given length, and return its ID. If space is given, insert it into that space.
get (dgeomray)
  returns: (float x,y,z, dx,dy,dz)
  returns position and normalized direction of the ray
length (dgeomray,[float len])
  returns: ([float len])
  sets/gets length of ray
set (dgeomray,float x,y,z, dx,dy,dz)
  returns: ()
  set position and direction of ray in space. The length of the ray will NOT be changed by using this function.

## Inherited Methods:

### From dgeom

body, category, disabledspace, enabledspace, fdirnormal, fdirpriority, getcontactinfo, local2world, matrix, maxcontactinfo, maxcontacts, motion1, motion2, nocontactgenerator, pos, rotaxis, rotdeg, rotquat, rotrad, setcategory, surfaceid, transformer, world2local

### From dcollider

delete, test, testnear, testtriarray