rtgs.ray

Module Contents

Classes

Ray

A ray representation.

Functions

new_ray

Python scope ray constructor to create a new Ray.

API

class rtgs.ray.Ray

A ray representation.

Parameters:
  • origin – the origin of the ray.

  • direction – the ray direction.

  • start – the minimum t for raycast.

  • end – the maximun t for raycast, this should be set to ti.math.inf for camera rays.

origin: taichi.math.vec3 = None
direction: taichi.math.vec3 = None
start: taichi.f32 = None
end: taichi.f32 = None
init(origin=ti.math.vec3(0, 0, 0), direction=ti.math.vec3(0, 1, 0), start=0, end=ti.math.inf)

Taichi scope Ray initialization function.

Parameters:
  • origin (ti.math.vec3) – the origin of the ray.

  • direction (ti.math.vec3) – the ray direction.

  • start (ti.f32) – the minimum t for raycast.

  • end (ti.f32) – the maximun t for raycast, this should be set to ti.math.inf for camera rays.

get(t)

Evaluate ray position parameterized at time t.

Parameters:

t (ti.f32) – ray parameter t.

Returns:

ray position at time t.

Return type:

ti.math.vec3

rtgs.ray.new_ray(origin: taichi.math.vec3 = ti.math.vec3(0, 0, 0), direction: taichi.math.vec3 = ti.math.vec3(0, 1, 0), start: taichi.f32 = 0, end: taichi.f32 = ti.math.inf) rtgs.ray.Ray

Python scope ray constructor to create a new Ray.

Parameters:
  • origin – the origin of the ray.

  • direction – the ray direction.

  • start – the minimum t for raycast.

  • end – the maximun t for raycast, this should be set to ti.math.inf for camera rays.

Returns:

a Taichi ray dataclass.