Action:
|
Creates a ray given a base position and gvector.
|
|
Filename:
|
kern/kern_scm/ray_scm.cxx
|
|
Syntax:
|
(ray position gvector)
|
|
Arg Types:
|
gvector
|
gvector
|
|
position
|
position
|
|
Returns:
|
ray
|
|
Description:
|
A ray is not visible. An important usage for a ray is to pierce a body or object for selection purposes.
|
|
|
gvector specifies the direction of the ray.
|
|
|
position specifies the starting position.
|
|
Example:
|
; ray
|
|
; Create ray1 from a position and a gvector.
|
|
(define ray1
|
|
|
(ray (position 0 0 0) (gvector 0 1 0)))
|
|
;; ray1
|
|
; Create ray2 from a position and a gvector.
|
|
(ray (position 78 5 12) (gvector 0 0 1))
|
|
;; #[ray (78 5 12) (0 0 1)]
|
|
; Do something useful with ray.
|
|
; Create a block.
|
|
(define block1
|
|
|
(solid:block (position -10 -5 -15)
|
|
|
(position 25 25 25)))
|
|
;; block1
|
|
; Remember the face.
|
|
(define face1 (pick:face ray1))
|
|
;; face1
|
|
; Highlight the face crossed by the ray.
|
|
(entity:set-highlight face1 #t)
|
|
;; #[entity 3 1]
|