// Tarcza ostrzegawcza świetlna, dwukomorowa - wersja karzełkowa.
// Autorzy: Kudłacz, ZiomalCl

origin (p2) (p3) (p4)
rotate 0 (p5) 0
//model semafora karzełkowego:
node 800 0 (p1) model 0 0 0 0 sem/karzelki/kTo2zp.t3d tabl/(p6) Lights 0 1 endmodel            //glowica
node 200 0 none model 0 0 0 0 sem/slupy/Pod_betonowa.t3d sem/slupy.dds endmodel 


rotate 0 0 0
endorigin


// ZDARZENA ZASADNICZE
event (p1)_os1 multiple 0.0 none (p1)_ligh1 (p1)_sem_distinfo_slow endevent
event (p1)_os2 multiple 0.0 none (p1)_ligh2 (p1)_sem_distinfo_fast endevent
event (p1)_os3 multiple 0.0 none (p1)_ligh3 (p1)_sem_distinfo_v100 endevent
event (p1)_os4 multiple 0.0 none (p1)_ligh4 (p1)_sem_distinfo_v40 endevent

event (p1)_sem_distinfo getvalues 1.0 (p1)_sem_distmem endevent

node -1 0 (p1)_sem_distmem memcell (p2) (p3) (p4) SetProximityVelocity 500.0 0.0 none endmemcell

//zdarzenia okreslajace przyblizona predkosc przy nastepnym semaforze
event (p1)_sem_distinfo_slow updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 0 endevent
event (p1)_sem_distinfo_fast updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 -1 endevent
event (p1)_sem_distinfo_v100 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 100 endevent
event (p1)_sem_distinfo_v40 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity 500 40 endevent

// przelaczanie swiatel
event (p1)_ligh1 lights 0.0 (p1) 0 1 endevent
event (p1)_ligh2 lights 0.0 (p1) 1 0 endevent
event (p1)_ligh3 lights 0.0 (p1) 2 0 endevent
event (p1)_ligh4 lights 0.0 (p1) 0 2 endevent

// uszkodzony semafor - nieoswietlony:
event (p1)_uszk lights 0.0 (p1) 0 0 endevent