// tarcza ostrzegawcza swietlna odchylona: (p6) symbol tarczy (np. ToA)

origin (p2) (p3) (p4)
rotate 0 (p5) 0
// model tarczy ostrzegawczej:
node -1 0 (p1) model 0.45 0.17 0 0 PKP/head2-gy-sbl.t3d (p6) Lights 1 0  endmodel              //glowica przesunieta w lewo
node -1 0 none model 0 0 0 0 PKP/post-YN-h2.t3d PKP/pkplight_warnpost.tga endmodel          //slup+drabinka

node 800 50 none lines 80 80 80 100.0                                          //szara linia zeby byl maszt widoczny z daleka
0.0 0.0 0.0	0.0 4 0.0 
endline

// W18
// awers
node 200 0 none triangle_strip material ambient: 80.0 80.0 80.0 diffuse: 210.0 205.0 200.0 specular: 220.0 220.0 220.0  endmaterial PKP/wskazniki2.BMP
-0.134063 2.75265 0.083136 	0.0 0.0 1.0  0.657005 0.350242 end
-0.134063 2.45265 0.083136 	0.0 0.0 1.0  0.657005 0.00724638 end
0.165937 2.75265 0.083136 	0.0 0.0 1.0  0.995169 0.350242 end
0.165937 2.45265 0.083136 	0.0 0.0 1.0  0.995169 0.00724638 
endtri

// rewers
node 100 0 none triangle_strip material ambient: 80.0 80.0 80.0 diffuse: 210.0 205.0 200.0 specular: 220.0 220.0 220.0  endmaterial PKP/wskazniki2.BMP
0.165937 2.75265 0.083136 	0.0 0.0 -1.0  0.987923 0.350242 end
0.165937 2.45265 0.083136 	0.0 0.0 -1.0  0.987923 0.00724638 end
-0.134063 2.75265 0.083136 	0.0 0.0 -1.0  0.995169 0.350242 end
-0.134063 2.45265 0.083136 	0.0 0.0 -1.0  0.995169 0.00724638 
endtri


endorigin

node -1 0 (p1)_sem_mem memcell (p2) (p3) (p4) SetVelocity -1 0  none endmemcell

//zdarzenia okreslajace predkosc przy tym semaforze
event (p1)_sem_info_stop updatevalues 10.0 (p1)_sem_mem SetVelocity 0.0 0 endevent
event (p1)_sem_info_vmax updatevalues 1.0 (p1)_sem_mem SetVelocity -1 -1 endevent
event (p1)_sem_info_nextstop updatevalues 1.0 (p1)_sem_mem SetVelocity -1 0 endevent

event (p1)_s1 multiple 1 (p1)_sem_mem (p1)_sem_ligh1 (p1)_sem_info_stop (p7)_s5 condition memcompare * -1 * endevent
event (p1)_sem_ligh1 lights 0.0 (p1) 0 1 0 endevent

event (p1)_os1 multiple 1 none (p1)_sem_ligh1o (p1)_sem_info_nextstop (p7)_s2 endevent
event (p1)_sem_ligh1o lights 0.0 (p1) 0 1 endevent

//ponizsze zdarzenia os2...os4 wyzwalane sa tylko gdy nie bylo S1:

event (p1)_os4 multiple 1 (p1)_sem_mem (p1)_sem_ligh4o (p1)_sem_info_nextstop (p7)_s2 condition memcompare * -1 * endevent
event (p1)_sem_ligh4o lights 0.0 (p1) 0 2 endevent


//odczyt z pamieci (zdarzenie przypisane do toru przy semaforze):
event (p1)_sem_info getvalues 5.0 (p1)_sem_mem endevent



