set baseDir ski
set scenarioDir $baseDir/camelSnowman
set ::scenarioDir $scenarioDir

#----------------------------------------------------------------------
# ground setup
#----------------------------------------------------------------------

gndfile $scenarioDir/gnd.pts
loadtexobj $scenarioDir/gnd.tess $scenarioDir/gnd.jpg
loadtexobjtxfm $scenarioDir/gnd.txfm

gnd kp 2000
gnd kd 200
gnd cf 0.6

gnd slices 30

< $::charDir/common.setup

set ::restLocX -1.5 
set ::restLocY 0.9

texload brick ../artwork/moraine128_blur.ppm repeat

locMap load $scenarioDir/loc.map
source $scenarioDir/stuntEval.tcl

title "$::charName >>  camel + snowman"

#----------------------------------------------------------------------
# snowman
#----------------------------------------------------------------------

< props/newBigBall.setup
artfig setname snowmanBody1
restpose 42.418594 -7.235142
artfig anchored true

< props/newSnowmanHead.setup
artfig setname snowmanHead1
restpose 42.725929 -5.821108 -4.168249
artfig anchored true
usemonitor forceTrigger 1 0 1000 1 breakSnowman "reset" "trig"
artfig type Snowman

proc breakSnowman { arg } {
  set cmd $arg

  if {$cmd == "reset"} {
    world setaf snowmanHead1
    artfig anchored true
  } elseif {$cmd == "trig"} {
    world setaf snowmanHead1
    artfig anchored false
  }
}

proc resetActiveObj {} {
    world setaf snowmanHead1
    restpose 42.725929 -5.821108 -4.168249
    artfig anchored true
}

#----------------------------------------------------------------------

proc autoscroll {} {
    camera fps 60
    camera speed 7
    camera fly $::scenarioDir/camera.path
}

if [preview] {
    accumZoom 0
    zoom -4
    winview 23 -5
}
