-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdeftypes.lisp
More file actions
71 lines (60 loc) · 2.01 KB
/
deftypes.lisp
File metadata and controls
71 lines (60 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
(in-package :rtg-math.types)
(deftype vec2 ()
'(simple-array single-float (2)))
(deftype vec3 ()
'(simple-array single-float (3)))
(deftype vec4 ()
'(simple-array single-float (4)))
(deftype ivec2 ()
'(simple-array (signed-byte 32) (2)))
(deftype ivec3 ()
'(simple-array (signed-byte 32) (3)))
(deftype ivec4 ()
'(simple-array (signed-byte 32) (4)))
(deftype uvec2 ()
'(simple-array (unsigned-byte 32) (2)))
(deftype uvec3 ()
'(simple-array (unsigned-byte 32) (3)))
(deftype uvec4 ()
'(simple-array (unsigned-byte 32) (4)))
(deftype int8-vec2 ()
'(simple-array (signed-byte 8) (2)))
(deftype int8-vec3 ()
'(simple-array (signed-byte 8) (3)))
(deftype int8-vec4 ()
'(simple-array (signed-byte 8) (4)))
(deftype uint8-vec2 ()
'(simple-array (unsigned-byte 8) (2)))
(deftype uint8-vec3 ()
'(simple-array (unsigned-byte 8) (3)))
(deftype uint8-vec4 ()
'(simple-array (unsigned-byte 8) (4)))
(deftype mat2 ()
'(simple-array single-float (4)))
(deftype mat3 ()
'(simple-array single-float (9)))
(deftype mat4 ()
'(simple-array single-float (16)))
(deftype quaternion ()
'(simple-array single-float (4)))
(defstruct line3
(origin (make-array 3 :element-type 'single-float :initial-element 0f0)
:type vec3)
(direction (make-array 3 :element-type 'single-float :initial-element 1f0)
:type vec3))
(defstruct ray3
(origin (make-array 3 :element-type 'single-float :initial-element 0f0)
:type vec3)
(direction (make-array 3 :element-type 'single-float :initial-element 1f0)
:type vec3))
(defstruct line-segment3
(end-point0 (make-array 3 :element-type 'single-float :initial-element 0f0)
:type vec3)
(offset (make-array 3 :element-type 'single-float
:initial-contents '(0f0 1f0 0f0))
:type vec3))
(defstruct axis-aligned-box
(minima (make-array 3 :element-type 'single-float :initial-element -1f0)
:type vec3)
(maxima (make-array 3 :element-type 'single-float :initial-element 1f0)
:type vec3))