//Tarcza ostrzegawcza świetlna, dwukomorowa (sama głowica do bramki).
//Autorzy: Kudłacz, ZiomalCl

origin (p2) (p3) (p4)
rotate 0 (p5) 0

// model tarczy ostrzegawczej:
node 1000 0 (p1) model 0.415 1.2 0 0 sem/glowice/To2YPzp_dd.t3d tabl/(p6) Lights 0 1 endmodel                 //glowica 


// W1 awers
node -1 0 none triangle_strip material ambient: 150.0 150.0 150.0 diffuse: 220.0 220.0 220.0 specular: 154.0 154.0 154.0  endmaterial pkp/wskazniki2.dds
0.4 9.0 0.32 	0.0 0.0 -1.0  0.00269513 0.756031 end
0.4 7.7 0.32 	0.0 0.0 -1.0  0.00269479 0.3411 end
-0.4 9.0 0.32 	0.0 0.0 -1.0  0.180528 0.75603 end
-0.4 7.7 0.32 	0.0 0.0 -1.0  0.182 0.3411 
endtri

// W1 rewers
node -1 0 none triangle_strip material ambient: 150.0 150.0 150.0 diffuse: 220.0 220.0 220.0 specular: 154.0 154.0 154.0  endmaterial pkp/wskazniki2.dds
-0.4 9.0 0.32 	0 0 1.0  0.74 0.75 end
-0.4 7.7 0.32 	0 0 1.0  0.74 0.34 end
0.4 9.0 0.32 	0 0 1.0  0.997 0.75 end
0.4 7.7 0.32 	0 0 1.0  0.997 0.34 
endtri

node -1 0 (p1)_sem_distmem memcell (p7) 0.0 0.0 SetProximityVelocity (p7) 0.0 none endmemcell

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_100 endevent
event (p1)_os4 multiple 0.0 none (p1)_ligh4 (p1)_sem_distinfo_40 endevent

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

//zdarzenia okreslajace przyblizona predkosc przy nastepnym semaforze
event (p1)_sem_distinfo_slow updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity (p7) 0 endevent
event (p1)_sem_distinfo_40 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity (p7) 40 endevent
event (p1)_sem_distinfo_100 updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity (p7) 100 endevent
event (p1)_sem_distinfo_fast updatevalues 0.0 (p1)_sem_distmem SetProximityVelocity (p7) -1 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