# Ray

class `cee.``Ray`()

  A 3d ray used, for example, for picking on the 3D model.

Constructors

- `constructor`

Accessors

- `direction`
- `origin`

Methods

- `clone`
- `planeIntersect`
- `pointDistanceSquared`
- `transform`

## Constructors

`Ray.``constructor`(origin, direction)

  Arguments: | origin (`Vec3Like`) – None direction (`Vec3Like`) – None

  Creates a Ray object

  Return type: | Ray

## Accessors

`Ray.``direction`()

  The direction vector of the ray in world coordinates.

  Return type: | Vec3Like

`Ray.``direction`(direction)

  Arguments: | direction (`Vec3Like`) – None
  Return type: | void

`Ray.``origin`()

  The origin of the ray in world coordinates.

  Return type: | Vec3Like

`Ray.``origin`(origin)

  Arguments: | origin (`Vec3Like`) – None
  Return type: | void

## Methods

### clone

`Ray.``clone`()

  Returns a clone of the ray.

  Return type: | Ray

### planeIntersect

`Ray.``planeIntersect`(plane)

  Arguments: | plane (`Plane`) – None

  Returns the intersection point of this ray with the given plane, or null if no intersection.

  Return type: | Vec3Like

### pointDistanceSquared

`Ray.``pointDistanceSquared`(point)

  Arguments: | point (`Vec3Like`) – None

  Returns the squared distance from the point to the ray

  Return type: | number

### transform

`Ray.``transform`(matrix)

  Arguments: | matrix (`Mat4`) – None

  Transforms the ray with the given matrix.

  The origin will be transformed as a point, and the direction as a vector.

  Return type: | void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Web or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...