Permalink
Browse files

Gets rid of Modeling attributes in RSAGL, which seem useless in retro…

…spect. :)
  • Loading branch information...
Christopher Lane Hinson
Christopher Lane Hinson committed Apr 11, 2011
1 parent e5765e9 commit f18509fbc81cea2039dceb83d14d0070217e2aee
@@ -7,9 +7,9 @@ import RSAGL.Modeling
import Quality
import Models.Materials
-androsynth_head :: Quality -> Modeling ()
+androsynth_head :: Quality -> Modeling
androsynth_head _ = model $
- do model $
+ do model $
do smoothbox 0.2 (Point3D (-2) 0 (-2)) (Point3D (-3) 10 (-5)) -- side panels/"ears"
smoothbox 0.2 (Point3D 2 0 (-2)) (Point3D 3 10 (-5))
smoothbox 0.2 (Point3D (-5) 7 3) (Point3D 5 8 (-8)) -- top panel
@@ -32,16 +32,16 @@ androsynth_head _ = model $
do sphere (Point3D 0 4 2) 0.95
concordance_dark_glass
-androsynth_body :: Quality -> Modeling ()
+androsynth_body :: Quality -> Modeling
androsynth_body _ = model $
do model $
do smoothbox 0.2 (Point3D (-2) 7 (-2.5)) (Point3D 2 8 2.5)
smoothbox 0.2 (Point3D (-3) 0 (-3.5)) (Point3D 3 1 3.5)
openCone (Point3D 0 1 0,1.5) (Point3D 0 7 0,1)
concordance_metal
-androsynth :: Quality -> Modeling ()
-androsynth q = model $
+androsynth :: Quality -> Modeling
+androsynth q = model $
do model $
do androsynth_head q
affine $ translate (Vector3D 0 30 0)
@@ -11,7 +11,7 @@ import Quality
import Models.Materials
import RSAGL.Color.RSAGLColors
-caduceator :: Quality -> Modeling ()
+caduceator :: Quality -> Modeling
caduceator _ = model $
do model $
do tube $ linearInterpolation
@@ -46,7 +46,7 @@ caduceator _ = model $
material $ pigment $ pure black
affine $ scale' (1/20)
-caduceator_arm_upper :: Quality -> Modeling ()
+caduceator_arm_upper :: Quality -> Modeling
caduceator_arm_upper _ = rotate (Vector3D 1 0 0) (fromDegrees 90) $ model $
do model $ sor $ linearInterpolation $
points2d [(0,0),
@@ -56,7 +56,7 @@ caduceator_arm_upper _ = rotate (Vector3D 1 0 0) (fromDegrees 90) $ model $
caduceator_skin
affine $ scale' (1/10)
-caduceator_arm_lower :: Quality -> Modeling ()
+caduceator_arm_lower :: Quality -> Modeling
caduceator_arm_lower _ = rotate (Vector3D 1 0 0) (fromDegrees 90) $ model $
do model $ sor $ linearInterpolation $
points2d [(0,-0.5),
@@ -13,15 +13,15 @@ import RSAGL.Math.CurveExtras
import Quality
import RSAGL.Scene.CoordinateSystems
-cyborg_type_4_dome :: Quality -> Modeling ()
+cyborg_type_4_dome :: Quality -> Modeling
cyborg_type_4_dome q =
do hemisphere (Point3D 0 0 0) (Vector3D 0 1 0) 9
closedDisc (Point3D 0 0 0) (Vector3D 0 (-1) 0) 9.01
affine $ scale $ Vector3D 1 (8/9) 1
material cyborg_metal
qualityToFixed q
-cyborg_type_4_base :: Quality -> Modeling ()
+cyborg_type_4_base :: Quality -> Modeling
cyborg_type_4_base q =
do model $
do openDisc (Point3D 0 0 0) (Vector3D 0 1 0) 0 10.01
@@ -38,19 +38,19 @@ cyborg_type_4_base q =
Point3D 0 (-26)]
material cyborg_metal
-cyborg_type_4_hyperspace_disc :: Quality -> Modeling ()
+cyborg_type_4_hyperspace_disc :: Quality -> Modeling
cyborg_type_4_hyperspace_disc q =
do closedCone (Point3D 0 0 0,10) (Point3D 0 10 0,10)
material cyborg_glow
qualityToFixed q
-cyborg_type_4_hyperspace_rotor :: Quality -> Modeling ()
+cyborg_type_4_hyperspace_rotor :: Quality -> Modeling
cyborg_type_4_hyperspace_rotor _ =
do box (Point3D 15 4 (-0.5)) (Point3D 20 (-6) 0.5)
material cyborg_glow
fixed (3,3)
-cyborg_type_4_hyperspace_stabilizer :: Quality -> Modeling ()
+cyborg_type_4_hyperspace_stabilizer :: Quality -> Modeling
cyborg_type_4_hyperspace_stabilizer q =
do box (Point3D 6 (-9) (-2)) (Point3D 10 (-16) 2)
affine $ transformAbout (Point3D 8 (-16) 0) $ rotate (Vector3D 0 1 0) (fromDegrees 45)
@@ -9,7 +9,7 @@ import RSAGL.Modeling
import RSAGL.Color.RSAGLColors
import Models.Materials
-encephalon_head :: Quality -> Modeling ()
+encephalon_head :: Quality -> Modeling
encephalon_head _ = model $
do sor $ linearInterpolation $
points2d $ reverse
@@ -26,12 +26,12 @@ encephalon_head _ = model $
encephalon_skin
where dfn (Point3D x y z) = Point3D x (min (abs x ** 4 + 7.5) y) z
-encephalon_eye :: Quality -> Modeling ()
+encephalon_eye :: Quality -> Modeling
encephalon_eye _ = model $
do sphere origin_point_3d 0.4
material $ pigment $ pure black
-encephalon_suit :: Quality -> Modeling ()
+encephalon_suit :: Quality -> Modeling
encephalon_suit _ = model $
do sor $ linearInterpolation $
points2d $ reverse
@@ -44,7 +44,7 @@ encephalon_suit _ = model $
(0,0)]
alliance_metal
-encephalon :: Quality -> Modeling ()
+encephalon :: Quality -> Modeling
encephalon q = model $ scale' (1/30) $
do encephalon_head q
encephalon_suit q
@@ -8,7 +8,7 @@ import Models.LibraryData
import Control.Monad
import Models.Materials
-energySword :: EnergyColor -> Integer -> Quality -> Modeling ()
+energySword :: EnergyColor -> Integer -> Quality -> Modeling
energySword energy_color size_count _ = model $
do model $ do closedCone (Point3D 0 (negate $ realToFrac size_count) 0,1.0) (Point3D 0 3 0,1.0)
concordance_metal
@@ -9,7 +9,7 @@ import Data.Monoid
import Models.Materials
import RSAGL.Color.RSAGLColors
-energyCylinder :: (Monoid attr) => EnergyColor -> Quality -> Modeling attr
+energyCylinder :: EnergyColor -> Quality -> Modeling
energyCylinder c _ = model $
do closedCone (Point3D 0 0 0,1.0) (Point3D 0 1 0,1.0)
material $ do pigment $ pure blackbody
@@ -9,14 +9,14 @@ import RSAGL.Color.RSAGLColors
import RSAGL.Math
import Quality
-ascendant_glow :: Quality -> Modeling ()
+ascendant_glow :: Quality -> Modeling
ascendant_glow _ = model $
do closedDisc (Point3D 0 0 0) (Vector3D 0 1 0) 0.5
material $ emissive $ scalarMultiply (1/2) <$> pattern (spherical (Point3D 0 0 0) 0.5 )
[(0.0,pure white),(0.1,pure light_blue),(1.0,pure blackbody)]
affine $ translate (Vector3D 0 0.25 0)
-dust_puff :: Quality -> Modeling ()
+dust_puff :: Quality -> Modeling
dust_puff _ = model $
do let radius = 0.5
hemisphere (Point3D 0 0 0) (Vector3D 0 1 0) radius
@@ -11,12 +11,12 @@ import Models.Materials
import RSAGL.Math.CurveExtras
import RSAGL.Color.RSAGLColors
-hellion :: Quality -> Modeling ()
+hellion :: Quality -> Modeling
hellion _ = model $
do sphere (Point3D 0 0.6 0) 0.1
hellion_skin
-hellion_appendage :: Quality -> Modeling ()
+hellion_appendage :: Quality -> Modeling
hellion_appendage _ = model $ rotate (Vector3D 1 0 0) (fromDegrees 90) $
do sor $ linearInterpolation $
points2d [(0 ,0),
@@ -26,7 +26,7 @@ hellion_appendage _ = model $ rotate (Vector3D 1 0 0) (fromDegrees 90) $
(0.0,1.0)]
hellion_skin
-hellion_eye :: Quality -> Modeling ()
+hellion_eye :: Quality -> Modeling
hellion_eye _ = model $
do model $
do openCone (Point3D 0 0 (-0.1),0) (Point3D 0 0 0.1, 0.1)
@@ -42,7 +42,7 @@ import Models.Stargate
-- |
-- Get the modeling data for a named library model.
--
-toModel :: LibraryModel -> Quality -> Modeling ()
+toModel :: LibraryModel -> Quality -> Modeling
toModel (TerrainTile s) = terrainTile s
toModel (SimpleModel LeafyBlob) = const $ leafy_blob
toModel (SimpleModel TreeBranch) = const $ tree_branch
@@ -10,7 +10,7 @@ import RSAGL.Math.CurveExtras
import RSAGL.Math
import Models.Materials
-machine_arm_lower :: Quality -> Modeling ()
+machine_arm_lower :: Quality -> Modeling
machine_arm_lower _ = scale' (1/4) $ rotate (Vector3D 1 0 0) (fromDegrees 90) $ model $
do sor $ linearInterpolation $ reverse $
points2d [(0.0,4.5),
@@ -21,7 +21,7 @@ machine_arm_lower _ = scale' (1/4) $ rotate (Vector3D 1 0 0) (fromDegrees 90) $
(0.0,0.3)]
alliance_metal
-machine_arm_upper :: Quality -> Modeling ()
+machine_arm_upper :: Quality -> Modeling
machine_arm_upper _ = scale' (1/4) $ rotate (Vector3D 1 0 0) (fromDegrees 90) $ model $
do sor $ linearInterpolation $ reverse $
points2d [(0.0,4.5),
@@ -32,7 +32,7 @@ machine_arm_upper _ = scale' (1/4) $ rotate (Vector3D 1 0 0) (fromDegrees 90) $
(0.0,-0.5)]
alliance_metal
-thin_limb :: Quality -> Modeling ()
+thin_limb :: Quality -> Modeling
thin_limb _ =
do openCone (Point3D 0 0 0,0.05) (Point3D 0 0 1,0.05)
sphere (Point3D 0 0 0) 0.05
@@ -34,40 +34,40 @@ import Models.LibraryData
-- Treaty Organization Materials (cyan-teal solid colors, yellow energy colors)
-treaty_metal :: MaterialM attr ()
+treaty_metal :: MaterialM ()
treaty_metal = material $
do pigment $ pure turquoise
specular 1 $ pure $ teal
-treaty_glow :: MaterialM attr ()
+treaty_glow :: MaterialM ()
treaty_glow = material $
do pigment $ pure black
emissive $ pure mustard
-treaty_energy_field :: MaterialM attr ()
+treaty_energy_field :: MaterialM ()
treaty_energy_field = material $
do emissive $ pure mustard
-- Alliance Materials (yellow-gold solid colors, orange energy colors)
-alliance_metal :: Modeling ()
+alliance_metal :: Modeling
alliance_metal = material $
do pigment $ pure $ scalarMultiply 0.6 yellow
specular 7 $ pure yellow
-- Concordance Materials (violet solid colors, blue energy colors)
-concordance_metal :: Modeling ()
+concordance_metal :: Modeling
concordance_metal = material $
do pigment $ pure mauve
specular 4 $ pure lilac
-concordance_dark_glass :: Modeling ()
+concordance_dark_glass :: Modeling
concordance_dark_glass = material $
do pigment $ pure black
specular 8 $ pure royal_blue
-concordance_bright_glass :: Modeling ()
+concordance_bright_glass :: Modeling
concordance_bright_glass = material $
do pigment $ pure black
emissive $ pure royal_blue
@@ -83,10 +83,10 @@ concordance_bright_glass = material $
-- Cyborg Materials (white solid colors, green energy colors)
-cyborg_metal :: MaterialM attr ()
+cyborg_metal :: MaterialM ()
cyborg_metal = metallic $ pure beige
-cyborg_glow :: MaterialM attr ()
+cyborg_glow :: MaterialM ()
cyborg_glow =
do pigment $ pure blackbody
emissive $ pure $ scalarMultiply 1.0 pale_green
@@ -97,7 +97,7 @@ cyborg_glow =
-- Caduceator Skins
-caduceator_skin :: Modeling ()
+caduceator_skin :: Modeling
caduceator_skin = material $ pigment $ pattern (cloudy 75 0.01) [(0.0,pure red),(0.5,pure orange),(1.0,pure black)]
-- Reptilian Skins
@@ -108,21 +108,21 @@ reptilian_pigment = pattern (cloudy 75 0.1) [(0.0,pure lavender),(1.0,pure periw
reptilian_specular :: ColorFunction RGB
reptilian_specular = pattern (cloudy 75 0.1) [(0.0,pure red),(1.0,pure mustard)]
-reptilian_skin :: Modeling ()
+reptilian_skin :: Modeling
reptilian_skin = material $
do pigment $ reptilian_pigment
specular 5.0 $ reptilian_specular
-- Hellion Skin
-hellion_skin :: Modeling ()
+hellion_skin :: Modeling
hellion_skin = material $
do pigment $ pattern (cloudy 75 0.1) [(0.0,pure sea_green),(1.0,pure lime)]
specular 5.0 $ scalarMultiply (1/5) pure white
-- Encephalon Skins
-encephalon_skin :: Modeling ()
+encephalon_skin :: Modeling
encephalon_skin = material $ pigment $ pattern (cloudy 32 0.1) [(0.0,pure mauve),(1.0,pure salmon)]
{--------------------------------------------------------
@@ -135,7 +135,7 @@ energyColor Yellow = yellow
energyColor Red = red
energyColor Green = bright_green
-energyMaterial :: EnergyColor -> Modeling ()
+energyMaterial :: EnergyColor -> Modeling
energyMaterial c = material $
do pigment $ pure $ scalarMultiply 0.33 $ energyColor c
specular 1.0 $ pure $ scalarMultiply 0.33 $ energyColor c
@@ -10,19 +10,19 @@ import RSAGL.Color
import RSAGL.Color.RSAGLColors
import Quality
-monolith :: Quality -> Modeling ()
+monolith :: Quality -> Modeling
monolith _ = model $
do box (Point3D (-1/2) 0 (-1/8)) (Point3D (1/2) (9/4) (1/8))
material $
do pigment $ pure blackbody
specular 100 $ pure white
-planetary_anchor_core :: Quality -> Modeling ()
+planetary_anchor_core :: Quality -> Modeling
planetary_anchor_core _ = model $
do sphere (Point3D 0 0 0) 0.05
material $ emissive $ pure $ grayscale 0.75
-planetary_anchor_flange :: Quality -> Modeling ()
+planetary_anchor_flange :: Quality -> Modeling
planetary_anchor_flange _ = model $
do openDisc (Point3D 0 0 0)
(Vector3D 0 1 0)
@@ -12,7 +12,7 @@ import RSAGL.Math.CurveExtras
import Control.Monad
-- | A phase weapon emitter. Includes a specification of a phase guide length.
-phaseWeaponEmitter :: Integer -> Quality -> Modeling ()
+phaseWeaponEmitter :: Integer -> Quality -> Modeling
phaseWeaponEmitter guide_length _ = model $
do sor $ linearInterpolation $
points2d $ reverse
@@ -37,7 +37,7 @@ phaseWeaponEmitter guide_length _ = model $
where dfn_squish p@(Point3D _ _ z) | z > 0 = scale (Vector3D 1 1 0.1) p -- bottom of emitter is flattened
dfn_squish p = scale (Vector3D 1 1 0.25) p -- top of emitter is more round
-phase_weapon_grip :: Quality -> Modeling ()
+phase_weapon_grip :: Quality -> Modeling
phase_weapon_grip _ = model $
do sor $ linearInterpolation $
points2d $ reverse
@@ -57,18 +57,18 @@ phase_weapon_grip _ = model $
dfn_slope_backwards pt@(Point3D _ y _) = translate (Vector3D 0 0 (-y/3)) pt
dfn = dfn_slope_backwards . dfn_flat_back . dfn_flat_sides . dfn_gripped_front
-phaseWeapon :: Integer -> Quality -> Modeling ()
+phaseWeapon :: Integer -> Quality -> Modeling
phaseWeapon guide_length q = model $
scale' (1/100) $
do translate (Vector3D 0 5 7) $ phaseWeaponEmitter guide_length q
translate (Vector3D 0 5 0) $ phase_weapon_grip q
concordance_metal
-phase_pistol :: Quality -> Modeling ()
+phase_pistol :: Quality -> Modeling
phase_pistol = phaseWeapon 0
-phaser :: Quality -> Modeling ()
+phaser :: Quality -> Modeling
phaser = phaseWeapon 1
-phase_rifle :: Quality -> Modeling ()
+phase_rifle :: Quality -> Modeling
phase_rifle = phaseWeapon 2
Oops, something went wrong.

0 comments on commit f18509f

Please sign in to comment.