# [−][src]Struct ncollide3d::query::Ray

```pub struct Ray<N: Real> {
pub origin: Point<N>,
pub dir: Vector<N>,
}```

A Ray.

## Fields

Starting point of the ray.

Direction of the ray.

## Methods

### `impl<N: Real> Ray<N>`[src]

#### `pub fn new(origin: Point<N>, dir: Vector<N>) -> Ray<N>`[src]

Creates a new ray starting from `origin` and with the direction `dir`. `dir` must be normalized.

#### `pub fn transform_by(&self, m: &Isometry<N>) -> Self`[src]

Transforms this ray by the given isometry.

#### `pub fn inverse_transform_by(&self, m: &Isometry<N>) -> Self`[src]

Transforms this ray by the inverse of the given isometry.

#### `pub fn translate_by(&self, v: Vector<N>) -> Self`[src]

Translates this ray by the given vector. Its direction is left unchanged.

#### `pub fn point_at(&self, t: N) -> Point<N>`[src]

Computes the point at the given parameter on this line.

This computes `self.origin + self.dir * t`.

## Trait Implementations

### `impl<N: Clone + Real> Clone for Ray<N>`[src]

#### `fn clone_from(&mut self, source: &Self)`1.0.0[src]

Performs copy-assignment from `source`. Read more

## Blanket Implementations

### `impl<T, U> TryFrom for T where    T: From<U>, `[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

### `impl<T, U> TryInto for T where    U: TryFrom<T>, `[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

### `impl<T> Same for T`

#### `type Output = T`

Should always be `Self`