diff --git a/platform/test_maps.pk3dir/maps/test_monitor.bsp b/platform/test_maps.pk3dir/maps/test_monitor.bsp new file mode 100644 index 00000000..b0811906 Binary files /dev/null and b/platform/test_maps.pk3dir/maps/test_monitor.bsp differ diff --git a/platform/test_maps.pk3dir/maps/test_monitor.map b/platform/test_maps.pk3dir/maps/test_monitor.map new file mode 100644 index 00000000..70c10504 --- /dev/null +++ b/platform/test_maps.pk3dir/maps/test_monitor.map @@ -0,0 +1,251 @@ + +// entity 0 +{ +"classname" "worldspawn" +// brush 0 +{ +( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 1 +{ +( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 2 +{ +( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 3 +{ +( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 4 +{ +( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 5 +{ +( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 272 -320 256 ) ( 272 -320 264 ) ( 784 -320 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -56 -104 128 ) ( 80 -472 128 ) ( 80 -104 128 ) measure/wall64a [ 1 0 0 48 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +} +// brush 6 +{ +( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 272 -320 256 ) ( 272 -320 264 ) ( 784 -320 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( 80 -104 128 ) ( 80 -472 128 ) ( -56 -104 128 ) NULL [ 1 0 0 48 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -72 -472 -128 ) ( 64 -472 -128 ) ( -72 -104 -128 ) NULL [ 1 0 0 16 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( 320 -464 192 ) ( 320 -96 -128 ) ( 320 -464 -128 ) measure/wall64a [ 0 1 0 112 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 7 +{ +( -776 704 -64 ) ( -776 320 -64 ) ( -1288 704 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -768 704 8 ) ( -1280 704 8 ) ( -768 704 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 704 8 ) ( -768 704 0 ) ( -768 320 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 -128 ) ( -768 320 -128 ) ( -1280 704 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 0 ) ( -1280 320 8 ) ( -768 320 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 0 ) ( -1280 704 0 ) ( -1280 320 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 8 +{ +( -776 704 192 ) ( -776 320 192 ) ( -1288 704 192 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -768 704 264 ) ( -1280 704 264 ) ( -768 704 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 704 264 ) ( -768 704 256 ) ( -768 320 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 128 ) ( -768 320 128 ) ( -1280 704 128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 256 ) ( -1280 320 264 ) ( -768 320 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1280 320 256 ) ( -1280 704 256 ) ( -1280 320 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 9 +{ +( -840 704 192 ) ( -840 320 192 ) ( -1352 704 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -832 704 264 ) ( -1344 704 264 ) ( -832 704 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1280 704 8 ) ( -1280 704 0 ) ( -1280 320 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1792 320 -128 ) ( -1280 320 -128 ) ( -1792 704 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1344 320 256 ) ( -1344 320 264 ) ( -832 320 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1344 320 256 ) ( -1344 704 256 ) ( -1344 320 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 10 +{ +( -264 704 192 ) ( -264 320 192 ) ( -776 704 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -256 704 264 ) ( -768 704 264 ) ( -256 704 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -704 704 8 ) ( -704 704 0 ) ( -704 320 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1216 320 -128 ) ( -704 320 -128 ) ( -1216 704 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -768 320 256 ) ( -768 320 264 ) ( -256 320 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -768 320 256 ) ( -768 704 256 ) ( -768 320 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 11 +{ +( -840 768 192 ) ( -840 384 192 ) ( -1352 768 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -832 768 264 ) ( -1344 768 264 ) ( -832 768 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -704 1056 8 ) ( -704 1056 0 ) ( -704 672 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1792 384 -128 ) ( -1280 384 -128 ) ( -1792 768 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -752 704 256 ) ( -752 704 264 ) ( -240 704 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1344 384 256 ) ( -1344 768 256 ) ( -1344 384 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 12 +{ +( -832 320 264 ) ( -1344 320 264 ) ( -832 320 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -752 192 256 ) ( -752 192 264 ) ( -240 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1344 -64 256 ) ( -1344 320 256 ) ( -1344 -64 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -944 408 128 ) ( -944 40 128 ) ( -1080 408 128 ) NULL [ 1 0 0 48 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1096 40 -128 ) ( -960 40 -128 ) ( -1096 408 -128 ) NULL [ 1 0 0 16 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -704 48 192 ) ( -704 416 -128 ) ( -704 48 -128 ) measure/wall64a [ 0 1 0 112 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +// brush 13 +{ +( -1096 520 -24 ) ( -1096 504 -24 ) ( -1112 520 -24 ) measure/desk [ -0.0000000437 1 0 127.9999847412 ] [ 1 0.0000000437 0 24.0000305176 ] -90 0.5 0.4999999702 0 0 0 +( -1128 576 -56 ) ( -1144 576 -56 ) ( -1128 576 -64 ) measure/counter [ 1 0 0 32 ] [ -0 -0 -1 32 ] -0 0.5 0.4999999702 0 0 0 +( -1120 504 -56 ) ( -1120 504 -64 ) ( -1120 488 -56 ) measure/counter [ 0 1 0 32 ] [ -0 -0 -1 32 ] -0 0.5 0.4999999702 0 0 0 +( -1120 504 -64 ) ( -1104 504 -64 ) ( -1120 520 -64 ) measure/counter [ 1 0 0 32 ] [ -0 -1 -0 32 ] -0 0.5 0.4999999702 0 0 0 +( -1136 448 -64 ) ( -1136 448 -56 ) ( -1120 448 -64 ) measure/counter [ 1 0 0 32 ] [ -0 -0 -1 32 ] -0 0.5 0.4999999702 0 0 0 +( -1152 464 -64 ) ( -1152 480 -64 ) ( -1152 464 -56 ) measure/counter [ 0 1 0 32 ] [ -0 -0 -1 32 ] -0 0.5 0.4999999702 0 0 0 +} +} +// entity 1 +{ +"classname" "dynamic_light" +"origin" "192.000000 128.000000 64.000000" +"targetname" "foobar1" +"style" "1" +"_light" "255 255 255" +"brightness" "250" +"ignorepvs" "1" +} +// entity 2 +{ +"classname" "dynamic_light" +"origin" "192.000000 -128.000000 64.000000" +"targetname" "foobar2" +"style" "2" +"_light" "255 0 0" +"brightness" "250" +"ignorepvs" "1" +} +// entity 3 +{ +"classname" "prop_dynamic" +"origin" "160.000000 0.000000 0.000000" +"model" "models/logos/visions.vvm" +"angles" "0 -90 0" +"avelocity" "0 90 0" +"shadows" "1" +"ignorepvs" "1" +} +// entity 4 +{ +"classname" "point_camera" +"origin" "0.000000 0.000000 0.000000" +"targetname" "my_camera" +"FOV" "60" +} +// entity 5 +{ +"classname" "light" +"origin" "-1024.000000 512.000000 64.000000" +"light" "300" +} +// entity 6 +{ +"classname" "info_player_start" +"origin" "-1024.000000 512.000000 -16.000000" +} +// entity 7 +{ +"classname" "info_player_deathmatch" +"origin" "-1024.000000 512.000000 -16.000000" +} +// entity 8 +{ +"classname" "func_button" +"target" "monitor_one" +// brush 0 +{ +( -1128 520 -16 ) ( -1128 504 -16 ) ( -1144 520 -16 ) measure/wall64a [ 1 0 0 96 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1128 520 -16 ) ( -1144 520 -16 ) ( -1128 520 -56 ) measure/wall64a [ 1 0 0 96 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1128 520 -16 ) ( -1128 520 -56 ) ( -1128 504 -16 ) measure/wall64a [ 0 1 0 48 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1144 504 -24 ) ( -1128 504 -24 ) ( -1144 520 -24 ) measure/wall64a [ 1 0 0 96 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -1144 504 -56 ) ( -1144 504 -16 ) ( -1128 504 -56 ) measure/wall64a [ 1 0 0 96 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -1144 504 -56 ) ( -1144 520 -56 ) ( -1144 504 -16 ) measure/wall64a [ 0 1 0 48 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +} +} +// entity 9 +{ +"classname" "func_monitor" +"targetname" "monitor_one" +"target" "my_camera" +// brush 0 +{ +( -800 576 64 ) ( -800 448 64 ) ( -824 576 64 ) measure/wall64a [ 1 0 0 48 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -808 576 -8 ) ( -832 576 -8 ) ( -808 576 -16 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -808 576 -40 ) ( -808 576 -48 ) ( -808 448 -40 ) measure/wall64a [ 0 1 0 0 ] [ -0 -0 -1 64 ] -0 0.5 0.5 0 0 0 +( -832 448 -32 ) ( -808 448 -32 ) ( -832 576 -32 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 +( -832 448 -16 ) ( -832 448 -8 ) ( -808 448 -16 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 +( -832 448 -16 ) ( -832 576 -16 ) ( -832 448 -8 ) measure/rtsurface [ 0 1 0 160.0002441406 ] [ -0 -0 -1 159.9999847412 ] -0 -0.400000006 0.4000000358 0 0 0 +} +// brush 1 +{ +patchDef3 +{ +measure/rtsurface +( 9 3 0 0 0 0 0 ) +( +( ( -943.4256591797 673.0717773438 -32 -0 1 ) ( -943.4256591797 673.0717773438 16 -0 0.5 ) ( -943.4256591797 673.0717773438 64 -0 0 ) ) +( ( -925.5692138672 672 -32 -0.125 1 ) ( -925.5692138672 672 16 -0.125 0.5 ) ( -925.5692138672 672 64 -0.125 0 ) ) +( ( -909.7128295898 667.4641113281 -32 -0.25 1 ) ( -909.7128295898 667.4641113281 16 -0.25 0.5 ) ( -909.7128295898 667.4641113281 64 -0.25 0 ) ) +( ( -893.8563842773 662.9282226562 -32 -0.375 1 ) ( -893.8563842773 662.9282226562 16 -0.375 0.5 ) ( -893.8563842773 662.9282226562 64 -0.375 0 ) ) +( ( -880 654.9282226562 -32 -0.5 1 ) ( -880 654.9282226562 16 -0.5 0.5 ) ( -880 654.9282226562 64 -0.5 0 ) ) +( ( -866.1436157227 646.9282226562 -32 -0.625 1 ) ( -866.1436157227 646.9282226562 16 -0.625 0.5 ) ( -866.1436157227 646.9282226562 64 -0.625 0 ) ) +( ( -854.2871704102 635.4641113281 -32 -0.75 1 ) ( -854.2871704102 635.4641113281 16 -0.75 0.5 ) ( -854.2871704102 635.4641113281 64 -0.75 0 ) ) +( ( -842.4307861328 624 -32 -0.875 1 ) ( -842.4307861328 624 16 -0.875 0.5 ) ( -842.4307861328 624 64 -0.875 0 ) ) +( ( -832.5744018555 609.0717773438 -32 -1 1 ) ( -832.5744018555 609.0717773438 16 -1 0.5 ) ( -832.5744018555 609.0717773438 64 -1 0 ) ) +) +} +} +// brush 2 +{ +patchDef3 +{ +measure/rtsurface +( 9 3 0 0 0 0 0 ) +( +( ( -943.4256591797 350.9281921387 64 -0 0 ) ( -943.4256591797 350.9281921387 16 -0 0.5 ) ( -943.4256591797 350.9281921387 -32 -0 1 ) ) +( ( -925.5692138672 352 64 -0.125 0 ) ( -925.5692138672 352 16 -0.125 0.5 ) ( -925.5692138672 352 -32 -0.125 1 ) ) +( ( -909.7128295898 356.5358886719 64 -0.25 0 ) ( -909.7128295898 356.5358886719 16 -0.25 0.5 ) ( -909.7128295898 356.5358886719 -32 -0.25 1 ) ) +( ( -893.8563842773 361.0718078613 64 -0.375 0 ) ( -893.8563842773 361.0718078613 16 -0.375 0.5 ) ( -893.8563842773 361.0718078613 -32 -0.375 1 ) ) +( ( -880 369.0718078613 64 -0.5 0 ) ( -880 369.0718078613 16 -0.5 0.5 ) ( -880 369.0718078613 -32 -0.5 1 ) ) +( ( -866.1436157227 377.0718078613 64 -0.625 0 ) ( -866.1436157227 377.0718078613 16 -0.625 0.5 ) ( -866.1436157227 377.0718078613 -32 -0.625 1 ) ) +( ( -854.2871704102 388.5358886719 64 -0.75 0 ) ( -854.2871704102 388.5358886719 16 -0.75 0.5 ) ( -854.2871704102 388.5358886719 -32 -0.75 1 ) ) +( ( -842.4307861328 400 64 -0.875 0 ) ( -842.4307861328 400 16 -0.875 0.5 ) ( -842.4307861328 400 -32 -0.875 1 ) ) +( ( -832.5744018555 414.9281921387 64 -1 0 ) ( -832.5744018555 414.9281921387 16 -1 0.5 ) ( -832.5744018555 414.9281921387 -32 -1 1 ) ) +) +} +} +} diff --git a/platform/test_maps.pk3dir/textures/measure/rtsurface.mat b/platform/test_maps.pk3dir/textures/measure/rtsurface.mat new file mode 100644 index 00000000..45aa5606 --- /dev/null +++ b/platform/test_maps.pk3dir/textures/measure/rtsurface.mat @@ -0,0 +1,8 @@ +// Vera Visions Material +{ + qer_editorimage "textures/measure/rtsurface.tga" + + { + map $rt:base + } +} diff --git a/platform/test_maps.pk3dir/textures/measure/rtsurface.tga b/platform/test_maps.pk3dir/textures/measure/rtsurface.tga new file mode 100644 index 00000000..9214fb5a Binary files /dev/null and b/platform/test_maps.pk3dir/textures/measure/rtsurface.tga differ diff --git a/src/client/entry.c b/src/client/entry.c index dc0fbfbf..f25708d6 100644 --- a/src/client/entry.c +++ b/src/client/entry.c @@ -315,6 +315,8 @@ CSQC_UpdateView(float w, float h, float focus) CSQC_RenderScene(); } + RenderTarget_Monitor_Update(); + for (entity b = world; (b = findfloat(b, ::isCSQC, 1));) { CBaseEntity pf = (CBaseEntity) b; pf.postdraw(); @@ -842,6 +844,13 @@ CSQC_Ent_Update(float new) } tc.ReceiveEntity(readfloat()); break; + case ENT_MONITOR: + func_monitor fc = (func_monitor)self; + if (new) { + spawnfunc_func_monitor(); + } + fc.ReceiveEntity(readfloat()); + break; case ENT_DLIGHT: light_dynamic dl = (light_dynamic)self; if (new) { diff --git a/src/gs-entbase/server.src b/src/gs-entbase/server.src index 3f5e32a6..18becac1 100644 --- a/src/gs-entbase/server.src +++ b/src/gs-entbase/server.src @@ -67,6 +67,7 @@ server/infodecal.cpp server/player_weaponstrip.cpp server/player_loadsaved.cpp server/prop_physics.cpp +server/point_camera.cpp server/targ_speaker.cpp server/target_cdaudio.cpp server/trigger_auto.cpp diff --git a/src/gs-entbase/server/point_camera.cpp b/src/gs-entbase/server/point_camera.cpp new file mode 100644 index 00000000..8716a820 --- /dev/null +++ b/src/gs-entbase/server/point_camera.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2016-2020 Marco Hladik + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*QUAKED point_camera (1 0 0) (-8 -8 -8) (8 8 8) PCAMFL_STARTOFF +"targetname" Name +"FOV" Field of view in degrees +"UseScreenAspectRatio" Forces the aspect ratio to be the same as the game (?) +"fogEnable" Enable fog in the camera's view +"fogColor" Color of the fog in RGB255 +"fogStart" Near fog plane +"fogEnd" Far fog plane + +Inputs: +"ChangeFOV" Change the camera's field of view +"SetOnAndTurnOthersOff" Turn this camera on while deactivating all others +"SetOn" Turn this camera on +"SetOff" Turn this camera off + +A virtual camera of which its output can be displayed on a rendertarget. +This plays well with the func_monitor entity. + +Trivia: +This entity was introduced in Half-Life 2 (2004). +*/ + +class point_camera:CBaseTrigger +{ + float m_flFOV; + int m_iUseSAR; + int m_iUseFog; + vector m_vecFogColor; + float m_flFogStart; + float m_flFogEnd; + + void(void) point_camera; + + virtual void(entity,string,string) Input; + virtual void(string,string) SpawnKey; + virtual void(void) Respawn; +}; + +void +point_camera::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + case "ChangeFOV": + m_flFOV = stof(strInput); + break; + case "SetOnAndTurnOthersOff": + for (point_camera e = world; e = find(e, ::classname, "point_camera");) + e.m_iValue = FALSE; + + m_iValue = TRUE; + break; + case "SetOn": + m_iValue = TRUE; + break; + case "SetOff": + m_iValue = FALSE; + break; + default: + CBaseTrigger::Input(eAct, strInput, strData); + } +} + +void +point_camera::SpawnKey(string strKey, string strValue) +{ + switch (strKey) { + case "FOV": + m_flFOV = stof(strValue); + break; + case "UseScreenAspectRatio": + m_iUseSAR = stoi(strValue); + break; + case "fogEnable": + m_iUseFog = stoi(strValue); + break; + case "fogColor": + m_vecFogColor = stov(strValue); + break; + case "fogStart": + m_flFogStart = stof(strValue); + break; + case "fogEnd": + m_flFogEnd = stof(strValue); + break; + default: + CBaseTrigger::SpawnKey(strKey, strValue); + } +} + +void +point_camera::Respawn(void) +{ + SetModelindex(0); + SetSolid(SOLID_NOT); + SetSize([-16,-16,-16], [16,16,16]); + SetOrigin(m_oldOrigin); + SetAngles(m_oldAngle); + m_iValue = TRUE; +} + +void +point_camera::point_camera(void) +{ + m_flFOV = 90; + + CBaseTrigger::CBaseTrigger(); +} diff --git a/src/gs-entbase/shared.src b/src/gs-entbase/shared.src index d822a133..9f47e09f 100644 --- a/src/gs-entbase/shared.src +++ b/src/gs-entbase/shared.src @@ -8,6 +8,7 @@ shared/spraylogo.cpp shared/func_friction.cpp shared/env_projectedtexture.cpp shared/light_dynamic.cpp +shared/func_monitor.cpp shared/trigger_camera.cpp shared/trigger_gravity.cpp shared/info_particle_system.cpp diff --git a/src/gs-entbase/shared/func_monitor.cpp b/src/gs-entbase/shared/func_monitor.cpp new file mode 100644 index 00000000..16a32b6d --- /dev/null +++ b/src/gs-entbase/shared/func_monitor.cpp @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2016-2020 Marco Hladik + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*QUAKED func_monitor (0 .5 .8) ? +"targetname" Name +"target" Camera it's linked to + +Inputs: +"Enable" Turns the monitor on +"Disable" Turns the monitor on. +"Toggle" Toggles the state of the monitor between on and off + +A monitor that renders the view of a linked point_camera entity. + +Trivia: +This entity was introduced in Half-Life 2 (2004). +*/ + +#ifdef CLIENT +int g_iRenderTargetActive; +float g_flRenderTargetFOV; +vector g_iRenderTargetSize; +vector g_vecRenderTargetPos; +vector g_vecRenderTargetAngles; + +void +RenderTarget_Monitor_Update(void) +{ + if (!g_iRenderTargetActive) { + return; + } + + clearscene(); + setviewprop(VF_RT_DESTCOLOUR, "base", 1, g_iRenderTargetSize); + setviewprop(VF_SIZE, g_iRenderTargetSize); + setviewprop(VF_DRAWENGINESBAR, 0); + setviewprop(VF_ORIGIN, g_vecRenderTargetPos); + setviewprop(VF_ANGLES, g_vecRenderTargetAngles); + setviewprop(VF_AFOV, g_flRenderTargetFOV); + + /* TODO: This is ideally where fog parms should be set... :/ */ + + addentities(MASK_ENGINE); + renderscene(); + setviewprop(VF_RT_DESTCOLOUR, __NULL__); +} +#endif + +enumflags +{ + MONITORFL_CHANGED_BASE, + MONITORFL_CHANGED_ORIGIN, + MONITORFL_CHANGED_ANGLES, + MONITORFL_CHANGED_FOV, + MONITORFL_CHANGED_ASPECT, + MONITORFL_CHANGED_FOGCOLOR, + MONITORFL_CHANGED_FOGSTART, + MONITORFL_CHANGED_FOGEND, + MONITORFL_CHANGED_STATUS +}; + +#ifdef CLIENT +class func_monitor +#else +class func_monitor:CBaseTrigger +#endif +{ + /* these mirror the fields of a point_camera */ + vector m_vecCamOrigin; + vector m_vecCamAngles; + int m_iCamValue; + float m_flFOV; + int m_iUseSAR; + int m_iUseFog; + vector m_vecFogColor; + float m_flFogStart; + float m_flFogEnd; + + void(void) func_monitor; + +#ifdef CLIENT + int m_iValue; + + virtual void(float) ReceiveEntity; +#else + virtual void(void) Respawn; + virtual void(void) ParentUpdate; + virtual float(entity, float) SendEntity; + virtual void(string, string) SpawnKey; + virtual void(entity, int) Trigger; + virtual void(entity, string, string) Input; +#endif +}; + +#ifdef CLIENT +void +func_monitor::ReceiveEntity(float flFlags) +{ + if (flFlags & MONITORFL_CHANGED_ORIGIN) { + modelindex = readfloat(); + origin[0] = readcoord(); + origin[1] = readcoord(); + origin[2] = readcoord(); + } + + if (flFlags & MONITORFL_CHANGED_ORIGIN) { + m_vecCamOrigin[0] = readcoord(); + m_vecCamOrigin[1] = readcoord(); + m_vecCamOrigin[2] = readcoord(); + } + + if (flFlags & MONITORFL_CHANGED_ANGLES) { + m_vecCamAngles[0] = readfloat(); + m_vecCamAngles[1] = readfloat(); + m_vecCamAngles[2] = readfloat(); + } + + if (flFlags & MONITORFL_CHANGED_FOV) + m_flFOV = readbyte(); + + if (flFlags & MONITORFL_CHANGED_ASPECT) + m_iUseSAR = readbyte(); + + if (flFlags & MONITORFL_CHANGED_FOGCOLOR) { + m_vecFogColor[0] = readbyte(); + m_vecFogColor[1] = readbyte(); + m_vecFogColor[2] = readbyte(); + } + + if (flFlags & MONITORFL_CHANGED_FOGSTART) + m_flFogStart = readshort(); + + if (flFlags & MONITORFL_CHANGED_FOGEND) + m_flFogEnd = readshort(); + + if (flFlags & MONITORFL_CHANGED_STATUS) + m_iValue = readbyte(); + + classname = "func_monitor"; + + solid = SOLID_BSP; + movetype = MOVETYPE_NONE; + setorigin(this, origin); + setsize(this, mins, maxs); + + g_iRenderTargetActive = m_iValue; + + if (!m_iValue) { + return; + } + + g_flRenderTargetFOV = m_flFOV; + g_iRenderTargetSize = [320, 240]; + g_vecRenderTargetPos = m_vecCamOrigin; + g_vecRenderTargetAngles = m_vecCamAngles; +} +#else +float +func_monitor::SendEntity(entity ePVSEnt, float flFlags) +{ + WriteByte(MSG_ENTITY, ENT_MONITOR); + WriteFloat(MSG_ENTITY, flFlags); + + if (flFlags & MONITORFL_CHANGED_BASE) { + WriteFloat(MSG_ENTITY, modelindex); + WriteCoord(MSG_ENTITY, origin[0]); + WriteCoord(MSG_ENTITY, origin[0]); + WriteCoord(MSG_ENTITY, origin[0]); + } + + if (flFlags & MONITORFL_CHANGED_ORIGIN) { + WriteCoord(MSG_ENTITY, m_vecCamOrigin[0]); + WriteCoord(MSG_ENTITY, m_vecCamOrigin[1]); + WriteCoord(MSG_ENTITY, m_vecCamOrigin[2]); + } + + if (flFlags & MONITORFL_CHANGED_ANGLES) { + WriteFloat(MSG_ENTITY, m_vecCamAngles[0]); + WriteFloat(MSG_ENTITY, m_vecCamAngles[1]); + WriteFloat(MSG_ENTITY, m_vecCamAngles[2]); + } + + if (flFlags & MONITORFL_CHANGED_FOV) + WriteByte(MSG_ENTITY, m_flFOV); + + if (flFlags & MONITORFL_CHANGED_ASPECT) + WriteByte(MSG_ENTITY, m_iUseSAR); + + if (flFlags & MONITORFL_CHANGED_FOGCOLOR) { + WriteByte(MSG_ENTITY, m_vecFogColor[0]); + WriteByte(MSG_ENTITY, m_vecFogColor[1]); + WriteByte(MSG_ENTITY, m_vecFogColor[2]); + } + + if (flFlags & MONITORFL_CHANGED_FOGSTART) + WriteShort(MSG_ENTITY, m_flFogStart); + + if (flFlags & MONITORFL_CHANGED_FOGEND) + WriteShort(MSG_ENTITY, m_flFogEnd); + + if (flFlags & MONITORFL_CHANGED_STATUS) + WriteByte(MSG_ENTITY, m_iValue); + + return TRUE; +} + +void +func_monitor::ParentUpdate(void) +{ + if (net_origin != origin) { + net_origin = origin; + SendFlags |= MONITORFL_CHANGED_BASE; + } + + if (m_parent) { + entity p = find(world, ::targetname, m_parent); + + if (p) + SetOrigin(p.origin); + } + + /* this monitor is disabled */ + if (!m_iValue) + return; + + point_camera viewer; + viewer = (point_camera)find(world, ::targetname, target); + + if (!viewer) + return; + + /* camera is disabled */ + if (!viewer.m_iValue) + return; + + if (m_vecCamOrigin != viewer.origin) { + m_vecCamOrigin = viewer.origin; + SendFlags |= MONITORFL_CHANGED_ORIGIN; + } + if (m_vecCamAngles != viewer.angles) { + m_vecCamAngles = viewer.angles; + SendFlags |= MONITORFL_CHANGED_ANGLES; + } + if (m_flFOV != viewer.m_flFOV) { + m_flFOV = viewer.m_flFOV; + SendFlags |= MONITORFL_CHANGED_FOV; + } + if (m_iUseSAR != viewer.m_iUseSAR) { + m_iUseSAR = viewer.m_iUseSAR; + SendFlags |= MONITORFL_CHANGED_ASPECT; + } + if (m_vecFogColor != viewer.m_vecFogColor) { + m_vecFogColor = viewer.m_vecFogColor; + SendFlags |= MONITORFL_CHANGED_FOGCOLOR; + } + if (m_flFogStart != viewer.m_flFogStart) { + m_flFogStart = viewer.m_flFogStart; + SendFlags |= MONITORFL_CHANGED_FOGSTART; + } + if (m_flFogEnd != viewer.m_flFogEnd) { + m_flFogEnd = viewer.m_flFogEnd; + SendFlags |= MONITORFL_CHANGED_FOGEND; + } + if (m_flFogEnd != viewer.m_flFogEnd) { + m_flFogEnd = viewer.m_flFogEnd; + SendFlags |= MONITORFL_CHANGED_STATUS; + } +} + +void +func_monitor::Trigger(entity act, int state) +{ + switch (state) { + case TRIG_OFF: + m_iValue = 0; + break; + case TRIG_ON: + m_iValue = 1; + break; + default: + m_iValue = 1 - m_iValue; + } + + SendFlags |= MONITORFL_CHANGED_STATUS; +} + +void +func_monitor::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + case "Enable": + Trigger(eAct, TRIG_ON); + break; + case "Disable": + Trigger(eAct, TRIG_OFF); + break; + case "Toggle": + Trigger(eAct, TRIG_TOGGLE); + break; + default: + CBaseTrigger::Input(eAct, strInput, strData); + } +} + +void +func_monitor::SpawnKey(string strKey, string strValue) +{ + switch (strKey) { + default: + CBaseTrigger::SpawnKey(strKey, strValue); + } +} + +void +func_monitor::Respawn(void) +{ + SetSolid(SOLID_BSP); + SetMovetype(MOVETYPE_NONE); + SetOrigin(m_oldOrigin); + SetAngles(m_oldAngle); + SetModel(m_oldModel); + m_iValue = TRUE; +} +#endif + +void +func_monitor::func_monitor(void) +{ +#ifdef CLIENT + drawmask = MASK_ENGINE; +#elif SERVER + CBaseTrigger::CBaseTrigger(); +#endif +} diff --git a/src/shared/entities.h b/src/shared/entities.h index a937436b..10f3f895 100644 --- a/src/shared/entities.h +++ b/src/shared/entities.h @@ -28,6 +28,7 @@ enum ENT_SPRAY, ENT_DECAL, ENT_OLDCAMERA, + ENT_MONITOR, ENT_SEPARATOR };