summaryrefslogtreecommitdiffstats
path: root/solid.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:40 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:40 -0800
commit4684239efa63dc1b2c1cbe37ef7d3062029f5532 (patch)
tree606a687e9279e9bf6048925878968df9875a4973 /solid.scm
parent64f037d91e0c9296dcaef9a0ff3eb33b19a2ed34 (diff)
downloadslib-4684239efa63dc1b2c1cbe37ef7d3062029f5532.tar.gz
slib-4684239efa63dc1b2c1cbe37ef7d3062029f5532.zip
Import Upstream version 3b1upstream/3b1
Diffstat (limited to 'solid.scm')
-rw-r--r--solid.scm37
1 files changed, 25 insertions, 12 deletions
diff --git a/solid.scm b/solid.scm
index 8f99d83..990fa3d 100644
--- a/solid.scm
+++ b/solid.scm
@@ -487,15 +487,25 @@
(define nargs (length args))
(let ((color (and (>= nargs 1) (color->vrml-field (car args))))
(intensity (and (>= nargs 2) (cadr args)))
- (attenuation (and (>= nargs 3) (cadr (caddr args))))
- (radius (and (>= nargs 3) (caddr (caddr args)))))
+ (beamwidth (and (>= nargs 3) (car (caddr args))))
+ (cutoffangle (and (>= nargs 3) (cadr (caddr args))))
+ (attenuation (and (>= nargs 3) (caddr (caddr args))))
+ (radius (and (>= nargs 3) (cadddr (caddr args)))))
(replicate-for-strength
(or intensity 1)
(lambda (inten)
(sprintf #f
- "PointLight {location %s color %s intensity %g attenuation %s radius %g}\\n"
+ "PointLight {location %s color %s intensity %g%s}\\n"
(coordinates3string location)
- color intensity attenuation radius)))))
+ color
+ inten
+ (if attenuation
+ (sprintf #f
+ "\\n
+ attenuation %s radius %g"
+ attenuation
+ radius)
+ ""))))))
;;@args location direction color intensity beam
;;@args location direction color intensity
@@ -535,17 +545,20 @@
(or intensity 1)
(lambda (inten)
(sprintf #f
- "SpotLight {\\n
- location %s direction %s beamWidth %g cutOffAngle %g\\n
- color %s intensity %s attenuation %s radius %g}\\n"
+ "SpotLight {location %s direction %s color %s intensity %g%s}\\n"
(coordinates3string location)
direction
color
- intensity
- (and beamwidth (* pi/180 beamwidth))
- (and cutoffangle (* pi/180 cutoffangle))
- attenuation
- radius)))))
+ inten
+ (if beamwidth
+ (sprintf #f
+ "\\n
+ beamWidth %g cutOffAngle %g attenuation %s radius %g"
+ (* pi/180 beamwidth)
+ (* pi/180 cutoffangle)
+ attenuation
+ radius)
+ ""))))))
;;@subheading Object Primitives