Handbook
Glossary
raytrace-world
Vocabulary
gpu
.
demos
.
raytrace
Definition
USING:
gpu.util.wasd
;
IN:
gpu.demos.raytrace
TUPLE:
raytrace-world
<
wasd-world
fov spheres vertex-array
;
Methods
USING:
accessors
game.worlds
gpu
gpu.demos.raytrace
gpu.shaders
gpu.util
gpu.util.wasd
kernel
sequences
;
M:
raytrace-world
begin-game-world
init-gpu
{
-2.0 6.25 10.0
}
0.19 0.55
set-wasd-view
initial-spheres
[
clone
]
map
>>spheres
raytrace-program
<program-instance>
<window-vertex-array>
>>vertex-array
set-up-audio
;
USING:
accessors
gpu.demos.raytrace
gpu.render
kernel
ui.gadgets.worlds
;
M:
raytrace-world
draw-world*
{
{
"primitive-mode"
[
drop
triangle-strip-mode
]
}
{
"indexes"
[
drop
T{
index-range
{
count 4
}
}
]
}
{
"uniforms"
[
<sphere-uniforms>
]
}
{
"vertex-array"
[
vertex-array>>
]
}
}
<render-set>
render
;
USING:
accessors
generic
gpu.demos.raytrace
kernel
math
math.order
math.vectors
sequences
ui.gadgets.worlds
;
M:
raytrace-world
resize-world
[
M\
raytrace-world
resize-world
(call-next-method)
]
[
dup
dim>>
dup
first2
min
>float
v/n
fov
v*n
>>fov
drop
]
bi
;
USING:
accessors
game.worlds
generic
gpu.demos.raytrace
kernel
sequences
;
M:
raytrace-world
tick-game-world
[
M\
raytrace-world
tick-game-world
(call-next-method)
]
[
spheres>>
[
tick-sphere
]
each
]
bi
;
USING:
gpu.demos.raytrace
gpu.util.wasd
kernel
;
M:
raytrace-world
wasd-movement-speed
drop
0.25
;