diff --git a/res/person.blend b/res/person.blend index 97edfa1..5c77c9d 100644 Binary files a/res/person.blend and b/res/person.blend differ diff --git a/res/person_-xfw_zup.mtl b/res/person_-xfw_zup.mtl new file mode 100644 index 0000000..036f4e5 --- /dev/null +++ b/res/person_-xfw_zup.mtl @@ -0,0 +1,12 @@ +# Blender MTL File: 'person.blend' +# Material Count: 1 + +newmtl Material +Ns 225.000000 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 diff --git a/res/person_-xfw_zup.obj b/res/person_-xfw_zup.obj new file mode 100644 index 0000000..625c34a --- /dev/null +++ b/res/person_-xfw_zup.obj @@ -0,0 +1,1082 @@ +# Blender v2.82 (sub 7) OBJ File: 'person.blend' +# www.blender.org +mtllib person_-xfw_zup.mtl +o Cube +v -0.140106 0.137915 1.371506 +v 0.159643 0.137915 1.371506 +v 0.159643 -0.134483 1.371506 +v -0.140106 -0.134483 1.371506 +v -0.140106 0.137915 1.690793 +v 0.159643 0.137915 1.690793 +v 0.159643 -0.134483 1.690793 +v -0.140106 -0.134483 1.690793 +v -0.107544 0.245470 1.159527 +v 0.137664 0.182522 1.164427 +v 0.137664 -0.179090 1.164427 +v -0.107544 -0.242038 1.159527 +v -0.107544 0.245470 1.322872 +v 0.154759 0.182522 1.298842 +v 0.154759 -0.179090 1.298842 +v -0.107544 -0.242038 1.322872 +v -0.109407 0.194088 0.942349 +v 0.111849 0.194088 0.942349 +v 0.111849 -0.190656 0.942349 +v -0.109407 -0.190656 0.942349 +v -0.109407 0.194088 1.128210 +v 0.111849 0.194088 1.128210 +v 0.111849 -0.190656 1.128210 +v -0.109407 -0.190656 1.128210 +v -0.084985 0.194088 0.716899 +v 0.083357 0.194088 0.720969 +v 0.083357 -0.190656 0.720969 +v -0.084985 -0.190656 0.716899 +v -0.109407 0.194088 0.892585 +v 0.103709 0.194088 0.892585 +v 0.103708 -0.190656 0.892585 +v -0.109407 -0.190656 0.892585 +v -0.069651 -0.172616 0.682076 +v 0.052053 -0.172616 0.682076 +v 0.052053 -0.042927 0.682076 +v -0.069651 -0.042926 0.682076 +v -0.045307 -0.173759 0.399351 +v 0.045307 -0.173759 0.399351 +v 0.045307 -0.071915 0.399351 +v -0.045307 -0.071915 0.399351 +v -0.019392 0.254310 0.656924 +v 0.019795 0.272794 0.656135 +v 0.019795 0.379026 0.656135 +v -0.019392 0.381202 0.656924 +v 0.038805 0.280992 0.690410 +v -0.037009 0.280992 0.690410 +v -0.037009 0.368588 0.690410 +v 0.038805 0.368588 0.690410 +v 0.038805 0.280992 0.947029 +v -0.037009 0.280992 0.947029 +v -0.037009 0.368588 0.947029 +v 0.038805 0.368588 0.947029 +v 0.046205 0.264044 0.971325 +v -0.044409 0.264044 0.971325 +v -0.044409 0.378502 0.971325 +v 0.046205 0.378502 0.971325 +v 0.046205 0.264044 1.278038 +v -0.044409 0.264044 1.278038 +v -0.044409 0.378502 1.278038 +v 0.046205 0.378502 1.278038 +v 0.151134 -0.142852 0.053860 +v 0.151134 -0.101650 0.053860 +v 0.151134 -0.142852 0.001768 +v 0.151134 -0.101650 0.001768 +v -0.045307 -0.068399 0.107456 +v 0.045307 -0.068399 0.107456 +v 0.045307 -0.170242 0.107456 +v -0.045307 -0.170242 0.107456 +v -0.045307 -0.068399 0.373509 +v 0.045307 -0.068399 0.373509 +v 0.045307 -0.170242 0.373509 +v -0.045307 -0.170242 0.373509 +v -0.045307 -0.074260 -0.000749 +v 0.037166 -0.074260 -0.000749 +v 0.037166 -0.170242 -0.000749 +v -0.045307 -0.170242 -0.000749 +v -0.045307 -0.074260 0.080799 +v 0.037166 -0.074260 0.080799 +v 0.037166 -0.170242 0.080799 +v -0.045307 -0.170242 0.080799 +v -0.045307 -0.375545 1.280073 +v 0.045307 -0.375545 1.280073 +v 0.045307 -0.261087 1.280073 +v -0.045307 -0.261087 1.280073 +v -0.045307 -0.375545 0.973359 +v 0.045307 -0.375545 0.973359 +v 0.045307 -0.261087 0.973359 +v -0.045307 -0.261087 0.973359 +v -0.037907 -0.365631 0.949064 +v 0.037907 -0.365631 0.949064 +v 0.037907 -0.278035 0.949064 +v -0.037907 -0.278035 0.949064 +v -0.037907 -0.365631 0.692445 +v 0.037907 -0.365631 0.692445 +v 0.037907 -0.278035 0.692445 +v -0.037907 -0.278035 0.692445 +v 0.020290 -0.378245 0.658959 +v -0.018897 -0.376069 0.658170 +v -0.018897 -0.269837 0.658170 +v 0.020290 -0.251353 0.658959 +v 0.020290 -0.378245 0.553501 +v -0.016297 -0.378245 0.553501 +v -0.016297 -0.251353 0.553501 +v 0.020290 -0.251353 0.553501 +v -0.019392 0.381202 0.551466 +v 0.017195 0.381202 0.551466 +v 0.017195 0.254310 0.551466 +v -0.019392 0.254310 0.551466 +v 0.107992 0.167755 0.682076 +v -0.013712 0.167755 0.682076 +v -0.013712 0.038066 0.682076 +v 0.107992 0.038066 0.682076 +v 0.083648 0.168898 0.399351 +v -0.006966 0.168898 0.399351 +v -0.006966 0.067055 0.399351 +v 0.083648 0.067055 0.399351 +v 0.151185 0.096789 0.053860 +v 0.151185 0.137991 0.053860 +v 0.151185 0.096789 0.001768 +v 0.151185 0.137991 0.001768 +v 0.083648 0.063538 0.107456 +v -0.006966 0.063538 0.107456 +v -0.006966 0.165381 0.107456 +v 0.083648 0.165381 0.107456 +v 0.083648 0.063538 0.373509 +v -0.006966 0.063538 0.373509 +v -0.006966 0.165381 0.373509 +v 0.083648 0.165381 0.373509 +v -0.045255 0.165381 -0.000749 +v 0.037218 0.165381 -0.000749 +v 0.037218 0.069399 -0.000749 +v -0.045255 0.069399 -0.000749 +v -0.045255 0.165381 0.080799 +v 0.037218 0.165381 0.080799 +v 0.037218 0.069399 0.080799 +v -0.045255 0.069399 0.080799 +v -0.140106 0.137915 1.371506 +v -0.140106 0.137915 1.371506 +v 0.159643 0.137915 1.371506 +v 0.159643 0.137915 1.371506 +v -0.140106 -0.134483 1.371506 +v -0.140106 -0.134483 1.371506 +v -0.140106 0.137915 1.690793 +v -0.140106 0.137915 1.690793 +v 0.159643 -0.134483 1.371506 +v 0.159643 -0.134483 1.371506 +v 0.159643 0.137915 1.690793 +v 0.159643 0.137915 1.690793 +v 0.159643 -0.134483 1.690793 +v 0.159643 -0.134483 1.690793 +v -0.140106 -0.134483 1.690793 +v -0.140106 -0.134483 1.690793 +v -0.107544 0.245470 1.159527 +v -0.107544 0.245470 1.159527 +v 0.137664 0.182522 1.164427 +v 0.137664 0.182522 1.164427 +v -0.107544 -0.242038 1.159527 +v -0.107544 -0.242038 1.159527 +v -0.107544 0.245470 1.322872 +v -0.107544 0.245470 1.322872 +v 0.137664 -0.179090 1.164427 +v 0.137664 -0.179090 1.164427 +v 0.154759 0.182522 1.298842 +v 0.154759 0.182522 1.298842 +v 0.154759 -0.179090 1.298842 +v 0.154759 -0.179090 1.298842 +v -0.107544 -0.242038 1.322872 +v -0.107544 -0.242038 1.322872 +v -0.109407 0.194088 0.942349 +v -0.109407 0.194088 0.942349 +v 0.111849 0.194088 0.942349 +v 0.111849 0.194088 0.942349 +v -0.109407 -0.190656 0.942349 +v -0.109407 -0.190656 0.942349 +v -0.109407 0.194088 1.128210 +v -0.109407 0.194088 1.128210 +v 0.111849 -0.190656 0.942349 +v 0.111849 -0.190656 0.942349 +v 0.111849 0.194088 1.128210 +v 0.111849 0.194088 1.128210 +v 0.111849 -0.190656 1.128210 +v 0.111849 -0.190656 1.128210 +v -0.109407 -0.190656 1.128210 +v -0.109407 -0.190656 1.128210 +v -0.084985 0.194088 0.716899 +v -0.084985 0.194088 0.716899 +v 0.083357 0.194088 0.720969 +v 0.083357 0.194088 0.720969 +v -0.084985 -0.190656 0.716899 +v -0.084985 -0.190656 0.716899 +v -0.109407 0.194088 0.892585 +v -0.109407 0.194088 0.892585 +v 0.083357 -0.190656 0.720969 +v 0.083357 -0.190656 0.720969 +v 0.103709 0.194088 0.892585 +v 0.103709 0.194088 0.892585 +v 0.103708 -0.190656 0.892585 +v 0.103708 -0.190656 0.892585 +v -0.109407 -0.190656 0.892585 +v -0.109407 -0.190656 0.892585 +v 0.052053 -0.172616 0.682076 +v 0.052053 -0.172616 0.682076 +v -0.069651 -0.172616 0.682076 +v -0.069651 -0.172616 0.682076 +v 0.052053 -0.042927 0.682076 +v 0.052053 -0.042927 0.682076 +v -0.069651 -0.042926 0.682076 +v -0.069651 -0.042926 0.682076 +v -0.045307 -0.173759 0.399351 +v -0.045307 -0.173759 0.399351 +v 0.045307 -0.173759 0.399351 +v 0.045307 -0.173759 0.399351 +v 0.045307 -0.071915 0.399351 +v 0.045307 -0.071915 0.399351 +v -0.045307 -0.071915 0.399351 +v -0.045307 -0.071915 0.399351 +v -0.019392 0.254310 0.656924 +v -0.019392 0.254310 0.656924 +v 0.019795 0.272794 0.656135 +v 0.019795 0.272794 0.656135 +v -0.019392 0.381202 0.656924 +v -0.019392 0.381202 0.656924 +v 0.019795 0.379026 0.656135 +v 0.019795 0.379026 0.656135 +v 0.038805 0.280992 0.690410 +v 0.038805 0.280992 0.690410 +v -0.037009 0.280992 0.690410 +v -0.037009 0.280992 0.690410 +v 0.038805 0.368588 0.690410 +v 0.038805 0.368588 0.690410 +v 0.038805 0.280992 0.947029 +v 0.038805 0.280992 0.947029 +v -0.037009 0.368588 0.690410 +v -0.037009 0.368588 0.690410 +v -0.037009 0.280992 0.947029 +v -0.037009 0.280992 0.947029 +v -0.037009 0.368588 0.947029 +v -0.037009 0.368588 0.947029 +v 0.038805 0.368588 0.947029 +v 0.038805 0.368588 0.947029 +v 0.046205 0.264044 0.971325 +v 0.046205 0.264044 0.971325 +v -0.044409 0.264044 0.971325 +v -0.044409 0.264044 0.971325 +v 0.046205 0.378502 0.971325 +v 0.046205 0.378502 0.971325 +v 0.046205 0.264044 1.278038 +v 0.046205 0.264044 1.278038 +v -0.044409 0.378502 0.971325 +v -0.044409 0.378502 0.971325 +v -0.044409 0.264044 1.278038 +v -0.044409 0.264044 1.278038 +v -0.044409 0.378502 1.278038 +v -0.044409 0.378502 1.278038 +v 0.046205 0.378502 1.278038 +v 0.046205 0.378502 1.278038 +v 0.151134 -0.142852 0.001768 +v 0.151134 -0.142852 0.001768 +v 0.037166 -0.170242 -0.000749 +v 0.037166 -0.170242 -0.000749 +v 0.037166 -0.170242 -0.000749 +v 0.037166 -0.074260 -0.000749 +v 0.037166 -0.074260 -0.000749 +v 0.037166 -0.074260 -0.000749 +v 0.151134 -0.101650 0.001768 +v 0.151134 -0.101650 0.001768 +v 0.151134 -0.101650 0.053860 +v 0.151134 -0.101650 0.053860 +v 0.037166 -0.074260 0.080799 +v 0.037166 -0.074260 0.080799 +v 0.037166 -0.074260 0.080799 +v 0.037166 -0.170242 0.080799 +v 0.037166 -0.170242 0.080799 +v 0.037166 -0.170242 0.080799 +v 0.151134 -0.142852 0.053860 +v 0.151134 -0.142852 0.053860 +v -0.045307 -0.068399 0.107456 +v -0.045307 -0.068399 0.107456 +v 0.045307 -0.068399 0.107456 +v 0.045307 -0.068399 0.107456 +v -0.045307 -0.170242 0.107456 +v -0.045307 -0.170242 0.107456 +v -0.045307 -0.068399 0.373509 +v -0.045307 -0.068399 0.373509 +v 0.045307 -0.170242 0.107456 +v 0.045307 -0.170242 0.107456 +v 0.045307 -0.068399 0.373509 +v 0.045307 -0.068399 0.373509 +v 0.045307 -0.170242 0.373509 +v 0.045307 -0.170242 0.373509 +v -0.045307 -0.170242 0.373509 +v -0.045307 -0.170242 0.373509 +v -0.045307 -0.074260 -0.000749 +v -0.045307 -0.074260 -0.000749 +v -0.045307 -0.170242 -0.000749 +v -0.045307 -0.170242 -0.000749 +v -0.045307 -0.074260 0.080799 +v -0.045307 -0.074260 0.080799 +v -0.045307 -0.170242 0.080799 +v -0.045307 -0.170242 0.080799 +v 0.045307 -0.375545 1.280073 +v 0.045307 -0.375545 1.280073 +v -0.045307 -0.375545 1.280073 +v -0.045307 -0.375545 1.280073 +v 0.045307 -0.261087 1.280073 +v 0.045307 -0.261087 1.280073 +v -0.045307 -0.261087 1.280073 +v -0.045307 -0.261087 1.280073 +v -0.045307 -0.375545 0.973359 +v -0.045307 -0.375545 0.973359 +v 0.045307 -0.375545 0.973359 +v 0.045307 -0.375545 0.973359 +v 0.045307 -0.261087 0.973359 +v 0.045307 -0.261087 0.973359 +v -0.045307 -0.261087 0.973359 +v -0.045307 -0.261087 0.973359 +v 0.037907 -0.365631 0.949064 +v 0.037907 -0.365631 0.949064 +v -0.037907 -0.365631 0.949064 +v -0.037907 -0.365631 0.949064 +v 0.037907 -0.278035 0.949064 +v 0.037907 -0.278035 0.949064 +v -0.037907 -0.278035 0.949064 +v -0.037907 -0.278035 0.949064 +v -0.037907 -0.365631 0.692445 +v -0.037907 -0.365631 0.692445 +v 0.037907 -0.365631 0.692445 +v 0.037907 -0.365631 0.692445 +v 0.037907 -0.278035 0.692445 +v 0.037907 -0.278035 0.692445 +v -0.037907 -0.278035 0.692445 +v -0.037907 -0.278035 0.692445 +v -0.018897 -0.376069 0.658170 +v -0.018897 -0.376069 0.658170 +v 0.020290 -0.378245 0.658959 +v 0.020290 -0.378245 0.658959 +v -0.018897 -0.269837 0.658170 +v -0.018897 -0.269837 0.658170 +v 0.020290 -0.251353 0.658959 +v 0.020290 -0.251353 0.658959 +v 0.020290 -0.378245 0.553501 +v 0.020290 -0.378245 0.553501 +v -0.016297 -0.378245 0.553501 +v -0.016297 -0.378245 0.553501 +v -0.016297 -0.251353 0.553501 +v -0.016297 -0.251353 0.553501 +v 0.020290 -0.251353 0.553501 +v 0.020290 -0.251353 0.553501 +v -0.019392 0.381202 0.551466 +v -0.019392 0.381202 0.551466 +v 0.017195 0.381202 0.551466 +v 0.017195 0.381202 0.551466 +v 0.017195 0.254310 0.551466 +v 0.017195 0.254310 0.551466 +v -0.019392 0.254310 0.551466 +v -0.019392 0.254310 0.551466 +v -0.013712 0.167755 0.682076 +v -0.013712 0.167755 0.682076 +v 0.107992 0.167755 0.682076 +v 0.107992 0.167755 0.682076 +v -0.013712 0.038066 0.682076 +v -0.013712 0.038066 0.682076 +v 0.107992 0.038066 0.682076 +v 0.107992 0.038066 0.682076 +v 0.083648 0.168898 0.399351 +v 0.083648 0.168898 0.399351 +v -0.006966 0.168898 0.399351 +v -0.006966 0.168898 0.399351 +v -0.006966 0.067055 0.399351 +v -0.006966 0.067055 0.399351 +v 0.083648 0.067055 0.399351 +v 0.083648 0.067055 0.399351 +v 0.151185 0.096789 0.001768 +v 0.151185 0.096789 0.001768 +v 0.037218 0.069399 -0.000749 +v 0.037218 0.069399 -0.000749 +v 0.037218 0.069399 -0.000749 +v 0.037218 0.165381 -0.000749 +v 0.037218 0.165381 -0.000749 +v 0.037218 0.165381 -0.000749 +v 0.151185 0.137991 0.001768 +v 0.151185 0.137991 0.001768 +v 0.151185 0.137991 0.053860 +v 0.151185 0.137991 0.053860 +v 0.037218 0.165381 0.080799 +v 0.037218 0.165381 0.080799 +v 0.037218 0.165381 0.080799 +v 0.037218 0.069399 0.080799 +v 0.037218 0.069399 0.080799 +v 0.037218 0.069399 0.080799 +v 0.151185 0.096789 0.053860 +v 0.151185 0.096789 0.053860 +v 0.083648 0.063538 0.107456 +v 0.083648 0.063538 0.107456 +v -0.006966 0.063538 0.107456 +v -0.006966 0.063538 0.107456 +v 0.083648 0.165381 0.107456 +v 0.083648 0.165381 0.107456 +v 0.083648 0.063538 0.373509 +v 0.083648 0.063538 0.373509 +v -0.006966 0.165381 0.107456 +v -0.006966 0.165381 0.107456 +v -0.006966 0.063538 0.373509 +v -0.006966 0.063538 0.373509 +v -0.006966 0.165381 0.373509 +v -0.006966 0.165381 0.373509 +v 0.083648 0.165381 0.373509 +v 0.083648 0.165381 0.373509 +v -0.045255 0.165381 -0.000749 +v -0.045255 0.165381 -0.000749 +v -0.045255 0.069399 -0.000749 +v -0.045255 0.069399 -0.000749 +v -0.045255 0.165381 0.080799 +v -0.045255 0.165381 0.080799 +v -0.045255 0.069399 0.080799 +v -0.045255 0.069399 0.080799 +vt 0.301084 0.898775 +vt 0.263915 0.864997 +vt 0.301084 0.864997 +vt 0.246117 0.945214 +vt 0.210155 0.984786 +vt 0.210155 0.945214 +vt 0.298167 0.990239 +vt 0.168562 0.858032 +vt 0.299105 0.858965 +vt 0.113315 0.996881 +vt 0.003376 0.876869 +vt 0.112768 0.877416 +vt 0.295353 0.991034 +vt 0.170418 0.857237 +vt 0.295711 0.857574 +vt 0.170180 0.858625 +vt 0.296549 0.990344 +vt 0.169461 0.989647 +vt 0.576198 0.825848 +vt 0.599841 0.839506 +vt 0.572693 0.839506 +vt 0.599841 0.839521 +vt 0.576198 0.854189 +vt 0.572693 0.839521 +vt 0.557656 0.830410 +vt 0.571753 0.839233 +vt 0.557656 0.839506 +vt 0.624910 0.967000 +vt 0.412590 0.890282 +vt 0.624910 0.890282 +vt 0.563854 0.811735 +vt 0.572677 0.825833 +vt 0.563581 0.825833 +vt 0.572693 0.816737 +vt 0.599841 0.825833 +vt 0.572693 0.825833 +vt 0.556543 0.853457 +vt 0.576402 0.818924 +vt 0.576402 0.853457 +vt 0.556543 0.818902 +vt 0.591076 0.799043 +vt 0.591076 0.818902 +vt 0.596283 0.852311 +vt 0.576424 0.835629 +vt 0.596283 0.835629 +vt 0.627747 0.871772 +vt 0.414753 0.768879 +vt 0.627747 0.768879 +vt 0.591098 0.818902 +vt 0.610957 0.802220 +vt 0.610957 0.818902 +vt 0.610957 0.835606 +vt 0.576424 0.818924 +vt 0.610957 0.818924 +vt 0.226026 0.626590 +vt 0.196474 0.613656 +vt 0.226026 0.613656 +vt 0.567623 0.819520 +vt 0.617377 0.791961 +vt 0.617377 0.819520 +vt 0.291159 0.690560 +vt 0.033068 0.599186 +vt 0.295337 0.600091 +vt 0.632045 0.700493 +vt 0.362955 0.606258 +vt 0.632045 0.606258 +vt 0.293610 0.596686 +vt 0.034268 0.690560 +vt 0.032591 0.595091 +vt 0.031455 0.596772 +vt 0.296045 0.694323 +vt 0.031455 0.694323 +vt 0.759010 0.705606 +vt 0.783060 0.696962 +vt 0.783105 0.707969 +vt 0.790805 0.696922 +vt 0.782542 0.672926 +vt 0.790232 0.672926 +vt 0.767619 0.672926 +vt 0.759072 0.696929 +vt 0.758975 0.672926 +vt 0.756876 0.697969 +vt 0.748613 0.722091 +vt 0.749185 0.697969 +vt 0.758975 0.718332 +vt 0.769983 0.708002 +vt 0.769983 0.718332 +vt 0.790838 0.681570 +vt 0.798529 0.672926 +vt 0.798529 0.681570 +vt 0.791139 0.570182 +vt 0.794302 0.578756 +vt 0.791088 0.578756 +vt 0.770277 0.578774 +vt 0.778912 0.589164 +vt 0.770277 0.589164 +vt 0.175577 0.338748 +vt 0.187091 0.328783 +vt 0.187091 0.338748 +vt 0.166866 0.426092 +vt 0.150801 0.439997 +vt 0.150801 0.426093 +vt 0.184845 0.502417 +vt 0.120743 0.302583 +vt 0.184845 0.302583 +vt 0.188247 0.500113 +vt 0.120753 0.302387 +vt 0.188247 0.302387 +vt 0.184881 0.502481 +vt 0.121715 0.305019 +vt 0.184881 0.305019 +vt 0.119055 0.303687 +vt 0.187368 0.503813 +vt 0.119055 0.503813 +vt 0.575306 0.820491 +vt 0.579059 0.823462 +vt 0.575306 0.823462 +vt 0.590360 0.817506 +vt 0.586606 0.820478 +vt 0.586606 0.817506 +vt 0.582829 0.827564 +vt 0.579857 0.817506 +vt 0.582829 0.817506 +vt 0.582829 0.817494 +vt 0.579075 0.807436 +vt 0.582829 0.807436 +vt 0.593343 0.827564 +vt 0.590372 0.817506 +vt 0.593343 0.817506 +vt 0.586606 0.807436 +vt 0.590360 0.817494 +vt 0.586606 0.817494 +vt 0.731486 0.888933 +vt 0.733884 0.883787 +vt 0.735067 0.888933 +vt 0.740230 0.888017 +vt 0.735083 0.890415 +vt 0.735083 0.888127 +vt 0.744319 0.882843 +vt 0.739313 0.879832 +vt 0.744318 0.878629 +vt 0.749740 0.882843 +vt 0.747930 0.880556 +vt 0.749740 0.880556 +vt 0.781131 0.598629 +vt 0.768032 0.586975 +vt 0.781131 0.586975 +vt 0.770313 0.709942 +vt 0.794126 0.688754 +vt 0.794126 0.709942 +vt 0.809332 0.729476 +vt 0.744045 0.558024 +vt 0.809332 0.558024 +vt 0.808470 0.725739 +vt 0.740971 0.556761 +vt 0.808470 0.556761 +vt 0.807944 0.733991 +vt 0.746230 0.553509 +vt 0.807944 0.553510 +vt 0.745468 0.553295 +vt 0.808058 0.731706 +vt 0.745468 0.731706 +vt 0.748056 0.895275 +vt 0.743841 0.891654 +vt 0.748056 0.891654 +vt 0.743841 0.891638 +vt 0.748056 0.888017 +vt 0.748056 0.891638 +vt 0.747463 0.898871 +vt 0.743841 0.895290 +vt 0.747463 0.895290 +vt 0.730853 0.878629 +vt 0.733865 0.883771 +vt 0.732055 0.883771 +vt 0.731446 0.893179 +vt 0.735067 0.896760 +vt 0.731446 0.896760 +vt 0.743826 0.893179 +vt 0.739611 0.896760 +vt 0.739611 0.893179 +vt 0.582841 0.807436 +vt 0.586594 0.817494 +vt 0.582841 0.817494 +vt 0.585812 0.827564 +vt 0.582841 0.817506 +vt 0.585812 0.817506 +vt 0.579059 0.817495 +vt 0.575309 0.807436 +vt 0.579063 0.807437 +vt 0.593343 0.817494 +vt 0.590372 0.807436 +vt 0.593343 0.807436 +vt 0.575306 0.820479 +vt 0.579059 0.817507 +vt 0.579059 0.820479 +vt 0.586606 0.824243 +vt 0.589578 0.820490 +vt 0.589578 0.824243 +vt 0.121402 0.304666 +vt 0.185598 0.500333 +vt 0.121402 0.500333 +vt 0.182717 0.501312 +vt 0.121549 0.308688 +vt 0.182717 0.308688 +vt 0.187111 0.301938 +vt 0.119312 0.500562 +vt 0.119312 0.301938 +vt 0.187748 0.503826 +vt 0.118008 0.303674 +vt 0.187748 0.303674 +vt 0.150801 0.453907 +vt 0.166866 0.440003 +vt 0.166866 0.453907 +vt 0.187091 0.338752 +vt 0.175577 0.348717 +vt 0.175577 0.338752 +vt 0.770277 0.578758 +vt 0.780666 0.570124 +vt 0.780666 0.578758 +vt 0.770495 0.589180 +vt 0.773491 0.597814 +vt 0.770277 0.597751 +vt 0.780683 0.578696 +vt 0.789559 0.570124 +vt 0.791072 0.578696 +vt 0.796424 0.578964 +vt 0.792887 0.587391 +vt 0.793435 0.578774 +vt 0.787804 0.593801 +vt 0.778928 0.590592 +vt 0.789317 0.590592 +vt 0.789334 0.593588 +vt 0.799723 0.590592 +vt 0.799723 0.593588 +vt 0.789317 0.578778 +vt 0.780438 0.587347 +vt 0.778928 0.578774 +vt 0.792871 0.578964 +vt 0.789334 0.587391 +vt 0.789881 0.578774 +vt 0.780441 0.587367 +vt 0.789317 0.590576 +vt 0.778928 0.590576 +vt 0.789317 0.593818 +vt 0.778928 0.596813 +vt 0.778928 0.593818 +vt 0.785501 0.696997 +vt 0.794145 0.721047 +vt 0.783138 0.721091 +vt 0.780442 0.696922 +vt 0.772179 0.672926 +vt 0.779870 0.672926 +vt 0.758942 0.673807 +vt 0.747992 0.696813 +vt 0.750343 0.672926 +vt 0.802441 0.696962 +vt 0.794178 0.721084 +vt 0.794751 0.696962 +vt 0.781023 0.708002 +vt 0.770016 0.718332 +vt 0.770016 0.708002 +vt 0.790838 0.689231 +vt 0.799482 0.696922 +vt 0.790838 0.696922 +vt 0.740245 0.893163 +vt 0.742643 0.888017 +vt 0.743826 0.893163 +vt 0.745251 0.883787 +vt 0.740104 0.886185 +vt 0.740104 0.883897 +vt 0.740089 0.888001 +vt 0.735083 0.884990 +vt 0.740088 0.883787 +vt 0.749287 0.897578 +vt 0.747478 0.895290 +vt 0.749287 0.895290 +vt 0.779686 0.573871 +vt 0.768032 0.586970 +vt 0.768032 0.573871 +vt 0.794126 0.667558 +vt 0.770313 0.688745 +vt 0.770313 0.667558 +vt 0.805381 0.731063 +vt 0.745906 0.556437 +vt 0.805381 0.556437 +vt 0.807928 0.729083 +vt 0.745338 0.555917 +vt 0.807928 0.555916 +vt 0.809803 0.730338 +vt 0.744781 0.557162 +vt 0.809803 0.557162 +vt 0.741303 0.554896 +vt 0.811047 0.730104 +vt 0.741303 0.730104 +vt 0.731446 0.893163 +vt 0.735067 0.888949 +vt 0.735067 0.893163 +vt 0.735083 0.895234 +vt 0.739297 0.891613 +vt 0.739297 0.895234 +vt 0.739297 0.898831 +vt 0.735676 0.895250 +vt 0.739297 0.895250 +vt 0.735083 0.878629 +vt 0.738095 0.883771 +vt 0.736286 0.883771 +vt 0.745266 0.883787 +vt 0.748888 0.887367 +vt 0.745266 0.887367 +vt 0.744334 0.878629 +vt 0.747915 0.882843 +vt 0.744334 0.882843 +vt 0.263915 0.898775 +vt 0.246117 0.984786 +vt 0.167624 0.989306 +vt 0.003376 0.999381 +vt 0.170059 0.990697 +vt 0.297268 0.859323 +vt 0.596335 0.825848 +vt 0.596335 0.854189 +vt 0.572677 0.831744 +vt 0.412590 0.967000 +vt 0.571343 0.810811 +vt 0.599841 0.816737 +vt 0.556543 0.818924 +vt 0.556543 0.799043 +vt 0.576424 0.852311 +vt 0.414753 0.871772 +vt 0.591098 0.802220 +vt 0.576424 0.835606 +vt 0.196474 0.626590 +vt 0.567623 0.791961 +vt 0.035091 0.693060 +vt 0.362955 0.700493 +vt 0.295337 0.693060 +vt 0.296045 0.596772 +vt 0.758975 0.696962 +vt 0.780476 0.696922 +vt 0.770080 0.696929 +vt 0.758942 0.722091 +vt 0.758975 0.708002 +vt 0.790838 0.672926 +vt 0.794134 0.570124 +vt 0.778912 0.578774 +vt 0.175577 0.328783 +vt 0.166866 0.439997 +vt 0.120744 0.502417 +vt 0.120753 0.500113 +vt 0.121715 0.502481 +vt 0.187368 0.303687 +vt 0.579059 0.820491 +vt 0.590360 0.820478 +vt 0.579857 0.827564 +vt 0.579075 0.817494 +vt 0.590372 0.827564 +vt 0.590360 0.807436 +vt 0.731597 0.883787 +vt 0.740230 0.891597 +vt 0.739313 0.881641 +vt 0.747930 0.882843 +vt 0.768032 0.598629 +vt 0.770313 0.688754 +vt 0.744045 0.729476 +vt 0.740971 0.725739 +vt 0.746230 0.733990 +vt 0.808059 0.553295 +vt 0.743841 0.895275 +vt 0.743841 0.888017 +vt 0.743841 0.898871 +vt 0.735067 0.878629 +vt 0.735067 0.893179 +vt 0.743826 0.896760 +vt 0.586594 0.807436 +vt 0.582841 0.827564 +vt 0.575306 0.817494 +vt 0.590372 0.817494 +vt 0.575306 0.817507 +vt 0.586606 0.820490 +vt 0.185598 0.304666 +vt 0.121549 0.501312 +vt 0.187111 0.500562 +vt 0.118008 0.503826 +vt 0.150801 0.440003 +vt 0.187091 0.348717 +vt 0.770277 0.570124 +vt 0.773491 0.589180 +vt 0.780861 0.570124 +vt 0.796424 0.587669 +vt 0.779106 0.593801 +vt 0.789334 0.590592 +vt 0.789136 0.587350 +vt 0.792871 0.587669 +vt 0.789139 0.587367 +vt 0.789317 0.596813 +vt 0.794145 0.696962 +vt 0.770113 0.696922 +vt 0.758942 0.697936 +vt 0.804508 0.721084 +vt 0.781023 0.718332 +vt 0.799482 0.689231 +vt 0.740356 0.888017 +vt 0.745251 0.887367 +vt 0.735083 0.886799 +vt 0.747478 0.897578 +vt 0.779686 0.586970 +vt 0.794126 0.688745 +vt 0.745906 0.731063 +vt 0.745338 0.729084 +vt 0.744781 0.730338 +vt 0.811047 0.554896 +vt 0.731446 0.888949 +vt 0.735083 0.891613 +vt 0.735676 0.898831 +vt 0.739297 0.878629 +vt 0.748888 0.883787 +vt 0.747915 0.878629 +vn -0.0000 0.0000 -1.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 1.0000 -0.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 -1.0000 -0.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0200 -0.0000 -0.9998 +vn 0.0912 -0.0000 0.9958 +vn 0.2486 0.9686 -0.0000 +vn 0.9920 0.0000 -0.1262 +vn 0.2486 -0.9686 -0.0000 +vn 0.0242 -0.0000 -0.9997 +vn 0.9930 -0.0000 -0.1178 +vn -0.9905 0.0000 -0.1377 +vn -0.9963 0.0000 -0.0858 +vn -0.0000 -1.0000 0.0040 +vn 0.9997 -0.0000 -0.0239 +vn 0.0000 0.9948 -0.1020 +vn 0.0558 0.9983 0.0194 +vn 0.2337 -0.9723 -0.0000 +vn 0.2337 0.9723 0.0000 +vn 0.0221 -0.0000 -0.9998 +vn 0.2300 -0.0000 0.9732 +vn -0.0558 -0.9983 0.0194 +vn -0.9997 -0.0000 -0.0248 +vn -0.0201 -0.0000 0.9998 +vn 0.9997 -0.0000 -0.0248 +vn 0.0201 0.0000 0.9998 +vn 0.9963 -0.0000 -0.0858 +vn 0.0000 1.0000 0.0040 +vn -0.9997 0.0000 -0.0239 +vn 0.0000 -0.9948 -0.1020 +vn 0.2307 0.9726 -0.0293 +vn 0.2307 -0.9726 -0.0293 +vn -0.4244 0.8934 0.1472 +vn 0.4244 -0.8934 0.1472 +usemtl Material +s off +f 1/1/1 3/2/1 4/3/1 +f 151/4/2 147/5/2 143/6/2 +f 5/7/3 139/8/3 137/9/3 +f 148/10/4 145/11/4 140/12/4 +f 150/13/5 141/14/5 146/15/5 +f 138/16/6 152/17/6 144/18/6 +f 10/19/7 12/20/7 9/21/7 +f 167/22/8 163/23/8 159/24/8 +f 13/25/9 155/26/9 153/27/9 +f 164/28/10 161/29/10 156/30/10 +f 162/31/11 16/32/11 157/33/11 +f 154/34/6 168/35/6 160/36/6 +f 18/37/1 20/38/1 17/39/1 +f 183/40/2 179/41/2 175/42/2 +f 21/43/3 171/44/3 169/45/3 +f 180/46/4 177/47/4 172/48/4 +f 178/49/5 24/50/5 173/51/5 +f 170/52/6 184/53/6 176/54/6 +f 26/55/12 28/56/12 25/57/12 +f 199/58/2 195/59/2 191/60/2 +f 29/61/3 187/62/3 185/63/3 +f 196/64/13 193/65/13 188/66/13 +f 194/67/5 32/68/5 189/69/5 +f 186/70/14 200/71/14 192/72/14 +f 40/73/15 203/74/15 36/75/15 +f 34/76/16 209/77/16 38/78/16 +f 39/79/17 201/80/17 211/81/17 +f 215/82/18 205/83/18 213/84/18 +f 204/85/2 206/86/2 208/87/2 +f 214/88/1 210/89/1 216/90/1 +f 106/91/19 221/92/19 223/93/19 +f 44/94/6 108/95/6 217/96/6 +f 45/97/1 47/98/1 48/99/1 +f 239/100/2 235/101/2 231/102/2 +f 49/103/5 227/104/5 225/105/5 +f 236/106/6 233/107/6 228/108/6 +f 238/109/3 229/110/3 234/111/3 +f 226/112/4 240/113/4 232/114/4 +f 54/115/1 56/116/1 53/117/1 +f 255/118/2 251/119/2 247/120/2 +f 57/121/5 243/122/5 241/123/5 +f 252/124/6 249/125/6 244/126/6 +f 254/127/3 245/128/3 250/129/3 +f 242/130/4 256/131/4 248/132/4 +f 75/133/20 61/134/20 79/135/20 +f 74/136/21 62/137/21 64/138/21 +f 263/139/22 257/140/22 259/141/22 +f 267/142/4 258/143/4 266/144/4 +f 66/145/1 68/146/1 65/147/1 +f 291/148/2 287/149/2 283/150/2 +f 69/151/3 279/152/3 277/153/3 +f 288/154/4 285/155/4 280/156/4 +f 290/157/5 281/158/5 286/159/5 +f 278/160/6 292/161/6 284/162/6 +f 262/163/1 76/164/1 73/165/1 +f 299/166/2 269/167/2 297/168/2 +f 77/169/3 264/170/3 293/171/3 +f 270/172/23 276/173/23 268/174/23 +f 274/175/5 295/176/5 261/177/5 +f 298/178/6 296/179/6 300/180/6 +f 88/181/6 303/182/6 84/183/6 +f 82/184/5 309/185/5 86/186/5 +f 83/187/4 311/188/4 87/189/4 +f 307/190/3 313/191/3 315/192/3 +f 304/193/2 306/194/2 308/195/2 +f 314/196/1 310/197/1 316/198/1 +f 96/199/6 319/200/6 92/201/6 +f 90/202/5 325/203/5 94/204/5 +f 95/205/4 317/206/4 327/207/4 +f 323/208/3 329/209/3 331/210/3 +f 320/211/2 322/212/2 324/213/2 +f 332/214/1 328/215/1 326/216/1 +f 335/217/4 104/218/4 100/219/4 +f 102/220/24 97/221/24 98/222/24 +f 343/223/25 99/224/25 103/225/25 +f 345/226/3 339/227/3 347/228/3 +f 338/229/26 336/230/26 340/231/26 +f 342/232/1 346/233/1 348/234/1 +f 351/235/27 219/236/27 107/237/27 +f 353/238/5 41/239/5 355/240/5 +f 220/241/28 222/242/28 218/243/28 +f 350/244/1 354/245/1 356/246/1 +f 116/247/29 359/248/29 112/249/29 +f 110/250/30 365/251/30 114/252/30 +f 115/253/31 357/254/31 367/255/31 +f 371/256/32 361/257/32 369/258/32 +f 360/259/2 362/260/2 364/261/2 +f 370/262/1 366/263/1 372/264/1 +f 131/265/20 117/266/20 135/267/20 +f 130/268/21 118/269/21 120/270/21 +f 379/271/22 373/272/22 375/273/22 +f 383/274/4 374/275/4 382/276/4 +f 122/277/1 124/278/1 121/279/1 +f 407/280/2 403/281/2 399/282/2 +f 125/283/5 395/284/5 393/285/5 +f 404/286/6 401/287/6 396/288/6 +f 406/289/3 397/290/3 402/291/3 +f 394/292/4 408/293/4 400/294/4 +f 378/295/1 132/296/1 129/297/1 +f 415/298/2 385/299/2 413/300/2 +f 133/301/3 380/302/3 409/303/3 +f 386/304/23 392/305/23 384/306/23 +f 390/307/5 411/308/5 377/309/5 +f 414/310/6 412/311/6 416/312/6 +f 1/1/1 2/313/1 3/2/1 +f 151/4/2 149/314/2 147/5/2 +f 5/7/3 6/315/3 139/8/3 +f 148/10/4 7/316/4 145/11/4 +f 150/13/5 8/317/5 141/14/5 +f 138/16/6 142/318/6 152/17/6 +f 10/19/7 11/319/7 12/20/7 +f 167/22/8 165/320/8 163/23/8 +f 13/25/33 14/321/33 155/26/33 +f 164/28/10 15/322/10 161/29/10 +f 162/31/34 166/323/34 16/32/34 +f 154/34/6 158/324/6 168/35/6 +f 18/37/1 19/325/1 20/38/1 +f 183/40/2 181/326/2 179/41/2 +f 21/43/3 22/327/3 171/44/3 +f 180/46/4 23/328/4 177/47/4 +f 178/49/5 182/329/5 24/50/5 +f 170/52/6 174/330/6 184/53/6 +f 26/55/12 27/331/12 28/56/12 +f 199/58/2 197/332/2 195/59/2 +f 29/61/3 30/333/3 187/62/3 +f 196/64/13 31/334/13 193/65/13 +f 194/67/5 198/335/5 32/68/5 +f 186/70/14 190/336/14 200/71/14 +f 40/73/15 37/337/15 203/74/15 +f 34/76/16 33/338/16 209/77/16 +f 39/79/17 35/339/17 201/80/17 +f 215/82/18 207/340/18 205/83/18 +f 204/85/2 202/341/2 206/86/2 +f 214/88/1 212/342/1 210/89/1 +f 106/91/3 105/343/3 221/92/3 +f 44/94/6 349/344/6 108/95/6 +f 45/97/1 46/345/1 47/98/1 +f 239/100/2 237/346/2 235/101/2 +f 49/103/5 50/347/5 227/104/5 +f 236/106/6 51/348/6 233/107/6 +f 238/109/3 52/349/3 229/110/3 +f 226/112/4 230/350/4 240/113/4 +f 54/115/1 55/351/1 56/116/1 +f 255/118/2 253/352/2 251/119/2 +f 57/121/5 58/353/5 243/122/5 +f 252/124/6 59/354/6 249/125/6 +f 254/127/3 60/355/3 245/128/3 +f 242/130/4 246/356/4 256/131/4 +f 75/133/20 63/357/20 61/134/20 +f 74/136/21 78/358/21 62/137/21 +f 263/139/22 265/359/22 257/140/22 +f 267/142/4 275/360/4 258/143/4 +f 66/145/1 67/361/1 68/146/1 +f 291/148/2 289/362/2 287/149/2 +f 69/151/3 70/363/3 279/152/3 +f 288/154/4 71/364/4 285/155/4 +f 290/157/5 72/365/5 281/158/5 +f 278/160/6 282/366/6 292/161/6 +f 262/163/1 260/367/1 76/164/1 +f 299/166/2 272/368/2 269/167/2 +f 77/169/3 271/369/3 264/170/3 +f 270/172/23 273/370/23 276/173/23 +f 274/175/5 80/371/5 295/176/5 +f 298/178/6 294/372/6 296/179/6 +f 88/181/6 85/373/6 303/182/6 +f 82/184/5 81/374/5 309/185/5 +f 83/187/4 301/375/4 311/188/4 +f 307/190/3 305/376/3 313/191/3 +f 304/193/2 302/377/2 306/194/2 +f 314/196/1 312/378/1 310/197/1 +f 96/199/6 93/379/6 319/200/6 +f 90/202/5 89/380/5 325/203/5 +f 95/205/4 91/381/4 317/206/4 +f 323/208/3 321/382/3 329/209/3 +f 320/211/2 318/383/2 322/212/2 +f 332/214/1 330/384/1 328/215/1 +f 335/217/4 101/385/4 104/218/4 +f 102/220/5 341/386/5 97/221/5 +f 343/223/25 333/387/25 99/224/25 +f 345/226/35 337/388/35 339/227/35 +f 338/229/26 334/389/26 336/230/26 +f 342/232/1 344/390/1 346/233/1 +f 351/235/27 43/391/27 219/236/27 +f 353/238/36 42/392/36 41/239/36 +f 220/241/28 224/393/28 222/242/28 +f 350/244/1 352/394/1 354/245/1 +f 116/247/29 113/395/29 359/248/29 +f 110/250/30 109/396/30 365/251/30 +f 115/253/31 111/397/31 357/254/31 +f 371/256/32 363/398/32 361/257/32 +f 360/259/2 358/399/2 362/260/2 +f 370/262/1 368/400/1 366/263/1 +f 131/265/20 119/401/20 117/266/20 +f 130/268/21 134/402/21 118/269/21 +f 379/271/22 381/403/22 373/272/22 +f 383/274/4 391/404/4 374/275/4 +f 122/277/1 123/405/1 124/278/1 +f 407/280/2 405/406/2 403/281/2 +f 125/283/5 126/407/5 395/284/5 +f 404/286/6 127/408/6 401/287/6 +f 406/289/3 128/409/3 397/290/3 +f 394/292/4 398/410/4 408/293/4 +f 378/295/1 376/411/1 132/296/1 +f 415/298/2 388/412/2 385/299/2 +f 133/301/3 387/413/3 380/302/3 +f 386/304/23 389/414/23 392/305/23 +f 390/307/5 136/415/5 411/308/5 +f 414/310/6 410/416/6 412/311/6 diff --git a/res/person_-yfw_zup.mtl b/res/person_-yfw_zup.mtl new file mode 100644 index 0000000..036f4e5 --- /dev/null +++ b/res/person_-yfw_zup.mtl @@ -0,0 +1,12 @@ +# Blender MTL File: 'person.blend' +# Material Count: 1 + +newmtl Material +Ns 225.000000 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 diff --git a/res/person_-yfw_zup.obj b/res/person_-yfw_zup.obj new file mode 100644 index 0000000..bb4d59f --- /dev/null +++ b/res/person_-yfw_zup.obj @@ -0,0 +1,1082 @@ +# Blender v2.82 (sub 7) OBJ File: 'person.blend' +# www.blender.org +mtllib person_-yfx_zup.mtl +o Cube +v -0.137915 -0.140106 1.371506 +v -0.137915 0.159643 1.371506 +v 0.134483 0.159643 1.371506 +v 0.134483 -0.140106 1.371506 +v -0.137915 -0.140106 1.690793 +v -0.137915 0.159643 1.690793 +v 0.134483 0.159643 1.690793 +v 0.134483 -0.140106 1.690793 +v -0.245470 -0.107544 1.159527 +v -0.182522 0.137664 1.164427 +v 0.179090 0.137664 1.164427 +v 0.242038 -0.107544 1.159527 +v -0.245470 -0.107544 1.322872 +v -0.182522 0.154759 1.298842 +v 0.179090 0.154759 1.298842 +v 0.242038 -0.107544 1.322872 +v -0.194088 -0.109407 0.942349 +v -0.194088 0.111849 0.942349 +v 0.190656 0.111849 0.942349 +v 0.190656 -0.109407 0.942349 +v -0.194088 -0.109407 1.128210 +v -0.194088 0.111849 1.128210 +v 0.190656 0.111849 1.128210 +v 0.190656 -0.109407 1.128210 +v -0.194088 -0.084985 0.716899 +v -0.194088 0.083357 0.720969 +v 0.190656 0.083357 0.720969 +v 0.190656 -0.084985 0.716899 +v -0.194088 -0.109407 0.892585 +v -0.194088 0.103709 0.892585 +v 0.190656 0.103708 0.892585 +v 0.190656 -0.109407 0.892585 +v 0.172616 -0.069651 0.682076 +v 0.172616 0.052053 0.682076 +v 0.042927 0.052053 0.682076 +v 0.042926 -0.069651 0.682076 +v 0.173759 -0.045307 0.399351 +v 0.173759 0.045307 0.399351 +v 0.071915 0.045307 0.399351 +v 0.071915 -0.045307 0.399351 +v -0.254310 -0.019392 0.656924 +v -0.272794 0.019795 0.656135 +v -0.379026 0.019795 0.656135 +v -0.381202 -0.019392 0.656924 +v -0.280992 0.038805 0.690410 +v -0.280992 -0.037009 0.690410 +v -0.368588 -0.037009 0.690410 +v -0.368588 0.038805 0.690410 +v -0.280992 0.038805 0.947029 +v -0.280992 -0.037009 0.947029 +v -0.368588 -0.037009 0.947029 +v -0.368588 0.038805 0.947029 +v -0.264044 0.046205 0.971325 +v -0.264044 -0.044409 0.971325 +v -0.378502 -0.044409 0.971325 +v -0.378502 0.046205 0.971325 +v -0.264044 0.046205 1.278038 +v -0.264044 -0.044409 1.278038 +v -0.378502 -0.044409 1.278038 +v -0.378502 0.046205 1.278038 +v 0.142852 0.151134 0.053860 +v 0.101650 0.151134 0.053860 +v 0.142852 0.151134 0.001768 +v 0.101650 0.151134 0.001768 +v 0.068399 -0.045307 0.107456 +v 0.068399 0.045307 0.107456 +v 0.170242 0.045307 0.107456 +v 0.170242 -0.045307 0.107456 +v 0.068399 -0.045307 0.373509 +v 0.068399 0.045307 0.373509 +v 0.170242 0.045307 0.373509 +v 0.170242 -0.045307 0.373509 +v 0.074260 -0.045307 -0.000749 +v 0.074260 0.037166 -0.000749 +v 0.170242 0.037166 -0.000749 +v 0.170242 -0.045307 -0.000749 +v 0.074260 -0.045307 0.080799 +v 0.074260 0.037166 0.080799 +v 0.170242 0.037166 0.080799 +v 0.170242 -0.045307 0.080799 +v 0.375545 -0.045307 1.280073 +v 0.375545 0.045307 1.280073 +v 0.261087 0.045307 1.280073 +v 0.261087 -0.045307 1.280073 +v 0.375545 -0.045307 0.973359 +v 0.375545 0.045307 0.973359 +v 0.261087 0.045307 0.973359 +v 0.261087 -0.045307 0.973359 +v 0.365631 -0.037907 0.949064 +v 0.365631 0.037907 0.949064 +v 0.278035 0.037907 0.949064 +v 0.278035 -0.037907 0.949064 +v 0.365631 -0.037907 0.692445 +v 0.365631 0.037907 0.692445 +v 0.278035 0.037907 0.692445 +v 0.278035 -0.037907 0.692445 +v 0.378245 0.020290 0.658959 +v 0.376069 -0.018897 0.658170 +v 0.269837 -0.018897 0.658170 +v 0.251353 0.020290 0.658959 +v 0.378245 0.020290 0.553501 +v 0.378245 -0.016297 0.553501 +v 0.251353 -0.016297 0.553501 +v 0.251353 0.020290 0.553501 +v -0.381202 -0.019392 0.551466 +v -0.381202 0.017195 0.551466 +v -0.254310 0.017195 0.551466 +v -0.254310 -0.019392 0.551466 +v -0.167755 0.107992 0.682076 +v -0.167755 -0.013712 0.682076 +v -0.038066 -0.013712 0.682076 +v -0.038066 0.107992 0.682076 +v -0.168898 0.083648 0.399351 +v -0.168898 -0.006966 0.399351 +v -0.067055 -0.006966 0.399351 +v -0.067055 0.083648 0.399351 +v -0.096789 0.151185 0.053860 +v -0.137991 0.151185 0.053860 +v -0.096789 0.151185 0.001768 +v -0.137991 0.151185 0.001768 +v -0.063538 0.083648 0.107456 +v -0.063538 -0.006966 0.107456 +v -0.165381 -0.006966 0.107456 +v -0.165381 0.083648 0.107456 +v -0.063538 0.083648 0.373509 +v -0.063538 -0.006966 0.373509 +v -0.165381 -0.006966 0.373509 +v -0.165381 0.083648 0.373509 +v -0.165381 -0.045255 -0.000749 +v -0.165381 0.037218 -0.000749 +v -0.069399 0.037218 -0.000749 +v -0.069399 -0.045255 -0.000749 +v -0.165381 -0.045255 0.080799 +v -0.165381 0.037218 0.080799 +v -0.069399 0.037218 0.080799 +v -0.069399 -0.045255 0.080799 +v -0.137915 -0.140106 1.371506 +v -0.137915 -0.140106 1.371506 +v -0.137915 0.159643 1.371506 +v -0.137915 0.159643 1.371506 +v 0.134483 -0.140106 1.371506 +v 0.134483 -0.140106 1.371506 +v -0.137915 -0.140106 1.690793 +v -0.137915 -0.140106 1.690793 +v 0.134483 0.159643 1.371506 +v 0.134483 0.159643 1.371506 +v -0.137915 0.159643 1.690793 +v -0.137915 0.159643 1.690793 +v 0.134483 0.159643 1.690793 +v 0.134483 0.159643 1.690793 +v 0.134483 -0.140106 1.690793 +v 0.134483 -0.140106 1.690793 +v -0.245470 -0.107544 1.159527 +v -0.245470 -0.107544 1.159527 +v -0.182522 0.137664 1.164427 +v -0.182522 0.137664 1.164427 +v 0.242038 -0.107544 1.159527 +v 0.242038 -0.107544 1.159527 +v -0.245470 -0.107544 1.322872 +v -0.245470 -0.107544 1.322872 +v 0.179090 0.137664 1.164427 +v 0.179090 0.137664 1.164427 +v -0.182522 0.154759 1.298842 +v -0.182522 0.154759 1.298842 +v 0.179090 0.154759 1.298842 +v 0.179090 0.154759 1.298842 +v 0.242038 -0.107544 1.322872 +v 0.242038 -0.107544 1.322872 +v -0.194088 -0.109407 0.942349 +v -0.194088 -0.109407 0.942349 +v -0.194088 0.111849 0.942349 +v -0.194088 0.111849 0.942349 +v 0.190656 -0.109407 0.942349 +v 0.190656 -0.109407 0.942349 +v -0.194088 -0.109407 1.128210 +v -0.194088 -0.109407 1.128210 +v 0.190656 0.111849 0.942349 +v 0.190656 0.111849 0.942349 +v -0.194088 0.111849 1.128210 +v -0.194088 0.111849 1.128210 +v 0.190656 0.111849 1.128210 +v 0.190656 0.111849 1.128210 +v 0.190656 -0.109407 1.128210 +v 0.190656 -0.109407 1.128210 +v -0.194088 -0.084985 0.716899 +v -0.194088 -0.084985 0.716899 +v -0.194088 0.083357 0.720969 +v -0.194088 0.083357 0.720969 +v 0.190656 -0.084985 0.716899 +v 0.190656 -0.084985 0.716899 +v -0.194088 -0.109407 0.892585 +v -0.194088 -0.109407 0.892585 +v 0.190656 0.083357 0.720969 +v 0.190656 0.083357 0.720969 +v -0.194088 0.103709 0.892585 +v -0.194088 0.103709 0.892585 +v 0.190656 0.103708 0.892585 +v 0.190656 0.103708 0.892585 +v 0.190656 -0.109407 0.892585 +v 0.190656 -0.109407 0.892585 +v 0.172616 0.052053 0.682076 +v 0.172616 0.052053 0.682076 +v 0.172616 -0.069651 0.682076 +v 0.172616 -0.069651 0.682076 +v 0.042927 0.052053 0.682076 +v 0.042927 0.052053 0.682076 +v 0.042926 -0.069651 0.682076 +v 0.042926 -0.069651 0.682076 +v 0.173759 -0.045307 0.399351 +v 0.173759 -0.045307 0.399351 +v 0.173759 0.045307 0.399351 +v 0.173759 0.045307 0.399351 +v 0.071915 0.045307 0.399351 +v 0.071915 0.045307 0.399351 +v 0.071915 -0.045307 0.399351 +v 0.071915 -0.045307 0.399351 +v -0.254310 -0.019392 0.656924 +v -0.254310 -0.019392 0.656924 +v -0.272794 0.019795 0.656135 +v -0.272794 0.019795 0.656135 +v -0.381202 -0.019392 0.656924 +v -0.381202 -0.019392 0.656924 +v -0.379026 0.019795 0.656135 +v -0.379026 0.019795 0.656135 +v -0.280992 0.038805 0.690410 +v -0.280992 0.038805 0.690410 +v -0.280992 -0.037009 0.690410 +v -0.280992 -0.037009 0.690410 +v -0.368588 0.038805 0.690410 +v -0.368588 0.038805 0.690410 +v -0.280992 0.038805 0.947029 +v -0.280992 0.038805 0.947029 +v -0.368588 -0.037009 0.690410 +v -0.368588 -0.037009 0.690410 +v -0.280992 -0.037009 0.947029 +v -0.280992 -0.037009 0.947029 +v -0.368588 -0.037009 0.947029 +v -0.368588 -0.037009 0.947029 +v -0.368588 0.038805 0.947029 +v -0.368588 0.038805 0.947029 +v -0.264044 0.046205 0.971325 +v -0.264044 0.046205 0.971325 +v -0.264044 -0.044409 0.971325 +v -0.264044 -0.044409 0.971325 +v -0.378502 0.046205 0.971325 +v -0.378502 0.046205 0.971325 +v -0.264044 0.046205 1.278038 +v -0.264044 0.046205 1.278038 +v -0.378502 -0.044409 0.971325 +v -0.378502 -0.044409 0.971325 +v -0.264044 -0.044409 1.278038 +v -0.264044 -0.044409 1.278038 +v -0.378502 -0.044409 1.278038 +v -0.378502 -0.044409 1.278038 +v -0.378502 0.046205 1.278038 +v -0.378502 0.046205 1.278038 +v 0.142852 0.151134 0.001768 +v 0.142852 0.151134 0.001768 +v 0.170242 0.037166 -0.000749 +v 0.170242 0.037166 -0.000749 +v 0.170242 0.037166 -0.000749 +v 0.074260 0.037166 -0.000749 +v 0.074260 0.037166 -0.000749 +v 0.074260 0.037166 -0.000749 +v 0.101650 0.151134 0.001768 +v 0.101650 0.151134 0.001768 +v 0.101650 0.151134 0.053860 +v 0.101650 0.151134 0.053860 +v 0.074260 0.037166 0.080799 +v 0.074260 0.037166 0.080799 +v 0.074260 0.037166 0.080799 +v 0.170242 0.037166 0.080799 +v 0.170242 0.037166 0.080799 +v 0.170242 0.037166 0.080799 +v 0.142852 0.151134 0.053860 +v 0.142852 0.151134 0.053860 +v 0.068399 -0.045307 0.107456 +v 0.068399 -0.045307 0.107456 +v 0.068399 0.045307 0.107456 +v 0.068399 0.045307 0.107456 +v 0.170242 -0.045307 0.107456 +v 0.170242 -0.045307 0.107456 +v 0.068399 -0.045307 0.373509 +v 0.068399 -0.045307 0.373509 +v 0.170242 0.045307 0.107456 +v 0.170242 0.045307 0.107456 +v 0.068399 0.045307 0.373509 +v 0.068399 0.045307 0.373509 +v 0.170242 0.045307 0.373509 +v 0.170242 0.045307 0.373509 +v 0.170242 -0.045307 0.373509 +v 0.170242 -0.045307 0.373509 +v 0.074260 -0.045307 -0.000749 +v 0.074260 -0.045307 -0.000749 +v 0.170242 -0.045307 -0.000749 +v 0.170242 -0.045307 -0.000749 +v 0.074260 -0.045307 0.080799 +v 0.074260 -0.045307 0.080799 +v 0.170242 -0.045307 0.080799 +v 0.170242 -0.045307 0.080799 +v 0.375545 0.045307 1.280073 +v 0.375545 0.045307 1.280073 +v 0.375545 -0.045307 1.280073 +v 0.375545 -0.045307 1.280073 +v 0.261087 0.045307 1.280073 +v 0.261087 0.045307 1.280073 +v 0.261087 -0.045307 1.280073 +v 0.261087 -0.045307 1.280073 +v 0.375545 -0.045307 0.973359 +v 0.375545 -0.045307 0.973359 +v 0.375545 0.045307 0.973359 +v 0.375545 0.045307 0.973359 +v 0.261087 0.045307 0.973359 +v 0.261087 0.045307 0.973359 +v 0.261087 -0.045307 0.973359 +v 0.261087 -0.045307 0.973359 +v 0.365631 0.037907 0.949064 +v 0.365631 0.037907 0.949064 +v 0.365631 -0.037907 0.949064 +v 0.365631 -0.037907 0.949064 +v 0.278035 0.037907 0.949064 +v 0.278035 0.037907 0.949064 +v 0.278035 -0.037907 0.949064 +v 0.278035 -0.037907 0.949064 +v 0.365631 -0.037907 0.692445 +v 0.365631 -0.037907 0.692445 +v 0.365631 0.037907 0.692445 +v 0.365631 0.037907 0.692445 +v 0.278035 0.037907 0.692445 +v 0.278035 0.037907 0.692445 +v 0.278035 -0.037907 0.692445 +v 0.278035 -0.037907 0.692445 +v 0.376069 -0.018897 0.658170 +v 0.376069 -0.018897 0.658170 +v 0.378245 0.020290 0.658959 +v 0.378245 0.020290 0.658959 +v 0.269837 -0.018897 0.658170 +v 0.269837 -0.018897 0.658170 +v 0.251353 0.020290 0.658959 +v 0.251353 0.020290 0.658959 +v 0.378245 0.020290 0.553501 +v 0.378245 0.020290 0.553501 +v 0.378245 -0.016297 0.553501 +v 0.378245 -0.016297 0.553501 +v 0.251353 -0.016297 0.553501 +v 0.251353 -0.016297 0.553501 +v 0.251353 0.020290 0.553501 +v 0.251353 0.020290 0.553501 +v -0.381202 -0.019392 0.551466 +v -0.381202 -0.019392 0.551466 +v -0.381202 0.017195 0.551466 +v -0.381202 0.017195 0.551466 +v -0.254310 0.017195 0.551466 +v -0.254310 0.017195 0.551466 +v -0.254310 -0.019392 0.551466 +v -0.254310 -0.019392 0.551466 +v -0.167755 -0.013712 0.682076 +v -0.167755 -0.013712 0.682076 +v -0.167755 0.107992 0.682076 +v -0.167755 0.107992 0.682076 +v -0.038066 -0.013712 0.682076 +v -0.038066 -0.013712 0.682076 +v -0.038066 0.107992 0.682076 +v -0.038066 0.107992 0.682076 +v -0.168898 0.083648 0.399351 +v -0.168898 0.083648 0.399351 +v -0.168898 -0.006966 0.399351 +v -0.168898 -0.006966 0.399351 +v -0.067055 -0.006966 0.399351 +v -0.067055 -0.006966 0.399351 +v -0.067055 0.083648 0.399351 +v -0.067055 0.083648 0.399351 +v -0.096789 0.151185 0.001768 +v -0.096789 0.151185 0.001768 +v -0.069399 0.037218 -0.000749 +v -0.069399 0.037218 -0.000749 +v -0.069399 0.037218 -0.000749 +v -0.165381 0.037218 -0.000749 +v -0.165381 0.037218 -0.000749 +v -0.165381 0.037218 -0.000749 +v -0.137991 0.151185 0.001768 +v -0.137991 0.151185 0.001768 +v -0.137991 0.151185 0.053860 +v -0.137991 0.151185 0.053860 +v -0.165381 0.037218 0.080799 +v -0.165381 0.037218 0.080799 +v -0.165381 0.037218 0.080799 +v -0.069399 0.037218 0.080799 +v -0.069399 0.037218 0.080799 +v -0.069399 0.037218 0.080799 +v -0.096789 0.151185 0.053860 +v -0.096789 0.151185 0.053860 +v -0.063538 0.083648 0.107456 +v -0.063538 0.083648 0.107456 +v -0.063538 -0.006966 0.107456 +v -0.063538 -0.006966 0.107456 +v -0.165381 0.083648 0.107456 +v -0.165381 0.083648 0.107456 +v -0.063538 0.083648 0.373509 +v -0.063538 0.083648 0.373509 +v -0.165381 -0.006966 0.107456 +v -0.165381 -0.006966 0.107456 +v -0.063538 -0.006966 0.373509 +v -0.063538 -0.006966 0.373509 +v -0.165381 -0.006966 0.373509 +v -0.165381 -0.006966 0.373509 +v -0.165381 0.083648 0.373509 +v -0.165381 0.083648 0.373509 +v -0.165381 -0.045255 -0.000749 +v -0.165381 -0.045255 -0.000749 +v -0.069399 -0.045255 -0.000749 +v -0.069399 -0.045255 -0.000749 +v -0.165381 -0.045255 0.080799 +v -0.165381 -0.045255 0.080799 +v -0.069399 -0.045255 0.080799 +v -0.069399 -0.045255 0.080799 +vt 0.301084 0.898775 +vt 0.263915 0.864997 +vt 0.301084 0.864997 +vt 0.246117 0.945214 +vt 0.210155 0.984786 +vt 0.210155 0.945214 +vt 0.298167 0.990239 +vt 0.168562 0.858032 +vt 0.299105 0.858965 +vt 0.113315 0.996881 +vt 0.003376 0.876869 +vt 0.112768 0.877416 +vt 0.295353 0.991034 +vt 0.170418 0.857237 +vt 0.295711 0.857574 +vt 0.170180 0.858625 +vt 0.296549 0.990344 +vt 0.169461 0.989647 +vt 0.576198 0.825848 +vt 0.599841 0.839506 +vt 0.572693 0.839506 +vt 0.599841 0.839521 +vt 0.576198 0.854189 +vt 0.572693 0.839521 +vt 0.557656 0.830410 +vt 0.571753 0.839233 +vt 0.557656 0.839506 +vt 0.624910 0.967000 +vt 0.412590 0.890282 +vt 0.624910 0.890282 +vt 0.563854 0.811735 +vt 0.572677 0.825833 +vt 0.563581 0.825833 +vt 0.572693 0.816737 +vt 0.599841 0.825833 +vt 0.572693 0.825833 +vt 0.556543 0.853457 +vt 0.576402 0.818924 +vt 0.576402 0.853457 +vt 0.556543 0.818902 +vt 0.591076 0.799043 +vt 0.591076 0.818902 +vt 0.596283 0.852311 +vt 0.576424 0.835629 +vt 0.596283 0.835629 +vt 0.627747 0.871772 +vt 0.414753 0.768879 +vt 0.627747 0.768879 +vt 0.591098 0.818902 +vt 0.610957 0.802220 +vt 0.610957 0.818902 +vt 0.610957 0.835606 +vt 0.576424 0.818924 +vt 0.610957 0.818924 +vt 0.226026 0.626590 +vt 0.196474 0.613656 +vt 0.226026 0.613656 +vt 0.567623 0.819520 +vt 0.617377 0.791961 +vt 0.617377 0.819520 +vt 0.291159 0.690560 +vt 0.033068 0.599186 +vt 0.295337 0.600091 +vt 0.632045 0.700493 +vt 0.362955 0.606258 +vt 0.632045 0.606258 +vt 0.293610 0.596686 +vt 0.034268 0.690560 +vt 0.032591 0.595091 +vt 0.031455 0.596772 +vt 0.296045 0.694323 +vt 0.031455 0.694323 +vt 0.759010 0.705606 +vt 0.783060 0.696962 +vt 0.783105 0.707969 +vt 0.790805 0.696922 +vt 0.782542 0.672926 +vt 0.790232 0.672926 +vt 0.767619 0.672926 +vt 0.759072 0.696929 +vt 0.758975 0.672926 +vt 0.756876 0.697969 +vt 0.748613 0.722091 +vt 0.749185 0.697969 +vt 0.758975 0.718332 +vt 0.769983 0.708002 +vt 0.769983 0.718332 +vt 0.790838 0.681570 +vt 0.798529 0.672926 +vt 0.798529 0.681570 +vt 0.791139 0.570182 +vt 0.794302 0.578756 +vt 0.791088 0.578756 +vt 0.770277 0.578774 +vt 0.778912 0.589164 +vt 0.770277 0.589164 +vt 0.175577 0.338748 +vt 0.187091 0.328783 +vt 0.187091 0.338748 +vt 0.166866 0.426092 +vt 0.150801 0.439997 +vt 0.150801 0.426093 +vt 0.184845 0.502417 +vt 0.120743 0.302583 +vt 0.184845 0.302583 +vt 0.188247 0.500113 +vt 0.120753 0.302387 +vt 0.188247 0.302387 +vt 0.184881 0.502481 +vt 0.121715 0.305019 +vt 0.184881 0.305019 +vt 0.119055 0.303687 +vt 0.187368 0.503813 +vt 0.119055 0.503813 +vt 0.575306 0.820491 +vt 0.579059 0.823462 +vt 0.575306 0.823462 +vt 0.590360 0.817506 +vt 0.586606 0.820478 +vt 0.586606 0.817506 +vt 0.582829 0.827564 +vt 0.579857 0.817506 +vt 0.582829 0.817506 +vt 0.582829 0.817494 +vt 0.579075 0.807436 +vt 0.582829 0.807436 +vt 0.593343 0.827564 +vt 0.590372 0.817506 +vt 0.593343 0.817506 +vt 0.586606 0.807436 +vt 0.590360 0.817494 +vt 0.586606 0.817494 +vt 0.731486 0.888933 +vt 0.733884 0.883787 +vt 0.735067 0.888933 +vt 0.740230 0.888017 +vt 0.735083 0.890415 +vt 0.735083 0.888127 +vt 0.744319 0.882843 +vt 0.739313 0.879832 +vt 0.744318 0.878629 +vt 0.749740 0.882843 +vt 0.747930 0.880556 +vt 0.749740 0.880556 +vt 0.781131 0.598629 +vt 0.768032 0.586975 +vt 0.781131 0.586975 +vt 0.770313 0.709942 +vt 0.794126 0.688754 +vt 0.794126 0.709942 +vt 0.809332 0.729476 +vt 0.744045 0.558024 +vt 0.809332 0.558024 +vt 0.808470 0.725739 +vt 0.740971 0.556761 +vt 0.808470 0.556761 +vt 0.807944 0.733991 +vt 0.746230 0.553509 +vt 0.807944 0.553510 +vt 0.745468 0.553295 +vt 0.808058 0.731706 +vt 0.745468 0.731706 +vt 0.748056 0.895275 +vt 0.743841 0.891654 +vt 0.748056 0.891654 +vt 0.743841 0.891638 +vt 0.748056 0.888017 +vt 0.748056 0.891638 +vt 0.747463 0.898871 +vt 0.743841 0.895290 +vt 0.747463 0.895290 +vt 0.730853 0.878629 +vt 0.733865 0.883771 +vt 0.732055 0.883771 +vt 0.731446 0.893179 +vt 0.735067 0.896760 +vt 0.731446 0.896760 +vt 0.743826 0.893179 +vt 0.739611 0.896760 +vt 0.739611 0.893179 +vt 0.582841 0.807436 +vt 0.586594 0.817494 +vt 0.582841 0.817494 +vt 0.585812 0.827564 +vt 0.582841 0.817506 +vt 0.585812 0.817506 +vt 0.579059 0.817495 +vt 0.575309 0.807436 +vt 0.579063 0.807437 +vt 0.593343 0.817494 +vt 0.590372 0.807436 +vt 0.593343 0.807436 +vt 0.575306 0.820479 +vt 0.579059 0.817507 +vt 0.579059 0.820479 +vt 0.586606 0.824243 +vt 0.589578 0.820490 +vt 0.589578 0.824243 +vt 0.121402 0.304666 +vt 0.185598 0.500333 +vt 0.121402 0.500333 +vt 0.182717 0.501312 +vt 0.121549 0.308688 +vt 0.182717 0.308688 +vt 0.187111 0.301938 +vt 0.119312 0.500562 +vt 0.119312 0.301938 +vt 0.187748 0.503826 +vt 0.118008 0.303674 +vt 0.187748 0.303674 +vt 0.150801 0.453907 +vt 0.166866 0.440003 +vt 0.166866 0.453907 +vt 0.187091 0.338752 +vt 0.175577 0.348717 +vt 0.175577 0.338752 +vt 0.770277 0.578758 +vt 0.780666 0.570124 +vt 0.780666 0.578758 +vt 0.770495 0.589180 +vt 0.773491 0.597814 +vt 0.770277 0.597751 +vt 0.780683 0.578696 +vt 0.789559 0.570124 +vt 0.791072 0.578696 +vt 0.796424 0.578964 +vt 0.792887 0.587391 +vt 0.793435 0.578774 +vt 0.787804 0.593801 +vt 0.778928 0.590592 +vt 0.789317 0.590592 +vt 0.789334 0.593588 +vt 0.799723 0.590592 +vt 0.799723 0.593588 +vt 0.789317 0.578778 +vt 0.780438 0.587347 +vt 0.778928 0.578774 +vt 0.792871 0.578964 +vt 0.789334 0.587391 +vt 0.789881 0.578774 +vt 0.780441 0.587367 +vt 0.789317 0.590576 +vt 0.778928 0.590576 +vt 0.789317 0.593818 +vt 0.778928 0.596813 +vt 0.778928 0.593818 +vt 0.785501 0.696997 +vt 0.794145 0.721047 +vt 0.783138 0.721091 +vt 0.780442 0.696922 +vt 0.772179 0.672926 +vt 0.779870 0.672926 +vt 0.758942 0.673807 +vt 0.747992 0.696813 +vt 0.750343 0.672926 +vt 0.802441 0.696962 +vt 0.794178 0.721084 +vt 0.794751 0.696962 +vt 0.781023 0.708002 +vt 0.770016 0.718332 +vt 0.770016 0.708002 +vt 0.790838 0.689231 +vt 0.799482 0.696922 +vt 0.790838 0.696922 +vt 0.740245 0.893163 +vt 0.742643 0.888017 +vt 0.743826 0.893163 +vt 0.745251 0.883787 +vt 0.740104 0.886185 +vt 0.740104 0.883897 +vt 0.740089 0.888001 +vt 0.735083 0.884990 +vt 0.740088 0.883787 +vt 0.749287 0.897578 +vt 0.747478 0.895290 +vt 0.749287 0.895290 +vt 0.779686 0.573871 +vt 0.768032 0.586970 +vt 0.768032 0.573871 +vt 0.794126 0.667558 +vt 0.770313 0.688745 +vt 0.770313 0.667558 +vt 0.805381 0.731063 +vt 0.745906 0.556437 +vt 0.805381 0.556437 +vt 0.807928 0.729083 +vt 0.745338 0.555917 +vt 0.807928 0.555916 +vt 0.809803 0.730338 +vt 0.744781 0.557162 +vt 0.809803 0.557162 +vt 0.741303 0.554896 +vt 0.811047 0.730104 +vt 0.741303 0.730104 +vt 0.731446 0.893163 +vt 0.735067 0.888949 +vt 0.735067 0.893163 +vt 0.735083 0.895234 +vt 0.739297 0.891613 +vt 0.739297 0.895234 +vt 0.739297 0.898831 +vt 0.735676 0.895250 +vt 0.739297 0.895250 +vt 0.735083 0.878629 +vt 0.738095 0.883771 +vt 0.736286 0.883771 +vt 0.745266 0.883787 +vt 0.748888 0.887367 +vt 0.745266 0.887367 +vt 0.744334 0.878629 +vt 0.747915 0.882843 +vt 0.744334 0.882843 +vt 0.263915 0.898775 +vt 0.246117 0.984786 +vt 0.167624 0.989306 +vt 0.003376 0.999381 +vt 0.170059 0.990697 +vt 0.297268 0.859323 +vt 0.596335 0.825848 +vt 0.596335 0.854189 +vt 0.572677 0.831744 +vt 0.412590 0.967000 +vt 0.571343 0.810811 +vt 0.599841 0.816737 +vt 0.556543 0.818924 +vt 0.556543 0.799043 +vt 0.576424 0.852311 +vt 0.414753 0.871772 +vt 0.591098 0.802220 +vt 0.576424 0.835606 +vt 0.196474 0.626590 +vt 0.567623 0.791961 +vt 0.035091 0.693060 +vt 0.362955 0.700493 +vt 0.295337 0.693060 +vt 0.296045 0.596772 +vt 0.758975 0.696962 +vt 0.780476 0.696922 +vt 0.770080 0.696929 +vt 0.758942 0.722091 +vt 0.758975 0.708002 +vt 0.790838 0.672926 +vt 0.794134 0.570124 +vt 0.778912 0.578774 +vt 0.175577 0.328783 +vt 0.166866 0.439997 +vt 0.120744 0.502417 +vt 0.120753 0.500113 +vt 0.121715 0.502481 +vt 0.187368 0.303687 +vt 0.579059 0.820491 +vt 0.590360 0.820478 +vt 0.579857 0.827564 +vt 0.579075 0.817494 +vt 0.590372 0.827564 +vt 0.590360 0.807436 +vt 0.731597 0.883787 +vt 0.740230 0.891597 +vt 0.739313 0.881641 +vt 0.747930 0.882843 +vt 0.768032 0.598629 +vt 0.770313 0.688754 +vt 0.744045 0.729476 +vt 0.740971 0.725739 +vt 0.746230 0.733990 +vt 0.808059 0.553295 +vt 0.743841 0.895275 +vt 0.743841 0.888017 +vt 0.743841 0.898871 +vt 0.735067 0.878629 +vt 0.735067 0.893179 +vt 0.743826 0.896760 +vt 0.586594 0.807436 +vt 0.582841 0.827564 +vt 0.575306 0.817494 +vt 0.590372 0.817494 +vt 0.575306 0.817507 +vt 0.586606 0.820490 +vt 0.185598 0.304666 +vt 0.121549 0.501312 +vt 0.187111 0.500562 +vt 0.118008 0.503826 +vt 0.150801 0.440003 +vt 0.187091 0.348717 +vt 0.770277 0.570124 +vt 0.773491 0.589180 +vt 0.780861 0.570124 +vt 0.796424 0.587669 +vt 0.779106 0.593801 +vt 0.789334 0.590592 +vt 0.789136 0.587350 +vt 0.792871 0.587669 +vt 0.789139 0.587367 +vt 0.789317 0.596813 +vt 0.794145 0.696962 +vt 0.770113 0.696922 +vt 0.758942 0.697936 +vt 0.804508 0.721084 +vt 0.781023 0.718332 +vt 0.799482 0.689231 +vt 0.740356 0.888017 +vt 0.745251 0.887367 +vt 0.735083 0.886799 +vt 0.747478 0.897578 +vt 0.779686 0.586970 +vt 0.794126 0.688745 +vt 0.745906 0.731063 +vt 0.745338 0.729084 +vt 0.744781 0.730338 +vt 0.811047 0.554896 +vt 0.731446 0.888949 +vt 0.735083 0.891613 +vt 0.735676 0.898831 +vt 0.739297 0.878629 +vt 0.748888 0.883787 +vt 0.747915 0.878629 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 -0.0000 +vn 0.0000 1.0000 -0.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 -1.0000 0.0000 +vn 0.0000 0.0200 -0.9998 +vn -0.0000 0.0912 0.9958 +vn -0.9686 0.2486 -0.0000 +vn 0.0000 0.9920 -0.1262 +vn 0.9686 0.2486 -0.0000 +vn -0.0000 0.0242 -0.9997 +vn 0.0000 0.9930 -0.1178 +vn -0.0000 -0.9905 -0.1377 +vn -0.0000 -0.9963 -0.0858 +vn 1.0000 -0.0000 0.0040 +vn 0.0000 0.9997 -0.0239 +vn -0.9948 0.0000 -0.1020 +vn -0.9983 0.0558 0.0194 +vn 0.9723 0.2337 -0.0000 +vn -0.9723 0.2337 0.0000 +vn 0.0000 0.0221 -0.9998 +vn 0.0000 0.2300 0.9732 +vn 0.9983 -0.0558 0.0194 +vn 0.0000 -0.9997 -0.0248 +vn 0.0000 -0.0201 0.9998 +vn 0.0000 0.9997 -0.0248 +vn 0.0000 0.0201 0.9998 +vn 0.0000 0.9963 -0.0858 +vn -1.0000 0.0000 0.0040 +vn -0.0000 -0.9997 -0.0239 +vn 0.9948 0.0000 -0.1020 +vn -0.9726 0.2307 -0.0293 +vn 0.9726 0.2307 -0.0293 +vn -0.8934 -0.4244 0.1472 +vn 0.8934 0.4244 0.1472 +usemtl Material +s off +f 1/1/1 3/2/1 4/3/1 +f 151/4/2 147/5/2 143/6/2 +f 5/7/3 139/8/3 137/9/3 +f 148/10/4 145/11/4 140/12/4 +f 150/13/5 141/14/5 146/15/5 +f 138/16/6 152/17/6 144/18/6 +f 10/19/7 12/20/7 9/21/7 +f 167/22/8 163/23/8 159/24/8 +f 13/25/9 155/26/9 153/27/9 +f 164/28/10 161/29/10 156/30/10 +f 162/31/11 16/32/11 157/33/11 +f 154/34/6 168/35/6 160/36/6 +f 18/37/1 20/38/1 17/39/1 +f 183/40/2 179/41/2 175/42/2 +f 21/43/3 171/44/3 169/45/3 +f 180/46/4 177/47/4 172/48/4 +f 178/49/5 24/50/5 173/51/5 +f 170/52/6 184/53/6 176/54/6 +f 26/55/12 28/56/12 25/57/12 +f 199/58/2 195/59/2 191/60/2 +f 29/61/3 187/62/3 185/63/3 +f 196/64/13 193/65/13 188/66/13 +f 194/67/5 32/68/5 189/69/5 +f 186/70/14 200/71/14 192/72/14 +f 40/73/15 203/74/15 36/75/15 +f 34/76/16 209/77/16 38/78/16 +f 39/79/17 201/80/17 211/81/17 +f 215/82/18 205/83/18 213/84/18 +f 204/85/2 206/86/2 208/87/2 +f 214/88/1 210/89/1 216/90/1 +f 106/91/19 221/92/19 223/93/19 +f 44/94/6 108/95/6 217/96/6 +f 45/97/1 47/98/1 48/99/1 +f 239/100/2 235/101/2 231/102/2 +f 49/103/5 227/104/5 225/105/5 +f 236/106/6 233/107/6 228/108/6 +f 238/109/3 229/110/3 234/111/3 +f 226/112/4 240/113/4 232/114/4 +f 54/115/1 56/116/1 53/117/1 +f 255/118/2 251/119/2 247/120/2 +f 57/121/5 243/122/5 241/123/5 +f 252/124/6 249/125/6 244/126/6 +f 254/127/3 245/128/3 250/129/3 +f 242/130/4 256/131/4 248/132/4 +f 75/133/20 61/134/20 79/135/20 +f 74/136/21 62/137/21 64/138/21 +f 263/139/22 257/140/22 259/141/22 +f 267/142/4 258/143/4 266/144/4 +f 66/145/1 68/146/1 65/147/1 +f 291/148/2 287/149/2 283/150/2 +f 69/151/3 279/152/3 277/153/3 +f 288/154/4 285/155/4 280/156/4 +f 290/157/5 281/158/5 286/159/5 +f 278/160/6 292/161/6 284/162/6 +f 262/163/1 76/164/1 73/165/1 +f 299/166/2 269/167/2 297/168/2 +f 77/169/3 264/170/3 293/171/3 +f 270/172/23 276/173/23 268/174/23 +f 274/175/5 295/176/5 261/177/5 +f 298/178/6 296/179/6 300/180/6 +f 88/181/6 303/182/6 84/183/6 +f 82/184/5 309/185/5 86/186/5 +f 83/187/4 311/188/4 87/189/4 +f 307/190/3 313/191/3 315/192/3 +f 304/193/2 306/194/2 308/195/2 +f 314/196/1 310/197/1 316/198/1 +f 96/199/6 319/200/6 92/201/6 +f 90/202/5 325/203/5 94/204/5 +f 95/205/4 317/206/4 327/207/4 +f 323/208/3 329/209/3 331/210/3 +f 320/211/2 322/212/2 324/213/2 +f 332/214/1 328/215/1 326/216/1 +f 335/217/4 104/218/4 100/219/4 +f 102/220/24 97/221/24 98/222/24 +f 343/223/25 99/224/25 103/225/25 +f 345/226/3 339/227/3 347/228/3 +f 338/229/26 336/230/26 340/231/26 +f 342/232/1 346/233/1 348/234/1 +f 351/235/27 219/236/27 107/237/27 +f 353/238/5 41/239/5 355/240/5 +f 220/241/28 222/242/28 218/243/28 +f 350/244/1 354/245/1 356/246/1 +f 116/247/29 359/248/29 112/249/29 +f 110/250/30 365/251/30 114/252/30 +f 115/253/31 357/254/31 367/255/31 +f 371/256/32 361/257/32 369/258/32 +f 360/259/2 362/260/2 364/261/2 +f 370/262/1 366/263/1 372/264/1 +f 131/265/20 117/266/20 135/267/20 +f 130/268/21 118/269/21 120/270/21 +f 379/271/22 373/272/22 375/273/22 +f 383/274/4 374/275/4 382/276/4 +f 122/277/1 124/278/1 121/279/1 +f 407/280/2 403/281/2 399/282/2 +f 125/283/5 395/284/5 393/285/5 +f 404/286/6 401/287/6 396/288/6 +f 406/289/3 397/290/3 402/291/3 +f 394/292/4 408/293/4 400/294/4 +f 378/295/1 132/296/1 129/297/1 +f 415/298/2 385/299/2 413/300/2 +f 133/301/3 380/302/3 409/303/3 +f 386/304/23 392/305/23 384/306/23 +f 390/307/5 411/308/5 377/309/5 +f 414/310/6 412/311/6 416/312/6 +f 1/1/1 2/313/1 3/2/1 +f 151/4/2 149/314/2 147/5/2 +f 5/7/3 6/315/3 139/8/3 +f 148/10/4 7/316/4 145/11/4 +f 150/13/5 8/317/5 141/14/5 +f 138/16/6 142/318/6 152/17/6 +f 10/19/7 11/319/7 12/20/7 +f 167/22/8 165/320/8 163/23/8 +f 13/25/33 14/321/33 155/26/33 +f 164/28/10 15/322/10 161/29/10 +f 162/31/34 166/323/34 16/32/34 +f 154/34/6 158/324/6 168/35/6 +f 18/37/1 19/325/1 20/38/1 +f 183/40/2 181/326/2 179/41/2 +f 21/43/3 22/327/3 171/44/3 +f 180/46/4 23/328/4 177/47/4 +f 178/49/5 182/329/5 24/50/5 +f 170/52/6 174/330/6 184/53/6 +f 26/55/12 27/331/12 28/56/12 +f 199/58/2 197/332/2 195/59/2 +f 29/61/3 30/333/3 187/62/3 +f 196/64/13 31/334/13 193/65/13 +f 194/67/5 198/335/5 32/68/5 +f 186/70/14 190/336/14 200/71/14 +f 40/73/15 37/337/15 203/74/15 +f 34/76/16 33/338/16 209/77/16 +f 39/79/17 35/339/17 201/80/17 +f 215/82/18 207/340/18 205/83/18 +f 204/85/2 202/341/2 206/86/2 +f 214/88/1 212/342/1 210/89/1 +f 106/91/3 105/343/3 221/92/3 +f 44/94/6 349/344/6 108/95/6 +f 45/97/1 46/345/1 47/98/1 +f 239/100/2 237/346/2 235/101/2 +f 49/103/5 50/347/5 227/104/5 +f 236/106/6 51/348/6 233/107/6 +f 238/109/3 52/349/3 229/110/3 +f 226/112/4 230/350/4 240/113/4 +f 54/115/1 55/351/1 56/116/1 +f 255/118/2 253/352/2 251/119/2 +f 57/121/5 58/353/5 243/122/5 +f 252/124/6 59/354/6 249/125/6 +f 254/127/3 60/355/3 245/128/3 +f 242/130/4 246/356/4 256/131/4 +f 75/133/20 63/357/20 61/134/20 +f 74/136/21 78/358/21 62/137/21 +f 263/139/22 265/359/22 257/140/22 +f 267/142/4 275/360/4 258/143/4 +f 66/145/1 67/361/1 68/146/1 +f 291/148/2 289/362/2 287/149/2 +f 69/151/3 70/363/3 279/152/3 +f 288/154/4 71/364/4 285/155/4 +f 290/157/5 72/365/5 281/158/5 +f 278/160/6 282/366/6 292/161/6 +f 262/163/1 260/367/1 76/164/1 +f 299/166/2 272/368/2 269/167/2 +f 77/169/3 271/369/3 264/170/3 +f 270/172/23 273/370/23 276/173/23 +f 274/175/5 80/371/5 295/176/5 +f 298/178/6 294/372/6 296/179/6 +f 88/181/6 85/373/6 303/182/6 +f 82/184/5 81/374/5 309/185/5 +f 83/187/4 301/375/4 311/188/4 +f 307/190/3 305/376/3 313/191/3 +f 304/193/2 302/377/2 306/194/2 +f 314/196/1 312/378/1 310/197/1 +f 96/199/6 93/379/6 319/200/6 +f 90/202/5 89/380/5 325/203/5 +f 95/205/4 91/381/4 317/206/4 +f 323/208/3 321/382/3 329/209/3 +f 320/211/2 318/383/2 322/212/2 +f 332/214/1 330/384/1 328/215/1 +f 335/217/4 101/385/4 104/218/4 +f 102/220/5 341/386/5 97/221/5 +f 343/223/25 333/387/25 99/224/25 +f 345/226/35 337/388/35 339/227/35 +f 338/229/26 334/389/26 336/230/26 +f 342/232/1 344/390/1 346/233/1 +f 351/235/27 43/391/27 219/236/27 +f 353/238/36 42/392/36 41/239/36 +f 220/241/28 224/393/28 222/242/28 +f 350/244/1 352/394/1 354/245/1 +f 116/247/29 113/395/29 359/248/29 +f 110/250/30 109/396/30 365/251/30 +f 115/253/31 111/397/31 357/254/31 +f 371/256/32 363/398/32 361/257/32 +f 360/259/2 358/399/2 362/260/2 +f 370/262/1 368/400/1 366/263/1 +f 131/265/20 119/401/20 117/266/20 +f 130/268/21 134/402/21 118/269/21 +f 379/271/22 381/403/22 373/272/22 +f 383/274/4 391/404/4 374/275/4 +f 122/277/1 123/405/1 124/278/1 +f 407/280/2 405/406/2 403/281/2 +f 125/283/5 126/407/5 395/284/5 +f 404/286/6 127/408/6 401/287/6 +f 406/289/3 128/409/3 397/290/3 +f 394/292/4 398/410/4 408/293/4 +f 378/295/1 376/411/1 132/296/1 +f 415/298/2 388/412/2 385/299/2 +f 133/301/3 387/413/3 380/302/3 +f 386/304/23 389/414/23 392/305/23 +f 390/307/5 136/415/5 411/308/5 +f 414/310/6 410/416/6 412/311/6 diff --git a/res/playerTexture.png b/res/playerTexture.png index cf0cf2d..d972e6a 100644 Binary files a/res/playerTexture.png and b/res/playerTexture.png differ diff --git a/src/org/atriaSoft/etk/Color.java b/src/org/atriaSoft/etk/Color.java index 16abb43..7b9aaf9 100644 --- a/src/org/atriaSoft/etk/Color.java +++ b/src/org/atriaSoft/etk/Color.java @@ -1,6 +1,10 @@ package org.atriaSoft.etk; public class Color { + @Override + public String toString() { + return "Color [r=" + r + ", g=" + g + ", b=" + b + ", a=" + a + "]"; + } public float r; public float g; public float b; diff --git a/src/org/atriaSoft/etk/math/Vector3f.java b/src/org/atriaSoft/etk/math/Vector3f.java index 4dd413b..2956ddf 100644 --- a/src/org/atriaSoft/etk/math/Vector3f.java +++ b/src/org/atriaSoft/etk/math/Vector3f.java @@ -1,13 +1,16 @@ package org.atriaSoft.etk.math; public class Vector3f { - public float x = 0; - public float y = 0; - public float z = 0; + public float x; + public float y; + public float z; /** * @brief Default contructor */ public Vector3f() { + this.x = 0; + this.y = 0; + this.z = 0; } /** * @brief Constructor from scalars diff --git a/src/org/atriaSoft/gale/backend3d/OpenGL.java b/src/org/atriaSoft/gale/backend3d/OpenGL.java index 2354921..b955091 100644 --- a/src/org/atriaSoft/gale/backend3d/OpenGL.java +++ b/src/org/atriaSoft/gale/backend3d/OpenGL.java @@ -15,6 +15,7 @@ import org.lwjgl.opengl.GL13; import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GL30; +import org.lwjgl.opengl.GL40; import org.atriaSoft.etk.math.Matrix4f; import org.atriaSoft.etk.math.Vector2f; import org.atriaSoft.etk.math.Vector2i; @@ -492,13 +493,13 @@ public class OpenGL { /** * @brief draw a specific array == > this enable mode difference ... */ -// public static void drawArrays(RenderMode mode, int first, int count) { -// if (this.programId >= 0) { -// updateAllFlags(); -// GL20.glDrawArrays(convertRenderMode.get(mode), first, count); -// checkGlError("glDrawArrays"); -// } -// } + public static void drawArrays(RenderMode mode, int first, int count) { + if (programId >= 0) { + updateAllFlags(); + GL20.glDrawArrays(convertRenderMode.get(mode), first, count); + checkGlError("glDrawArrays"); + } + } // public static void drawElements(RenderMode mode, List indices) { // if (this.programId >= 0) { // updateAllFlags(); @@ -837,7 +838,7 @@ public class OpenGL { } public static void programLoadUniformColor(int location, Color value) { - GL20.glUniform3f(location, value.r, value.g, value.b); + GL20.glUniform4f(location, value.r, value.g, value.b, value.a); } public static void programLoadUniformVector(int location, Vector3f value) { @@ -868,5 +869,8 @@ public class OpenGL { public static void drawElements(RenderMode mode, int vertexCount) { GL11.glDrawElements(convertRenderMode.get(mode), vertexCount, GL11.GL_UNSIGNED_INT, 0); } + public static void setDeathMask(boolean state) { + GL40.glDepthMask(state); + } } diff --git a/src/org/atriaSoft/gale/context/Context.java b/src/org/atriaSoft/gale/context/Context.java index e794da5..82bf34d 100644 --- a/src/org/atriaSoft/gale/context/Context.java +++ b/src/org/atriaSoft/gale/context/Context.java @@ -531,7 +531,7 @@ public abstract class Context { public void stop() { Log.warning("stop: NOT implemented for this platform..."); } - protected Vector2f windowsSize; //!< current size of the system + protected Vector2f windowsSize = new Vector2f(0,0); //!< current size of the system /** * @brief get the current windows size * @return the current size ... @@ -568,12 +568,16 @@ public abstract class Context { public void setSize( Vector2f _size){ Log.info("setSize: NOT implemented ..."); }; + protected boolean fullscreen = false; /** * @brief The application request a change of his current size force the fullscreen mode. * @param[in] _status status of the fullscreen mode. */ public void setFullScreen(boolean _status){ - Log.info("setFullScreen: NOT implemented ..."); + fullscreen = _status; + }; + public boolean getFullScreen(){ + return fullscreen; }; protected Vector2f windowsPos; //!< current size of the system /** diff --git a/src/org/atriaSoft/gale/context/LWJG_AWT/ContextLWJGL_AWT.java b/src/org/atriaSoft/gale/context/LWJG_AWT/ContextLWJGL_AWT.java index b7b69f7..8158eb1 100644 --- a/src/org/atriaSoft/gale/context/LWJG_AWT/ContextLWJGL_AWT.java +++ b/src/org/atriaSoft/gale/context/LWJG_AWT/ContextLWJGL_AWT.java @@ -1,16 +1,32 @@ package org.atriaSoft.gale.context.LWJG_AWT; +import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Cursor; import java.awt.Dimension; import java.awt.Frame; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.awt.image.MemoryImageSource; +import java.util.ArrayList; +import java.util.List; import java.util.Timer; import java.util.TimerTask; +import java.awt.Robot; + import javax.swing.JFrame; import javax.swing.SwingUtilities; @@ -27,6 +43,7 @@ import org.atriaSoft.gale.key.KeySpecial; import org.atriaSoft.gale.key.KeyStatus; import org.atriaSoft.gale.key.KeyType; import org.atriaSoft.gameEngine.Log; +import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.awt.AWTGLCanvas; //import org.lwjgl.Version; //import org.lwjgl.glfw.GLFWErrorCallback; @@ -40,17 +57,17 @@ import renderEngine.DisplayManagerDraw; import static org.lwjgl.opengl.GL.*; import static org.lwjgl.opengl.GL11.*; - -public class ContextLWJGL_AWT extends Context implements MouseListener{ +public class ContextLWJGL_AWT extends Context implements MouseListener, MouseMotionListener, KeyListener, MouseWheelListener { private boolean[] inputIsPressed = new boolean[MAX_MANAGE_INPUT]; + private Vector2f decoratedWindowsSize = new Vector2f(0, 0); private Vector2f cursorPos = new Vector2f(0, 0); + private Vector2f cursorSize = new Vector2f(0, 0); private static final int WIDTH = 800; private static final int HEIGHT = 600; private static final String TITLE = "Gale basic UI"; private static long lastFrameTime; private static float delta; - private Vector2f lastPositionGrab = null; // is null when grabbing is disable ... private Fps fps = new Fps("Main Loop", true); @@ -72,24 +89,11 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ private JFrame frame; private GLData glData; private AWTGLCanvas canvas; - + private Robot robot = null; public ContextLWJGL_AWT(Application application, String[] args) { super(application, args); System.out.println("Hello JOGL !"); - - - - initWindows(); -// // This line is critical for LWJGL's interoperation with GLFW's -// // OpenGL context, or any context that is managed externally. -// // LWJGL detects the context that is current in the current thread, -// // creates the GLCapabilities instance and makes the OpenGL -// // bindings available for use. -// GL.createCapabilities(); -// // Set the clear color -// glClearColor(0.0f, 1.0f, 0.0f, 0.0f); -// glViewport(0, 0, (int)application.getSize().x, (int)application.getSize().y); start2ndThreadProcessing(); } @@ -97,549 +101,400 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ public void setDrawer(DisplayManagerDraw drawer) { this.drawer = drawer; } - -// public static Vector2f getSize() { -// return new Vector2f(WIDTH, HEIGHT); -// } - public void unInit() { - -// // Free the window callbacks and destroy the window -// glfwFreeCallbacks(window); -// glfwDestroyWindow(window); -// -// // Terminate GLFW and free the error callback -// glfwTerminate(); -// glfwSetErrorCallback(null).free(); + } + @SuppressWarnings("serial") private void initWindows() { frame = new JFrame("Gale base"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLayout(new BorderLayout()); - frame.setPreferredSize(new Dimension(600, 600)); + frame.setPreferredSize(new Dimension(800, 600)); glData = new GLData(); glData.samples = 4; glData.swapInterval = 0; - frame.addMouseListener(this); - frame.add(canvas = new AWTGLCanvas(glData) { public void initGL() { System.out.println("OpenGL version: " + effective.majorVersion + "." + effective.minorVersion + " (Profile: " + effective.profile + ")"); createCapabilities(); glClearColor(0.3f, 0.4f, 0.5f, 1); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); } public void paintGL() { //Log.warning("Draw ... "); int w = getWidth(); int h = getHeight(); - float aspect = (float) w / h; - double now = System.currentTimeMillis() * 0.001; - float width = (float) Math.abs(Math.sin(now * 0.3)); - glClear(GL_COLOR_BUFFER_BIT); - glViewport(0, 0, w, h); - glBegin(GL_QUADS); - glColor3f(0.4f, 0.6f, 0.8f); - glVertex2f(-0.75f * width / aspect, 0.0f); - glVertex2f(0, -0.75f); - glVertex2f(+0.75f * width/ aspect, 0); - glVertex2f(0, +0.75f); - glEnd(); + if (decoratedWindowsSize.x != w || decoratedWindowsSize.y != h) { + decoratedWindowsSize.x = w; + decoratedWindowsSize.y = h; + Rectangle bounds = canvas.getBounds(); + windowsSize.x = bounds.width; + windowsSize.y = bounds.height; + OS_Resize(windowsSize); + } + OS_Draw(true); swapBuffers(); } }, BorderLayout.CENTER); frame.pack(); + frame.setLocationRelativeTo(null); frame.setVisible(true); + canvas.requestFocus(); + canvas.addMouseListener(this); + canvas.addMouseMotionListener(this); + canvas.addKeyListener(this); + canvas.addMouseWheelListener(this); frame.transferFocus(); - Runnable renderLoop = new Runnable() { - public void run() { - if (!canvas.isValid()) - return; - canvas.render(); - SwingUtilities.invokeLater(this); - } - }; - SwingUtilities.invokeLater(renderLoop); - - //OpenGL.setGlobalGLContext(glcanvas.getGL()); -// // Make the new window -// -// frame = new Frame("CMSC427 - Project 1"); -// -// GLProfile glp = GLProfile.getDefault(); -// GLCapabilities caps = new GLCapabilities(glp); -// caps.setHardwareAccelerated(true); -// caps.setDoubleBuffered(false); -// caps.setAlphaBits(8); -// caps.setRedBits(8); -// caps.setBlueBits(8); -// caps.setGreenBits(8); -// caps.setOnscreen(false); -// GLDrawableFactory factory = GLDrawableFactory.getFactory(glp); -// drawable = factory.createOffscreenAutoDrawable( -// factory.getDefaultDevice(), -// caps, -// new DefaultGLCapabilitiesChooser(), -// 100, -// 100); -// drawable.display(); -// drawable.getContext().makeCurrent(); -// gl = drawable.getGL().getGL2(); -// gl.glClearDepth(1.0f); -// gl.glDepthFunc(GL_LEQUAL); -// gl.glEnable(GL_DEPTH_TEST); -// gl.glShadeModel(GL_FLAT); -// gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); -// glu = GLU.createGLU(gl); -// GLUquadric quadratic = glu.gluNewQuadric(); -// glu.gluQuadricNormals(quadratic, GLU.GLU_SMOOTH); -// glu.gluQuadricTexture(quadratic, true); -// gl.glEnable(GL_COLOR_MATERIAL); -// gl.glDisable(GL_TEXTURE_2D); -// -// frame.add(drawable); - - -// // Setup an error callback. The default implementation -// // will print the error message in System.err. -// GLFWErrorCallback.createPrint(System.err).set(); -// -// // Initialize GLFW. Most GLFW functions will not work before doing this. -// if ( !glfwInit() ) { -// throw new IllegalStateException("Unable to initialize GLFW"); -// } -// // Configure GLFW -// glfwDefaultWindowHints(); // optional, the current window hints are already the default -// glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation -// glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable -// -// // Create the window -// window = glfwCreateWindow((int)application.getSize().x, (int)application.getSize().y, application.getTitle(), NULL, NULL); -// if ( window == 0 ) { -// throw new RuntimeException("Failed to create the GLFW window"); -// } -// // Setup a key callback. It will be called every time a key is pressed, repeated or released. -// // https://www.glfw.org/docs/latest/input_guide.html -// glfwSetKeyCallback(window, (window, key, scancode, action, mods) -> { -// this.keyCallback(window, key, scancode, action, mods); -// }); -// glfwSetWindowSizeCallback(window, (windows, sizeX, sizeY) -> { -// this.windowSizeCallback(window, sizeX, sizeY); -// }); -// -// glfwSetCharCallback(window, (window, key) -> { -// this.charCallback(window, key); -// }); -// -// glfwSetCursorPosCallback(window, (window, xpos, ypos) -> { -// this.cursorPosCallback(window, xpos, ypos); -// }); -// -// glfwSetMouseButtonCallback(window, (window, button, action, mods) -> { -// this.mouseCallback(window, button, action, mods); -// }); -// -// glfwSetScrollCallback(window, (window, xoffset, yoffset) -> { -// this.scrollCallback(window, xoffset, yoffset); -// }); -// -// -// // Get the thread stack and push a new frame -// try ( MemoryStack stack = stackPush() ) { -// IntBuffer pWidth = stack.mallocInt(1); // int* -// IntBuffer pHeight = stack.mallocInt(1); // int* -// -// // Get the window size passed to glfwCreateWindow -// glfwGetWindowSize(window, pWidth, pHeight); -// -// // Get the resolution of the primary monitor -// GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); -// -// // Center the window -// glfwSetWindowPos( -// window, -// (vidmode.width() - pWidth.get(0)) / 2, -// (vidmode.height() - pHeight.get(0)) / 2 -// ); -// } // the stack frame is popped automatically -// -// // Make the OpenGL context current -// glfwMakeContextCurrent(window); -// // Enable v-sync -// glfwSwapInterval(1); -// -// // Make the window visible -// glfwShowWindow(window); - lastFrameTime = getCurrentTime(); } @Override public void mouseClicked(MouseEvent e) { - System.out.println(e.getX()); - System.out.println(e.getY()); +// System.out.println(e.getX()); +// System.out.println(e.getY()); Log.info("Mouse clicked:" + e.getX() + " " + e.getY()); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub - Log.info("Mouse entered:" + e.getX() + " " + e.getY()); + //Log.info("Mouse entered:" + e.getX() + " " + e.getY()); + cursorPos.x = e.getX(); + cursorPos.y = e.getY(); + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.enter, + 0, + cursorPos); } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub - Log.info("Mouse exited:" + e.getX() + " " + e.getY()); + //Log.info("Mouse exited:" + e.getX() + " " + e.getY()); + cursorPos.x = e.getX(); + cursorPos.y = e.getY(); + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.leave, + 0, + cursorPos); + //this.frame.mouseMove(e, 200, 200); } @Override public void mousePressed(MouseEvent e) { - // TODO Auto-generated method stub Log.info("Mouse pressed:" + e.getX() + " " + e.getY()); + int button = e.getButton(); + cursorPos.x = e.getX(); + cursorPos.y = e.getY(); + if (button < MAX_MANAGE_INPUT) { + inputIsPressed[button] = true; + } + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.down, + button, + cursorPos); } @Override public void mouseReleased(MouseEvent e) { - // TODO Auto-generated method stub - Log.info("Mouse release:" + e.getX() + " " + e.getY()); + //Log.info("Mouse release:" + e.getX() + " " + e.getY()); +// Log.info("mouse value: GLFW_RELEASE" + action + " bt=" + button); + int button = e.getButton(); + cursorPos.x = e.getX(); + cursorPos.y = e.getY(); + if (button < MAX_MANAGE_INPUT) { + inputIsPressed[button] = false; + } + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.up, + button, + cursorPos); } + + @Override + public void mouseDragged(MouseEvent e) { + //Log.error("mouse drag ... " + e); + mouseMoved(e); + } + public void mouseMoved(MouseEvent e) { + //Log.info("Mouse moved:" + e.getX() + " " + e.getY() + " " + e); + if (this.robot != null) { + Rectangle bounds = frame.getBounds(); + //Log.error(" " + bounds + " windows=" + windowsSize + " deco= " + decoratedWindowsSize); + float refPosX = bounds.x + bounds.width/2; + float refPosY = bounds.y + bounds.height/2; + if (e.getXOnScreen() == (int)refPosX + && e.getYOnScreen() == (int)refPosY) { + cursorPos.x = 0; + cursorPos.y = 0; + return; + } else { + //Log.error(" " + bounds + " windows=" + windowsSize + " deco= " + decoratedWindowsSize); + cursorPos.x = -((float)e.getXOnScreen() - refPosX); + cursorPos.y = (float)e.getYOnScreen() - refPosY; + robot.mouseMove((int)refPosX, (int)refPosY); + } + Log.info("delta moved:" + cursorPos); + } else { + // TODO: use real size ... !!!! + cursorPos.x = (float)e.getX(); + cursorPos.y = cursorSize.y - (float)e.getY(); + } + // For compatibility of the Android system : + boolean findOne = false; + for (int iii=0; iii pressedKey = new ArrayList(); -// private void windowSizeCallback(long window2, int sizeX, int sizeY) { -// OS_Resize(new Vector2f(sizeX, sizeY)); -// } -// -// -// private void charCallback(long window, int key) {; -// Log.error("keyboard char " + key + " " + (char)key); -// } -// private void keyCallback(long window, int key, int scancode, int action, int mods) { -// boolean find = true; -// boolean thisIsAReapeateKey = false; // TODO detect this ... -// KeyKeyboard keyInput = KeyKeyboard.unknow; -// Log.error("keyboard input " + key + " " + scancode); -// switch (key) { -// //case 328: // keypad -// case GLFW_KEY_UP: keyInput = KeyKeyboard.up; break; -// //case 324: // keypad -// case GLFW_KEY_LEFT: keyInput = KeyKeyboard.left; break; -// //case 326: // keypad -// case GLFW_KEY_RIGHT: keyInput = KeyKeyboard.right; break; -// //case 323: // keypad -// case GLFW_KEY_DOWN: keyInput = KeyKeyboard.down; break; -// case 329: // keypad -// case GLFW_KEY_PAGE_UP: keyInput = KeyKeyboard.pageUp; break; -// case 323: // keypad -// case GLFW_KEY_PAGE_DOWN: keyInput = KeyKeyboard.pageDown; break; -// case 327: // keypad -// case GLFW_KEY_HOME: keyInput = KeyKeyboard.start; break; -// case 321: // keypad -// case GLFW_KEY_END: keyInput = KeyKeyboard.end; break; -// case GLFW_KEY_PRINT_SCREEN: keyInput = KeyKeyboard.stopDefil; break; -// case GLFW_KEY_PAUSE: keyInput = KeyKeyboard.wait; break; -// case 320: // keypad -// case GLFW_KEY_INSERT: -// keyInput = KeyKeyboard.insert; -// if(action == GLFW_RELEASE) { -// if (guiKeyBoardMode.getInsert() == true) { -// guiKeyBoardMode.setInsert(false); -// } else { -// guiKeyBoardMode.setInsert(true); -// } -// } -// break; -// //case 84: keyInput = KeyboardCenter; break; // Keypad -// case GLFW_KEY_F1: keyInput = KeyKeyboard.f1; break; -// case GLFW_KEY_F2: keyInput = KeyKeyboard.f2; break; -// case GLFW_KEY_F3: keyInput = KeyKeyboard.f3; break; -// case GLFW_KEY_F4: keyInput = KeyKeyboard.f4; break; -// case GLFW_KEY_F5: keyInput = KeyKeyboard.f5; break; -// case GLFW_KEY_F6: keyInput = KeyKeyboard.f6; break; -// case GLFW_KEY_F7: keyInput = KeyKeyboard.f7; break; -// case GLFW_KEY_F8: keyInput = KeyKeyboard.f8; break; -// case GLFW_KEY_F9: keyInput = KeyKeyboard.f9; break; -// case GLFW_KEY_F10: keyInput = KeyKeyboard.f10; break; -// case GLFW_KEY_F11: keyInput = KeyKeyboard.f11; break; -// case GLFW_KEY_F12: keyInput = KeyKeyboard.f12; break; -// case GLFW_KEY_CAPS_LOCK: keyInput = KeyKeyboard.capLock; guiKeyBoardMode.setCapsLock (action == GLFW_PRESS); break; -// case GLFW_KEY_LEFT_SHIFT: keyInput = KeyKeyboard.shiftLeft; guiKeyBoardMode.setShiftLeft (action == GLFW_PRESS); break; -// case GLFW_KEY_RIGHT_SHIFT: keyInput = KeyKeyboard.shiftRight; guiKeyBoardMode.setShiftRight(action == GLFW_PRESS); break; -// case GLFW_KEY_LEFT_CONTROL: keyInput = KeyKeyboard.ctrlLeft; guiKeyBoardMode.setCtrlLeft (action == GLFW_PRESS); break; -// case GLFW_KEY_RIGHT_CONTROL: keyInput = KeyKeyboard.ctrlRight; guiKeyBoardMode.setCtrlRight (action == GLFW_PRESS); break; -// case GLFW_KEY_LEFT_SUPER: keyInput = KeyKeyboard.metaLeft; guiKeyBoardMode.setMetaLeft (action == GLFW_PRESS); break; -// case GLFW_KEY_RIGHT_SUPER: keyInput = KeyKeyboard.metaRight; guiKeyBoardMode.setMetaRight (action == GLFW_PRESS); break; -// case GLFW_KEY_LEFT_ALT: keyInput = KeyKeyboard.altLeft; guiKeyBoardMode.setAltLeft (action == GLFW_PRESS); break; -// case GLFW_KEY_RIGHT_ALT: keyInput = KeyKeyboard.altRight; guiKeyBoardMode.setAltRight (action == GLFW_PRESS); break; -// case GLFW_KEY_MENU: keyInput = KeyKeyboard.contextMenu; break; -// case GLFW_KEY_NUM_LOCK: keyInput = KeyKeyboard.numLock; guiKeyBoardMode.setNumLock (action == GLFW_PRESS); break; -// case GLFW_KEY_DELETE: // Suppr on keypad -// find = false; -// if(guiKeyBoardMode.getNumLock() == true){ -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action == GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// '.'); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action != GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// '.'); -// } -// } else { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action == GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)0x7F); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action != GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)0x7F); -// } -// } -// break; -// case GLFW_KEY_TAB: // special case for TAB -// find = false; -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action == GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)0x09); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action!=GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)0x09); -// } -// break; -// case GLFW_KEY_A: -// case GLFW_KEY_B: -// case GLFW_KEY_C: -// case GLFW_KEY_D: -// case GLFW_KEY_E: -// case GLFW_KEY_F: -// case GLFW_KEY_G: -// case GLFW_KEY_H: -// case GLFW_KEY_I: -// case GLFW_KEY_J: -// case GLFW_KEY_K: -// case GLFW_KEY_L: -// case GLFW_KEY_M: -// case GLFW_KEY_N: -// case GLFW_KEY_O: -// case GLFW_KEY_P: -// case GLFW_KEY_Q: -// case GLFW_KEY_R: -// case GLFW_KEY_S: -// case GLFW_KEY_T: -// case GLFW_KEY_U: -// case GLFW_KEY_V: -// case GLFW_KEY_W: -// case GLFW_KEY_X: -// case GLFW_KEY_Y: -// case GLFW_KEY_Z: -// { -// find = false; -// int tmpKey = key-GLFW_KEY_A + (int)'a'; -// if (guiKeyBoardMode.getCapsLock() == true || guiKeyBoardMode.getShift() == true) { -// tmpKey += (int)'A' - (int)'a'; -// } -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action==GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)tmpKey); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action!=GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)tmpKey); -// } -// break; -// } -// case GLFW_KEY_1: -// case GLFW_KEY_2: -// case GLFW_KEY_3: -// case GLFW_KEY_4: -// case GLFW_KEY_5: -// case GLFW_KEY_6: -// case GLFW_KEY_7: -// case GLFW_KEY_8: -// case GLFW_KEY_9: -// case GLFW_KEY_0: -// { -// find = false; -// int tmpKey = key-GLFW_KEY_0 + (int)'0'; -//// if (guiKeyBoardMode.getCapsLock() == true || guiKeyBoardMode.getShift() == true) { -//// tmpKey += (int)'A' - (int)'a'; -//// } -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action==GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)tmpKey); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// KeyKeyboard.character, -// (action!=GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey, -// (char)tmpKey); -// } -// } -// default: -// find = false; -//// { -//// char buf[11]; -//// //GALE_DEBUG("Keycode: " << event.xkey.keycode); -//// // change keystate for simple reson of the ctrl error... -//// int32_t keyStateSave = event.xkey.state; -//// if (event.xkey.state & (1<<2) ) { -//// event.xkey.state = event.xkey.state & 0xFFFFFFFB; -//// } -//// KeySym keysym; -//// Status status = 0; -//// //int count = Xutf8LookupString(m_xic, (XKeyPressedEvent*)&event, buf, 10, &keysym, &status); -//// int count = Xutf8LookupString(m_xic, &event.xkey, buf, 10, &keysym, &status); -//// // retreave real keystate -//// event.xkey.state = keyStateSave; -//// buf[count] = '\0'; -//// // Replace \r error ... -//// if (buf[0] == '\r') { -//// buf[0] = '\n'; -//// buf[1] = '\0'; -//// } -//// if (count >= 0) { -//// // repeated kay from previous element : -//// if (count > 0) { -//// // transform it in unicode -//// m_lastKeyPressed = utf8::convertChar32(buf); -//// } -//// X11_INFO("event Key : " << event.xkey.keycode << " char=\"" << buf << "\"'len=" << strlen(buf) << " unicode=" << m_lastKeyPressed); -//// OS_setKeyboard(m_guiKeyBoardMode, -//// gale::key::keyboard::character, -//// (event.type==KeyPress?gale::key::status::down:gale::key::status::up), -//// thisIsAReapeateKey, -//// m_lastKeyPressed); -//// if (thisIsAReapeateKey == true) { -//// OS_setKeyboard(m_guiKeyBoardMode, -//// gale::key::keyboard::character, -//// (event.type!=KeyPress?gale::key::status::down:gale::key::status::up), -//// thisIsAReapeateKey, -//// m_lastKeyPressed); -//// } -//// } else { -//// GALE_WARNING("Unknow event Key : " << event.xkey.keycode << " res='" << buf << "' repeate=" << thisIsAReapeateKey); -//// } -//// } -//// break; -// } -// if (find == true) { -// OS_setKeyboard(guiKeyBoardMode, -// keyInput, -// (action == GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey); -// if (thisIsAReapeateKey == true) { -// OS_setKeyboard(guiKeyBoardMode, -// keyInput, -// (action!=GLFW_PRESS?KeyStatus.down:KeyStatus.up), -// thisIsAReapeateKey); -// } -// } -//// if ( key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE ) { -//// glfwSetWindowShouldClose(window, true); // We will detect this in the rendering loop -//// } -// } -// private void cursorPosCallback(long window, double xpos, double ypos) { -// if (lastPositionGrab != null) { -// cursorPos.x = lastPositionGrab.x - (float)xpos; -// cursorPos.y = -(lastPositionGrab.y - (float)ypos); -// lastPositionGrab.x = (float)xpos; -// lastPositionGrab.y = (float)ypos; -// } else { -// // TODO: use real size ... !!!! -// cursorPos.x = (float)xpos; -// cursorPos.y = /*m_currentHeight*/800.0f-(float)ypos; -// } -// // For compatibility of the Android system : -// boolean findOne = false; -// for (int iii=0; iii0) { -// inputIsPressed[4] = true; -// OS_SetInput(guiKeyBoardMode,KeyType.mouse, -// KeyStatus.down, -// 4, -// cursorPos); -// inputIsPressed[4] = false; -// OS_SetInput(guiKeyBoardMode,KeyType.mouse, -// KeyStatus.up, -// 4, -// cursorPos); -// } -// } -// private void mouseCallback(long window, int button, int action, int mods) { -// if (action == GLFW_PRESS) { -//// Log.info("mouse value: GLFW_PRESS " + action + " bt=" + button); -// if (button < MAX_MANAGE_INPUT) { -// inputIsPressed[button] = true; -// } -// OS_SetInput(guiKeyBoardMode,KeyType.mouse, -// KeyStatus.down, -// button, -// cursorPos); -// } else if (action == GLFW_RELEASE) { -//// Log.info("mouse value: GLFW_RELEASE" + action + " bt=" + button); -// leftButtonStateDown = false; -// if (button < MAX_MANAGE_INPUT) { -// inputIsPressed[button] = false; -// } -// OS_SetInput(guiKeyBoardMode,KeyType.mouse, -// KeyStatus.up, -// button, -// cursorPos); -//// } else { -//// Log.info("mouse value: ???" + action + " bt=" + button); -// } -// } + private int getUniqueIndex(KeyEvent e) { + int internalKeyValue = e.getKeyCode(); + if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) { + internalKeyValue += 100000000; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) { + internalKeyValue += 200000000; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_NUMPAD) { + internalKeyValue += 300000000; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_STANDARD) { + internalKeyValue += 400000000; + } + return internalKeyValue; + } + public void keyPressed(KeyEvent e) { + int internalKeyValue = getUniqueIndex(e); + int index = pressedKey.indexOf(internalKeyValue); + if (index == -1) { + pressedKey.add(internalKeyValue); + } + keyEvent(e, true, index != -1); + } + public void keyReleased(KeyEvent e) { + int internalKeyValue = getUniqueIndex(e); + int index = pressedKey.indexOf(internalKeyValue); + if (index == -1) { + pressedKey.remove(internalKeyValue); + } + keyEvent(e, false, false); + } + public void keyEvent(KeyEvent e, boolean pressed, boolean thisIsAReapeateKey) { + //Log.info("event " + thisIsAReapeateKey + " " + e.getKeyCode() + " " + e); + boolean find = true; + KeyKeyboard keyInput = KeyKeyboard.unknow; + //Log.error("keyboard input " + e.getWhen() + " " + e.getKeyCode() + " " + e.getKeyLocation()); + switch (e.getKeyCode()) { + //case 328: // keypad + case KeyEvent.VK_UP: keyInput = KeyKeyboard.up; break; + //case 324: // keypad + case KeyEvent.VK_LEFT: keyInput = KeyKeyboard.left; break; + //case 326: // keypad + case KeyEvent.VK_RIGHT: keyInput = KeyKeyboard.right; break; + //case 323: // keypad + case KeyEvent.VK_DOWN: keyInput = KeyKeyboard.down; break; + //case 329: // keypad + case KeyEvent.VK_PAGE_UP: keyInput = KeyKeyboard.pageUp; break; + //case 323: // keypad + case KeyEvent.VK_PAGE_DOWN: keyInput = KeyKeyboard.pageDown; break; + //case 327: // keypad + case KeyEvent.VK_HOME: keyInput = KeyKeyboard.start; break; + //case 321: // keypad + case KeyEvent.VK_END: keyInput = KeyKeyboard.end; break; + case KeyEvent.VK_PRINTSCREEN:keyInput = KeyKeyboard.stopDefil; break; + case KeyEvent.VK_PAUSE: keyInput = KeyKeyboard.wait; break; + //case 320: // keypad + case KeyEvent.VK_INSERT: + keyInput = KeyKeyboard.insert; + if(pressed == false) { + if (guiKeyBoardMode.getInsert() == true) { + guiKeyBoardMode.setInsert(false); + } else { + guiKeyBoardMode.setInsert(true); + } + } + break; + //case 84: keyInput = KeyboardCenter; break; // Keypad + case KeyEvent.VK_F1: keyInput = KeyKeyboard.f1; break; + case KeyEvent.VK_F2: keyInput = KeyKeyboard.f2; break; + case KeyEvent.VK_F3: keyInput = KeyKeyboard.f3; break; + case KeyEvent.VK_F4: keyInput = KeyKeyboard.f4; break; + case KeyEvent.VK_F5: keyInput = KeyKeyboard.f5; break; + case KeyEvent.VK_F6: keyInput = KeyKeyboard.f6; break; + case KeyEvent.VK_F7: keyInput = KeyKeyboard.f7; break; + case KeyEvent.VK_F8: keyInput = KeyKeyboard.f8; break; + case KeyEvent.VK_F9: keyInput = KeyKeyboard.f9; break; + case KeyEvent.VK_F10: keyInput = KeyKeyboard.f10; break; + case KeyEvent.VK_F11: keyInput = KeyKeyboard.f11; break; + case KeyEvent.VK_F12: keyInput = KeyKeyboard.f12; break; + case KeyEvent.VK_CAPS_LOCK: + keyInput = KeyKeyboard.capLock; + guiKeyBoardMode.setCapsLock(pressed == true); + break; + case KeyEvent.VK_SHIFT: + if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) { + keyInput = KeyKeyboard.shiftLeft; guiKeyBoardMode.setShiftLeft (pressed == true); break; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_RIGHT) { + keyInput = KeyKeyboard.shiftLeft; guiKeyBoardMode.setShiftRight (pressed == true); break; + } + case KeyEvent.VK_CONTROL: + if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) { + keyInput = KeyKeyboard.ctrlLeft; guiKeyBoardMode.setCtrlLeft (pressed == true); break; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_RIGHT) { + keyInput = KeyKeyboard.ctrlRight; guiKeyBoardMode.setCtrlRight (pressed == true); break; + } + case KeyEvent.VK_META: + if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_LEFT) { + keyInput = KeyKeyboard.metaLeft; guiKeyBoardMode.setMetaLeft (pressed == true); break; + } else if (e.getKeyLocation() == KeyEvent.KEY_LOCATION_RIGHT) { + keyInput = KeyKeyboard.metaRight; guiKeyBoardMode.setMetaRight (pressed == true); break; + } + case KeyEvent.VK_ALT: + keyInput = KeyKeyboard.altLeft; + guiKeyBoardMode.setAltLeft(pressed == true); + break; + case KeyEvent.VK_ALT_GRAPH: + keyInput = KeyKeyboard.altRight; + guiKeyBoardMode.setAltRight(pressed == true); + break; + case KeyEvent.VK_CONTEXT_MENU: + keyInput = KeyKeyboard.contextMenu; + break; + case KeyEvent.VK_NUM_LOCK: + keyInput = KeyKeyboard.numLock; + guiKeyBoardMode.setNumLock(pressed == true); + break; + case KeyEvent.VK_DELETE: // Suppr on keypad + find = false; + if(guiKeyBoardMode.getNumLock() == true){ + if (thisIsAReapeateKey == true) { + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed != true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + '.'); + } + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed == true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + '.'); + } else { + if (thisIsAReapeateKey == true) { + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed != true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + (char)0x7F); + } + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed == true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + (char)0x7F); + } + break; + case KeyEvent.VK_TAB: // special case for TAB + find = false; + if (thisIsAReapeateKey == true) { + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed==false?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + (char)0x09); + } + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed == true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + (char)0x09); + break; + default: + find = false; + if (thisIsAReapeateKey == true) { + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed==false?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + e.getKeyChar()); + } + OS_setKeyboard(guiKeyBoardMode, + KeyKeyboard.character, + (pressed==true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey, + e.getKeyChar()); + } + if (find == true) { + if (thisIsAReapeateKey == true) { + OS_setKeyboard(guiKeyBoardMode, + keyInput, + (pressed==false?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey); + } + OS_setKeyboard(guiKeyBoardMode, + keyInput, + (pressed == true?KeyStatus.down:KeyStatus.up), + thisIsAReapeateKey); + } + } + + public void keyTyped(KeyEvent e) { + // not needed with my model ... + //Log.info(" typed " + e.getKeyChar() + " " + e); + } + + + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + //Log.info("wheel_event : " + e); + cursorPos.x = e.getX(); + cursorPos.y = e.getY(); + if (e.getWheelRotation()<0) { + inputIsPressed[5] = true; + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.down, + 5, + cursorPos); + inputIsPressed[5] = false; + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.up, + 5, + cursorPos); + } else if (e.getWheelRotation()>0) { + inputIsPressed[4] = true; + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.down, + 4, + cursorPos); + inputIsPressed[4] = false; + OS_SetInput(guiKeyBoardMode, + KeyType.mouse, + KeyStatus.up, + 4, + cursorPos); + } + } public static float getFrameTimeSecconds() { return delta; } @@ -648,30 +503,34 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ return System.currentTimeMillis(); } - - public static boolean isButtonRightDown() { - return rightButtonStateDown; - } - public static boolean isButtonLeftDown() { - return leftButtonStateDown; - } - - - public static float getDX() { - return (float) (currentMousePositionX-lastMousePositionX); - } - public static float getDY() { - return (float) (currentMousePositionY-lastMousePositionY); - } - - - public static float getDWheel() { - // TODO Auto-generated method stub - return (float) whellOffsetY; - } - @Override public int run() { + Runnable renderLoop = new Runnable() { + public void run() { +// fps.tic(); + if (!canvas.isValid()) { + System.exit(0); + return; + } + canvas.render(); +// fps.toc(); +// fps.draw(); + SwingUtilities.invokeLater(this); + } + }; + SwingUtilities.invokeLater(renderLoop); + + +// while (canvas != null && canvas.isValid()) { +// canvas.render(); +// try { +// Thread.sleep(10); +// } catch (InterruptedException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + // Run the rendering loop until the user has attempted to close // the window or has pressed the ESCAPE key. // while ( !glfwWindowShouldClose(window) ) { @@ -696,7 +555,7 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ // fps.toc(); // fps.draw(); // */ -// OS_Draw(true); +// // glfwSwapBuffers(window); // swap the color buffers // glfwPollEvents(); // /* @@ -710,7 +569,7 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ // } // */ // } -// System.exit(0); + //System.exit(0); return 0; } /****************************************************************************************/ @@ -721,26 +580,50 @@ public class ContextLWJGL_AWT extends Context implements MouseListener{ @Override public void setIcon(Uri inputFile) { + } + private void hideCursor() { + int[] pixels = new int[16 * 16]; + Image image = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(16, 16, pixels, 0, 16)); + Cursor transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0, 0), "invisiblecursor"); + frame.setCursor(transparentCursor); + } + private void showCursor() { + frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } @Override public void grabPointerEvents(boolean _status, Vector2f _forcedPosition) { if (_status == true) { - // permit to leave the windows - //glfwSetInputMode(this.window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - // Not permit to leave the windows -// glfwSetInputMode(this.window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - lastPositionGrab = _forcedPosition.clone(); + try { + this.robot = new Robot(); + hideCursor(); + } catch (AWTException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } else { -// glfwSetInputMode(this.window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - lastPositionGrab = null; + this.robot = null; + showCursor(); } }; @Override - public boolean isGrabPointerEvents() { return lastPositionGrab != null; }; - + public boolean isGrabPointerEvents() { return this.robot != null; }; + @Override + public void setFullScreen(boolean status){ + super.setFullScreen(status); + if (status == true) { + frame.setExtendedState(JFrame.MAXIMIZED_BOTH); + frame.setUndecorated(true); + } else { + frame.setExtendedState(JFrame.NORMAL); + frame.setUndecorated(false); + } + }; + public static Context create(Application application, String[] arg) { // TODO Auto-generated method stub return new ContextLWJGL_AWT(application, arg); } + + } diff --git a/src/org/atriaSoft/gale/resource/ResourceColored3DObject.java b/src/org/atriaSoft/gale/resource/ResourceColored3DObject.java new file mode 100644 index 0000000..c5e952e --- /dev/null +++ b/src/org/atriaSoft/gale/resource/ResourceColored3DObject.java @@ -0,0 +1,559 @@ +package org.atriaSoft.gale.resource; + +import java.nio.FloatBuffer; +import java.util.ArrayList; +import java.util.List; + +import org.atriaSoft.etk.Color; +import org.atriaSoft.etk.Uri; +import org.atriaSoft.etk.math.Matrix4f; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.Log; +import org.atriaSoft.gale.backend3d.OpenGL; +import org.atriaSoft.gale.backend3d.OpenGL.RenderMode; +import org.atriaSoft.gameEngine.resource.ResourceListTexturedMesh; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL40; + +public class ResourceColored3DObject extends Resource { + private ResourceProgram program; + private int GLPosition; + private int GLColor; + private int GLMatrixTransformation; + private int GLMatrixProjection; + private int GLMatrixView; + protected ResourceColored3DObject() { + super(); + addResourceType("ResourceColored3DObject"); + // get the shader resource : + this.GLPosition = 0; + this.program = ResourceProgram.create(new Uri("DATA_EGE", "simple3D.vert"), new Uri("DATA_EGE", "simple3D.frag")); + if (this.program != null) { + this.GLMatrixTransformation = this.program.getUniform("in_matrixTransformation"); + this.GLMatrixProjection = this.program.getUniform("in_matrixProjection"); + this.GLMatrixView = this.program.getUniform("in_matrixView"); + this.GLPosition = this.program.getAttribute("in_position"); + this.GLColor = this.program.getUniform("in_colors"); + } + } + public void draw(List vertices, + Color color, + boolean updateDepthBuffer, + boolean depthtest) { + if (vertices.size() <= 0) { + return; + } + if (this.program == null) { + Log.error("No shader ..."); + return; + } + if (true == depthtest) { + OpenGL.enable(OpenGL.Flag.flag_depthTest); + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(false); + } + } + //Log.debug(" display " << this.coord.size() << " elements" ); + this.program.use(); + Matrix4f projectionMatrix = OpenGL.getMatrix(); + Matrix4f viewMatrix = OpenGL.getCameraMatrix(); + Matrix4f transformationMatrix = Matrix4f.identity(); + this.program.uniformMatrix(this.GLMatrixView, viewMatrix); + this.program.uniformMatrix(this.GLMatrixProjection, projectionMatrix); + this.program.uniformMatrix(this.GLMatrixTransformation, transformationMatrix); + // color : + this.program.uniformColor(this.GLColor, color); + // position : + FloatBuffer buffer = storeDataInFloatBuffer(convertInFloat(vertices)); + this.program.sendAttribute(this.GLPosition, 3, buffer, 3); + if (color.a < 1.0f) { + OpenGL.enable(OpenGL.Flag.flag_blend); + } + // Request the draw of the elements: + OpenGL.drawArrays(OpenGL.RenderMode.triangle, 0, vertices.size()); + if (color.a < 1.0f) { + OpenGL.disable(OpenGL.Flag.flag_blend); + } + this.program.unUse(); + // Request the draw od the elements: + //glDrawArrays(GLLINES, 0, vertices.size()); + //this.GLprogram.UnUse(); + if (true == depthtest) { + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(true); + } + OpenGL.disable(OpenGL.Flag.flag_depthTest); + } + } + private float[] convertInFloat(List data) { + float[] out = new float[data.size()*3]; + for (int iii=0; iii vertices, + Color color, + Matrix4f transformationMatrix, + boolean updateDepthBuffer, + boolean depthtest) { + if (vertices.size() <= 0) { + return; + } + if (this.program == null) { + Log.error("No shader ..."); + return; + } + if (true == depthtest) { + OpenGL.enable(OpenGL.Flag.flag_depthTest); + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(false); + } + } + //Log.debug(" display " << this.coord.size() << " elements" ); + this.program.use(); + // set Matrix: translation/positionMatrix + Matrix4f projectionMatrix = OpenGL.getMatrix(); + Matrix4f viewMatrix = OpenGL.getCameraMatrix(); + this.program.uniformMatrix(this.GLMatrixView, viewMatrix); + this.program.uniformMatrix(this.GLMatrixProjection, projectionMatrix); + this.program.uniformMatrix(this.GLMatrixTransformation, transformationMatrix); + // position : + FloatBuffer buffer = storeDataInFloatBuffer(convertInFloat(vertices)); + this.program.sendAttribute(this.GLPosition, 3, buffer, 3); + // color : + Log.info("color= " + color + " " + this.GLPosition); + this.program.uniformColor(this.GLColor, color); + if (color.a < 1.0f) { + OpenGL.enable(OpenGL.Flag.flag_blend); + } + // Request the draw of the elements: + OpenGL.drawArrays(OpenGL.RenderMode.triangle, 0, vertices.size()); + if (color.a < 1.0f) { + OpenGL.disable(OpenGL.Flag.flag_blend); + } + this.program.unUse(); + if (true == depthtest) { + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(true); + } + OpenGL.disable(OpenGL.Flag.flag_depthTest); + } + } + public void drawLine(List vertices, + Color color, + Matrix4f transformationMatrix, + boolean updateDepthBuffer, + boolean depthtest) { + if (vertices.size() <= 0) { + return; + } + if (this.program == null) { + Log.error("No shader ..."); + return; + } + if (true == depthtest) { + OpenGL.enable(OpenGL.Flag.flag_depthTest); + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(false); + } + } + //Log.debug(" display " << this.coord.size() << " elements" ); + this.program.use(); + // set Matrix: translation/positionMatrix + Matrix4f projectionMatrix = OpenGL.getMatrix(); + Matrix4f viewMatrix = OpenGL.getCameraMatrix(); + this.program.uniformMatrix(this.GLMatrixView, viewMatrix); + this.program.uniformMatrix(this.GLMatrixProjection, projectionMatrix); + this.program.uniformMatrix(this.GLMatrixTransformation, transformationMatrix); + // position : + FloatBuffer buffer = storeDataInFloatBuffer(convertInFloat(vertices)); + this.program.sendAttribute(this.GLPosition, 3, buffer, 3); + // color : + this.program.uniformColor(this.GLColor, color); + if (color.a < 1.0f) { + OpenGL.enable(OpenGL.Flag.flag_blend); + } + // Request the draw od the elements: + OpenGL.drawArrays(OpenGL.RenderMode.line, 0, vertices.size()); + if (color.a < 1.0f) { + OpenGL.disable(OpenGL.Flag.flag_blend); + } + this.program.unUse(); + if (true == depthtest) { + if (false == updateDepthBuffer) { + OpenGL.setDeathMask(true); + } + OpenGL.disable(OpenGL.Flag.flag_depthTest); + } + } + public void drawCubeLine(Vector3f min, + Vector3f max, + Color color, + Matrix4f transformationMatrix, + boolean updateDepthBuffer, + boolean depthtest) { + List vertices = new ArrayList(); + vertices.add(new Vector3f(min.x, min.y,min.z)); + vertices.add(new Vector3f(max.x, min.y,min.z)); + + vertices.add(new Vector3f(max.x, min.y,min.z)); + vertices.add(new Vector3f(max.x, min.y,max.z)); + + vertices.add(new Vector3f(max.x, min.y,max.z)); + vertices.add(new Vector3f(min.x, min.y,max.z)); + + vertices.add(new Vector3f(min.x, min.y,max.z)); + vertices.add(new Vector3f(min.x, min.y,min.z)); + + + vertices.add(new Vector3f(min.x, max.y,min.z)); + vertices.add(new Vector3f(max.x, max.y,min.z)); + + vertices.add(new Vector3f(max.x, max.y,min.z)); + vertices.add(new Vector3f(max.x, max.y,max.z)); + + vertices.add(new Vector3f(max.x, max.y,max.z)); + vertices.add(new Vector3f(min.x, max.y,max.z)); + + vertices.add(new Vector3f(min.x, max.y,max.z)); + vertices.add(new Vector3f(min.x, max.y,min.z)); + + + vertices.add(new Vector3f(min.x, min.y,min.z)); + vertices.add(new Vector3f(min.x, max.y,min.z)); + + vertices.add(new Vector3f(max.x, min.y,min.z)); + vertices.add(new Vector3f(max.x, max.y,min.z)); + + vertices.add(new Vector3f(max.x, min.y,max.z)); + vertices.add(new Vector3f(max.x, max.y,max.z)); + + vertices.add(new Vector3f(min.x, min.y,max.z)); + vertices.add(new Vector3f(min.x, max.y,max.z)); + drawLine(vertices, color, transformationMatrix, updateDepthBuffer, depthtest); + } + public void drawSquare(Vector3f size, + Matrix4f transformationMatrix, + Color tmpColor) { + List tmpVertices = new ArrayList(); + int indices[] = { 0,1,2, 3,2,1, 4,0,6, + 6,0,2, 5,1,4, 4,1,0, + 7,3,1, 7,1,5, 5,4,7, + 7,4,6, 7,2,3, 7,6,2}; + Vector3f vertices[]={ new Vector3f(size.x,size.y,size.z), + new Vector3f(-size.x,size.y,size.z), + new Vector3f(size.x,-size.y,size.z), + new Vector3f(-size.x,-size.y,size.z), + new Vector3f(size.x,size.y,-size.z), + new Vector3f(-size.x,size.y,-size.z), + new Vector3f(size.x,-size.y,-size.z), + new Vector3f(-size.x,-size.y,-size.z)}; + tmpVertices.clear(); + for (int iii=0 ; iii<36 ; iii+=3) { + // normal calculation : + //btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]); + //normal.normalize (); + tmpVertices.add(vertices[indices[iii]]); + tmpVertices.add(vertices[indices[iii+1]]); + tmpVertices.add(vertices[indices[iii+2]]); + } + draw(tmpVertices, tmpColor, transformationMatrix, true, true); + } + public void drawSphere(float radius, + int lats, + int longs, + Matrix4f transformationMatrix, + Color tmpColor) { + List tmpVertices = new ArrayList();; + for(int iii=0; iii<=lats; ++iii) { + float lat0 = (float)Math.PI * (-0.5f + (float)(iii - 1) / lats); + float z0 = radius*(float)Math.sin(lat0); + float zr0 = radius*(float)Math.cos(lat0); + + float lat1 = (float)Math.PI * (-0.5f + (float)(iii) / lats); + float z1 = radius*(float)Math.sin(lat1); + float zr1 = radius*(float)Math.cos(lat1); + + for(int jjj=0; jjj tmpVertices = new ArrayList();; + // center to border (TOP) + + // center to border (TOP) + for(int jjj=0; jjj tmpVertices = new ArrayList();; + lats = (int)(lats / 2)*2; + + // center to border (TOP) + float offset = size*0.5f; + for(int iii=lats/2+1; iii<=lats; ++iii) { + float lat0 = (float)Math.PI * (-0.5f + (float)(iii - 1) / lats); + float z0 = radius*(float)Math.sin(lat0); + float zr0 = radius*(float)Math.cos(lat0); + + float lat1 = (float)Math.PI * (-0.5f + (float)(iii) / lats); + float z1 = radius*(float)Math.sin(lat1); + float zr1 = radius*(float)Math.cos(lat1); + + for(int jjj=0; jjj tmpVertices = new ArrayList(); + // center to border (TOP) + for(int jjj=0; jjj vertex, + List indice, + Matrix4f transformationMatrix, + Color tmpColor, + Vector3f offset) {// = new Vector3f(0,0,0.1f) + List tmpVertices = new ArrayList();; + for (int iii=0; iii elementList = new ArrayList(); //!< List of all the attribute requested by the user - private List listOfVBOUsed = new ArrayList(); //!< retain the list of VBO used to disable it when unuse program ... - private boolean hasTexture = false; //!< A texture has been set to the current shader - private boolean hasTexture1 = false; //!< A texture has been set to the current shader +// private List listOfVBOUsed = new ArrayList(); //!< retain the list of VBO used to disable it when unuse program ... +// private boolean hasTexture = false; //!< A texture has been set to the current shader +// private boolean hasTexture1 = false; //!< A texture has been set to the current shader /** * @brief Contructor of an opengl Program. * @param[in] uri Uri of the file @@ -85,8 +79,8 @@ public class ResourceProgram extends Resource { this.shaderVertex = null; } this.elementList.clear(); - this.hasTexture = false; - this.hasTexture1 = false; +// this.hasTexture = false; +// this.hasTexture1 = false; } /** * @brief Check If an Id is valid in the shader or not (sometime the shader have not some attribute, then we need to display some error) @@ -240,18 +234,24 @@ public class ResourceProgram extends Resource { // GL20.glVertexAttribPointer(attributeNumber, coordinateSize, GL11.GL_FLOAT, false, 0, 0); // GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); // } + + private float[] convertInFloat(List data) { + float[] out = new float[data.size()*3]; + for (int iii=0; iii data) { -// sendAttribute(idElem, 2/*u,v / x,y*/, data[0]); -// } -// public void sendAttribute(int idElem, etk::Vector data) { -// sendAttribute(idElem, 3/*x,y,z,unused*/, data[0], 4*sizeof(btScalar)); +//// public void sendAttribute(int idElem, etk::Vector data) { +//// sendAttribute(idElem, 2/*u,v / x,y*/, data[0]); +//// } +// public void sendAttribute(int idElem, List data) { +// sendAttribute3fv(idElem, convertInFloat(data)); // } + public void sendAttribute(int idElem, int nbElement, FloatBuffer data, int jumpBetweenSample) { + if (this.exist == false) { + return; + } + if ( idElem < 0 + || (long)idElem > this.elementList.size()) { + Log.error("idElem = " + idElem + " not in [0.." + (this.elementList.size()-1) + "]"); + return; + } + if (this.elementList.get(idElem).isLinked == false) { + return; + } + //GL40.glBindVertexArray(this.elementList.get(idElem).elementId); + Log.error("[" + this.elementList.get(idElem).name + "] send " + 3 + " element"); + GL40.glVertexAttribPointer( + this.elementList.get(idElem).elementId, + nbElement, + GL40.GL_FLOAT, + false, + jumpBetweenSample*4, /* 4 is the size of float in the generic system...*/ + data); + //checkGlError("glVertexAttribPointer", LINE, idElem); + GL40.glEnableVertexAttribArray(this.elementList.get(idElem).elementId); + //checkGlError("glEnableVertexAttribArray", LINE, idElem); + } // public void sendAttribute(int idElem, etk::Vector> data) { // sendAttribute(idElem, 4/*r,g,b,a*/, data[0]); // } diff --git a/src/org/atriaSoft/gale/resource/ResourceVirtualArrayObject.java b/src/org/atriaSoft/gale/resource/ResourceVirtualArrayObject.java index 002fca6..75e7f94 100644 --- a/src/org/atriaSoft/gale/resource/ResourceVirtualArrayObject.java +++ b/src/org/atriaSoft/gale/resource/ResourceVirtualArrayObject.java @@ -42,6 +42,7 @@ public class ResourceVirtualArrayObject extends Resource { GL30.glBindVertexArray(vaoID); if (positions != null) { GL20.glEnableVertexAttribArray(INDICE_VBO_POSITIONS); + //Log.info("unbind POSITION"); } if (textureCoordinates != null) { GL20.glEnableVertexAttribArray(INDICE_VBO_TEXTURE_COORDINATES); diff --git a/src/org/atriaSoft/gameEngine/ControlCameraPlayer.java b/src/org/atriaSoft/gameEngine/ControlCameraPlayer.java index 161eb64..ab31603 100644 --- a/src/org/atriaSoft/gameEngine/ControlCameraPlayer.java +++ b/src/org/atriaSoft/gameEngine/ControlCameraPlayer.java @@ -18,17 +18,16 @@ import renderEngine.DisplayManager; public class ControlCameraPlayer implements ControlInterface { private Camera camera; - private float distanceFromCenter = 20; - private float angleZ = 0; - private float pitch = 0; + private float distanceFromCenter = 2.5f; + private boolean fpsMode = false; private Entity playerEntity; - private Vector2f lastMousePosition = null; private ComponentPositionPlayer playerPosition; private ComponentPlayer player; private boolean moveUp = false; private boolean moveDown = false; private boolean moveLeft = false; private boolean moveRight = false; + private boolean walk = false; public ControlCameraPlayer(Camera camera, Entity playerEntity) { this.camera = camera; @@ -47,18 +46,36 @@ public class ControlCameraPlayer implements ControlInterface { } @Override public boolean onEventEntry(EventEntry event) { - if(event.getType() == KeyKeyboard.up) { + if(event.getType() == KeyKeyboard.up + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'Z' ))) { moveUp = getState(event.getStatus(), moveUp); } - if(event.getType() == KeyKeyboard.left) { + if(event.getType() == KeyKeyboard.left + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q' ))) { moveLeft = getState(event.getStatus(), moveLeft); } - if(event.getType() == KeyKeyboard.right) { + if(event.getType() == KeyKeyboard.right + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D' ))) { moveRight = getState(event.getStatus(), moveRight); } - if(event.getType() == KeyKeyboard.down) { + if(event.getType() == KeyKeyboard.down + || (event.getType() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S' ))) { moveDown = getState(event.getStatus(), moveDown); } + if(event.getType() == KeyKeyboard.shiftLeft || event.getType() == KeyKeyboard.shiftRight) { + walk = event.getSpecialKey().getShift(); + } + if(event.getType() == KeyKeyboard.f10) { + if (event.getStatus() == KeyStatus.up) { + if (fpsMode == false) { + fpsMode = true; + distanceFromCenter = 0; + } else { + fpsMode = false; + distanceFromCenter = 2.5f; + } + } + } return false; } @@ -66,16 +83,26 @@ public class ControlCameraPlayer implements ControlInterface { public boolean onEventInput(EventInput event, Vector2f relativePosition) { // Log.info("" + event); // TODO Auto-generated method stub - if (event.getInputId() == 4) { - if (event.getStatus() == KeyStatus.down) { - distanceFromCenter -= 1; + if (fpsMode == false) { + if (event.getInputId() == 4) { + if (event.getStatus() == KeyStatus.down) { + distanceFromCenter -= 0.2; + } + if (distanceFromCenter < 0.0) { + distanceFromCenter = 0.0f; + } + return true; + } else if (event.getInputId() == 5) { + if (event.getStatus() == KeyStatus.down) { + distanceFromCenter += 0.2; + } + if (distanceFromCenter < 0.3) { + distanceFromCenter = 0.3f; + } + return true; } - return true; - } else if (event.getInputId() == 5) { - if (event.getStatus() == KeyStatus.down) { - distanceFromCenter += 1; - } - return true; + } else { + distanceFromCenter = 0; } // TODO: check if grabbing is enable ... // in grabbing mouse only: @@ -86,14 +113,15 @@ public class ControlCameraPlayer implements ControlInterface { Vector2f delta = event.getPosition().clone(); //angleZ += delta.x; //this.camera.setYaw(this.camera.getYaw() + (float)Math.toRadians(delta.x)); - this.camera.setPitch(this.camera.getPitch() + (float)Math.toRadians(delta.y)); + this.camera.setPitch(this.camera.getPitch() + (float)Math.toRadians(delta.y * this.player.getTurnSpeed())); if (this.camera.getPitch()>0) { this.camera.setPitch(0); } if (this.camera.getPitch()<-Math.PI) { this.camera.setPitch((float)-Math.PI); } - this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x)); + /* + this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x * this.player.getTurnSpeed())); Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch()); if (this.camera.getRoll()>Math.PI) { this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f); @@ -101,7 +129,19 @@ public class ControlCameraPlayer implements ControlInterface { if (this.camera.getRoll()<-Math.PI) { this.camera.setRoll(this.camera.getRoll()+(float)Math.PI*2.0f); } - this.playerPosition.setAngles(new Vector3f(0,0,this.camera.getRoll())); + this.playerPosition.setAngles(new Vector3f(0,0,-this.camera.getRoll())); + */ + float tmpAngle = this.playerPosition.getAngles().z + (float)Math.toRadians(delta.x * this.player.getTurnSpeed()); + + if (tmpAngle > Math.PI) { + tmpAngle -= (float)Math.PI*2.0f; + } + if (tmpAngle < -Math.PI) { + tmpAngle += (float)Math.PI*2.0f; + } + this.playerPosition.setAngles(new Vector3f(0,0,tmpAngle)); + this.camera.setRoll(-this.playerPosition.getAngles().z); + Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch()); } return false; } @@ -109,6 +149,11 @@ public class ControlCameraPlayer implements ControlInterface { @Override public void periodicCall(EventTime event) { float speed = 0; + float walkFactor = 1; + if (this.walk == true) { + walkFactor = this.player.getWalkFactor(); + } + //distanceFromCenter = 6; if (moveUp != moveDown) { if (moveUp) { speed = this.player.getRunSpeed(); @@ -116,16 +161,36 @@ public class ControlCameraPlayer implements ControlInterface { speed = -this.player.getRunSpeed(); } } - float distance = speed * event.getTimeDeltaCallSecond(); - float dx = (float) (distance * Math.sin(this.playerPosition.getAngles().z)); + float distance = speed * walkFactor * event.getTimeDeltaCallSecond(); + float dx = -(float) (distance * Math.sin(this.playerPosition.getAngles().z)); float dy = (float) (distance * Math.cos(this.playerPosition.getAngles().z)); - - Log.error("update position ..." + dx + " " + dy); - this.playerPosition.getTransform().getPosition().x += dx; - this.playerPosition.getTransform().getPosition().y += dy; - this.camera.getPosition().x = this.playerPosition.getTransform().getPosition().x; - this.camera.getPosition().y = this.playerPosition.getTransform().getPosition().y; - this.camera.getPosition().z = this.playerPosition.getTransform().getPosition().z; + speed = 0; + if (moveRight != moveLeft) { + if (moveRight) { + speed = this.player.getStrafSpeed(); + } else { + speed = -this.player.getStrafSpeed(); + } + } + distance = speed * walkFactor * event.getTimeDeltaCallSecond(); + float dxStraf = (float) (distance * Math.sin((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); + float dyStraf = -(float) (distance * Math.cos((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); + //Log.error("update position ..." + dx + " " + dy); + this.playerPosition.getTransform().getPosition().x += dx + dxStraf; + this.playerPosition.getTransform().getPosition().y += dy + dyStraf; + // here the camera is behind the player, we need to move the camera ... + //Log.info(" pitch: " + Math.toDegrees(this.camera.getPitch()) + " " + Math.toDegrees(this.playerPosition.getAngles().z)); + float horinzontalDistance = (float) (distanceFromCenter * Math.sin(this.camera.getPitch())); + float verticalDistance = (float) (distanceFromCenter * Math.cos(this.camera.getPitch())); + //Log.info(" distanceFromCenter " + distanceFromCenter); + float tmp = -horinzontalDistance; + float theta = (float)Math.PI + this.playerPosition.getAngles().z;// - (float)Math.PI*0.5f; + float offsetX = (float) (tmp * Math.sin(-theta)); + float offsetY = (float) (tmp * Math.cos(-theta)); + //Log.info(" res" + offsetX + " " + offsetY); + this.camera.getPosition().x = this.playerPosition.getTransform().getPosition().x + offsetX; + this.camera.getPosition().y = this.playerPosition.getTransform().getPosition().y + offsetY; + this.camera.getPosition().z = this.playerPosition.getTransform().getPosition().z + 1.6f + verticalDistance; } } diff --git a/src/org/atriaSoft/gameEngine/ControlCameraPlayerFPS.java b/src/org/atriaSoft/gameEngine/ControlCameraPlayerFPS.java new file mode 100644 index 0000000..e366e41 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/ControlCameraPlayerFPS.java @@ -0,0 +1,128 @@ +package org.atriaSoft.gameEngine; + +import org.atriaSoft.etk.math.Vector2f; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.Gale; +import org.atriaSoft.gale.event.EventEntry; +import org.atriaSoft.gale.event.EventInput; +import org.atriaSoft.gale.event.EventTime; +import org.atriaSoft.gale.key.KeyKeyboard; +import org.atriaSoft.gale.key.KeyStatus; +import org.atriaSoft.gameEngine.camera.Camera; +import org.atriaSoft.gameEngine.components.ComponentPlayer; +import org.atriaSoft.gameEngine.components.ComponentPosition; +import org.atriaSoft.gameEngine.components.ComponentPositionPlayer; + +import renderEngine.DisplayManager; + + +public class ControlCameraPlayerFPS implements ControlInterface { + private Camera camera; + private Entity playerEntity; + private ComponentPositionPlayer playerPosition; + private ComponentPlayer player; + private boolean moveUp = false; + private boolean moveDown = false; + private boolean moveLeft = false; + private boolean moveRight = false; + + public ControlCameraPlayerFPS(Camera camera, Entity playerEntity) { + this.camera = camera; + this.playerEntity = playerEntity; + this.playerPosition = (ComponentPositionPlayer)this.playerEntity.getComponent("position"); + this.player = (ComponentPlayer)this.playerEntity.getComponent("player"); + } + private boolean getState(KeyStatus state, boolean previousState) { + if (state == KeyStatus.down) { + return true; + } + if (state == KeyStatus.up) { + return false; + } + return previousState; + } + @Override + public boolean onEventEntry(EventEntry event) { + if(event.getType() == KeyKeyboard.up + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'z' ))) { + moveUp = getState(event.getStatus(), moveUp); + } + if(event.getType() == KeyKeyboard.left + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q' ))) { + moveLeft = getState(event.getStatus(), moveLeft); + } + if(event.getType() == KeyKeyboard.right + || (event.getType() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D' ))) { + moveRight = getState(event.getStatus(), moveRight); + } + if(event.getType() == KeyKeyboard.down + || (event.getType() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S' ))) { + moveDown = getState(event.getStatus(), moveDown); + } + return false; + } + + @Override + public boolean onEventInput(EventInput event, Vector2f relativePosition) { + // Log.info("" + event); + // in grabbing mouse only: + if (Gale.getContext().isGrabPointerEvents() == false) { + return false; + } + if (event.getStatus() == KeyStatus.move) { + Vector2f delta = event.getPosition().clone(); + //angleZ += delta.x; + //this.camera.setYaw(this.camera.getYaw() + (float)Math.toRadians(delta.x)); + this.camera.setPitch(this.camera.getPitch() + (float)Math.toRadians(delta.y * this.player.getTurnSpeed())); + if (this.camera.getPitch()>0) { + this.camera.setPitch(0); + } + if (this.camera.getPitch()<-Math.PI) { + this.camera.setPitch((float)-Math.PI); + } + this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x * this.player.getTurnSpeed())); + Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch()); + if (this.camera.getRoll()>Math.PI) { + this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f); + } + if (this.camera.getRoll()<-Math.PI) { + this.camera.setRoll(this.camera.getRoll()+(float)Math.PI*2.0f); + } + this.playerPosition.setAngles(new Vector3f(0,0,this.camera.getRoll())); + } + return false; + } + + @Override + public void periodicCall(EventTime event) { + float speed = 0; + if (moveUp != moveDown) { + if (moveUp) { + speed = this.player.getRunSpeed(); + } else { + speed = -this.player.getRunSpeed(); + } + } + float distance = speed * event.getTimeDeltaCallSecond(); + float dx = (float) (distance * Math.sin(this.playerPosition.getAngles().z)); + float dy = (float) (distance * Math.cos(this.playerPosition.getAngles().z)); + speed = 0; + if (moveRight != moveLeft) { + if (moveRight) { + speed = this.player.getStrafSpeed(); + } else { + speed = -this.player.getStrafSpeed(); + } + } + distance = speed * event.getTimeDeltaCallSecond(); + float dxStraf = (float) (distance * Math.sin((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); + float dyStraf = (float) (distance * Math.cos((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); + //Log.error("update position ..." + dx + " " + dy); + this.playerPosition.getTransform().getPosition().x += dx + dxStraf; + this.playerPosition.getTransform().getPosition().y += dy + dyStraf; + this.camera.getPosition().x = this.playerPosition.getTransform().getPosition().x; + this.camera.getPosition().y = this.playerPosition.getTransform().getPosition().y; + this.camera.getPosition().z = this.playerPosition.getTransform().getPosition().z; + } + +} diff --git a/src/org/atriaSoft/gameEngine/Environement.java b/src/org/atriaSoft/gameEngine/Environement.java index 02521bb..f7b9800 100644 --- a/src/org/atriaSoft/gameEngine/Environement.java +++ b/src/org/atriaSoft/gameEngine/Environement.java @@ -43,10 +43,10 @@ public class Environement { public Environement() { // we add the 4 classical engines (the order is used to the global rendering cycle ... addEngine(new EnginePlayer(this)); - addEngine(new EnginePhysics(this)); addEngine(new EngineAI(this)); addEngine(new EngineDynamicMeshs(this)); addEngine(new EngineRender(this)); + addEngine(new EnginePhysics(this)); addEngine(new EngineParticle(this)); addEngine(new EngineLight(this)); } diff --git a/src/org/atriaSoft/gameEngine/components/ComponentPhysics.java b/src/org/atriaSoft/gameEngine/components/ComponentPhysics.java new file mode 100644 index 0000000..9c42779 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/components/ComponentPhysics.java @@ -0,0 +1,73 @@ +package org.atriaSoft.gameEngine.components; + +import java.util.ArrayList; +import java.util.List; + +import org.atriaSoft.etk.Color; +import org.atriaSoft.etk.math.Matrix4f; +import org.atriaSoft.gale.backend3d.OpenGL; +import org.atriaSoft.gale.resource.ResourceColored3DObject; +import org.atriaSoft.gale.test.sample2.Log; +import org.atriaSoft.gameEngine.Component; +import org.atriaSoft.gameEngine.physics.PhysicCollisionAABB; +import org.atriaSoft.gameEngine.physics.PhysicShape; + +import entities.Entity; + +public class ComponentPhysics extends Component { + private PhysicCollisionAABB aabb; + private List shapes = new ArrayList(); + private ComponentPosition position; + @Override + public String getType() { + return "physics"; + } + @Override + public void addFriendComponent(Component component) { + if (component.getType().contentEquals("position")) { + position = (ComponentPosition)component; + } + } + @Override + public void removeFriendComponent(Component component) { + // nothing to do. + } + + public void updateAABB() { + if (position == null) { + Log.info("No position in Entity "); + return; + } + // TODO: Add a flag to check if it is needed to update the AABB... + PhysicCollisionAABB aabb_new = PhysicCollisionAABB.beforeCalculated(); + for (PhysicShape shape : shapes) { + shape.updateAABB(position.getTransform(), aabb_new); + } + aabb = aabb_new; + } + + public PhysicCollisionAABB getcurrentAABB() { + return aabb; + } + public void applyForces(float timeStep) { + // TODO Auto-generated method stub + + } + public void renderDebug(ResourceColored3DObject debugDrawProperty) { + if (aabb != null) { + debugDrawProperty.drawCubeLine(aabb.getMin(), aabb.getMax(), new Color(1,1,1,1), Matrix4f.identity(), true, true); + //debugDrawProperty.drawCubeLine(new Vector3f(0,0,0), new Vector3f(32,32,32), new Color(1,0,1,1), Matrix4f.identity(), true, true); + } else { + Log.error("no AABB"); + } + for (PhysicShape shape : shapes) { + shape.renderDebug(position.getTransform(), debugDrawProperty); + } + } + public void addShape(PhysicShape shape) { + shapes.add(shape); + } + public void clearShape() { + shapes.clear(); + } +} diff --git a/src/org/atriaSoft/gameEngine/components/ComponentPlayer.java b/src/org/atriaSoft/gameEngine/components/ComponentPlayer.java index d5c2494..1a15078 100644 --- a/src/org/atriaSoft/gameEngine/components/ComponentPlayer.java +++ b/src/org/atriaSoft/gameEngine/components/ComponentPlayer.java @@ -5,8 +5,10 @@ import org.atriaSoft.gameEngine.engines.EnginePlayer; public class ComponentPlayer extends Component { private float runSpeed = 35; - private float turnSpeed = (float)Math.toRadians(120); + private float strafSpeed = 25; + private float turnSpeed = 0.45f; private float jumpPower = 30; + private float walkFactor = 0.37f; public ComponentPlayer() { @@ -46,5 +48,21 @@ public class ComponentPlayer extends Component { this.jumpPower = jumpPower; } + public float getStrafSpeed() { + return strafSpeed; + } + + public void setStrafSpeed(float strafSpeed) { + this.strafSpeed = strafSpeed; + } + + public float getWalkFactor() { + return walkFactor; + } + + public void setWalkFactor(float walkFactor) { + this.walkFactor = walkFactor; + } + } diff --git a/src/org/atriaSoft/gameEngine/components/ComponentPositionPlayer.java b/src/org/atriaSoft/gameEngine/components/ComponentPositionPlayer.java index d018b42..29df55c 100644 --- a/src/org/atriaSoft/gameEngine/components/ComponentPositionPlayer.java +++ b/src/org/atriaSoft/gameEngine/components/ComponentPositionPlayer.java @@ -21,7 +21,7 @@ public class ComponentPositionPlayer extends ComponentPosition { } public void setAngles(Vector3f angles) { - this.angles = angles; + this.angles = angles.clone(); // TODO: update transform3D this.transform.getOrientation().setEulerAngles(this.angles); } diff --git a/src/org/atriaSoft/gameEngine/components/CoponentPhysics.java b/src/org/atriaSoft/gameEngine/components/CoponentPhysics.java deleted file mode 100644 index 91b6bd9..0000000 --- a/src/org/atriaSoft/gameEngine/components/CoponentPhysics.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.atriaSoft.gameEngine.components; - -import org.atriaSoft.gameEngine.Component; - -public class CoponentPhysics extends Component { - - @Override - public String getType() { - // TODO Auto-generated method stub - return "physics"; - } -} diff --git a/src/org/atriaSoft/gameEngine/data/simple3D.frag b/src/org/atriaSoft/gameEngine/data/simple3D.frag new file mode 100644 index 0000000..4bf4c15 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/data/simple3D.frag @@ -0,0 +1,16 @@ +#version 400 core + +#ifdef GL_ES +precision mediump float; +precision mediump int; +#endif + +in vec4 io_color; + +// output: +out vec4 out_Color; + +void main(void) { + out_Color = io_color; +} + diff --git a/src/org/atriaSoft/gameEngine/data/simple3D.vert b/src/org/atriaSoft/gameEngine/data/simple3D.vert new file mode 100644 index 0000000..985abb4 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/data/simple3D.vert @@ -0,0 +1,21 @@ +#version 400 core + +#ifdef GL_ES +precision mediump float; +precision mediump int; +#endif + +// Input : +in vec3 in_position; +uniform vec4 in_colors; +uniform mat4 in_matrixTransformation; +uniform mat4 in_matrixProjection; +uniform mat4 in_matrixView; + +// output : +out vec4 io_color; + +void main(void) { + gl_Position = in_matrixProjection * in_matrixView * in_matrixTransformation * vec4(in_position, 1.0); + io_color = vec4(in_colors.xyz, 0.3); +} diff --git a/src/org/atriaSoft/gameEngine/engines/EnginePhysics.java b/src/org/atriaSoft/gameEngine/engines/EnginePhysics.java index 266f572..81d4364 100644 --- a/src/org/atriaSoft/gameEngine/engines/EnginePhysics.java +++ b/src/org/atriaSoft/gameEngine/engines/EnginePhysics.java @@ -1,13 +1,27 @@ package org.atriaSoft.gameEngine.engines; +import java.util.Vector; + +import org.atriaSoft.etk.Color; +import org.atriaSoft.etk.math.Matrix4f; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.resource.ResourceColored3DObject; +import org.atriaSoft.gale.test.sample2.Log; import org.atriaSoft.gameEngine.Component; import org.atriaSoft.gameEngine.Engine; import org.atriaSoft.gameEngine.Environement; import org.atriaSoft.gameEngine.camera.Camera; +import org.atriaSoft.gameEngine.components.ComponentAI; +import org.atriaSoft.gameEngine.components.ComponentPhysics; +import org.atriaSoft.gameEngine.components.ComponentRender; public class EnginePhysics extends Engine { public static final String ENGINE_NAME = "physics"; - + private float accumulator = 0; + private static float TIME_STEP = 0.02f; + private Vector components = new Vector(); + private ResourceColored3DObject debugDrawProperty = ResourceColored3DObject.create(); + public EnginePhysics(Environement env) { super(env); // TODO Auto-generated constructor stub @@ -15,26 +29,62 @@ public class EnginePhysics extends Engine { @Override public void componentRemove(Component ref) { - // TODO Auto-generated method stub - + components.remove(ref); } @Override public void componentAdd(Component ref) { - // TODO Auto-generated method stub - + if (ref instanceof ComponentPhysics == false) { + return; + } + components.add((ComponentPhysics)ref); } @Override public void update(long deltaMili) { - // TODO Auto-generated method stub + // Add the time difference in the accumulator + accumulator += (float)deltaMili*0.0001f; + // While there is enough accumulated time to take one or several physics steps + while (accumulator >= TIME_STEP) { + Log.info("update physic ... " + accumulator); + applyForces(TIME_STEP); + updateAABB(TIME_STEP); + updateCollisions(TIME_STEP); + GenerateResultCollisionsForces(TIME_STEP); + // Decrease the accumulated time + accumulator -= TIME_STEP; + } + + } + + private void applyForces(float timeStep) { + for (ComponentPhysics it: components) { + it.applyForces(TIME_STEP); + } + } + private void updateAABB(float timeStep) { + for (ComponentPhysics it: components) { + it.updateAABB(); + } + } + private void updateCollisions(float timeStep) { + + } + private void GenerateResultCollisionsForces(float timeStep) { } @Override public void render(long deltaMili, Camera camera) { // TODO Auto-generated method stub - + for (ComponentPhysics it: this.components) { + //Log.info("Render " + it); + it.renderDebug(debugDrawProperty); + } + //debugDrawProperty.drawCone(2, 5, 9, 12, Matrix4f.identity(), new Color(1,1,0,1)); + //debugDrawProperty.drawSquare(new Vector3f(1,1,1), Matrix4f.identity(), new Color(1,1,0,1)); + //debugDrawProperty.drawCubeLine(new Vector3f(1,1,1), new Vector3f(5,5,5), new Color(1,0,1,1), Matrix4f.identity(), true, true); + //debugDrawProperty.drawCubeLine(new Vector3f(0,0,0), new Vector3f(32,32,32), new Color(1,0,1,1), Matrix4f.identity(), true, true); } @Override diff --git a/src/org/atriaSoft/gameEngine/map/MapVoxel.java b/src/org/atriaSoft/gameEngine/map/MapVoxel.java index 811d5b4..52cbc95 100644 --- a/src/org/atriaSoft/gameEngine/map/MapVoxel.java +++ b/src/org/atriaSoft/gameEngine/map/MapVoxel.java @@ -14,6 +14,7 @@ import org.atriaSoft.gameEngine.Material; import org.atriaSoft.gameEngine.components.ComponentLight; import org.atriaSoft.gameEngine.components.ComponentLightSun; import org.atriaSoft.gameEngine.components.ComponentMaterials; +import org.atriaSoft.gameEngine.components.ComponentPhysics; import org.atriaSoft.gameEngine.components.ComponentPosition; import org.atriaSoft.gameEngine.components.ComponentRenderTexturedMaterialsDynamicMeshs; import org.atriaSoft.gameEngine.components.ComponentRenderTexturedMaterialsStaticMeshs; @@ -24,6 +25,8 @@ import org.atriaSoft.gameEngine.components.ComponentTexture; import org.atriaSoft.gameEngine.components.ComponentTextures; import org.atriaSoft.gameEngine.engines.EngineLight; import org.atriaSoft.gameEngine.engines.EngineMap; +import org.atriaSoft.gameEngine.physics.PhysicBox; +import org.atriaSoft.gameEngine.physics.PhysicMapVoxel; public class MapVoxel extends EngineMap { //List listOfChunks = new ArrayList(); @@ -71,6 +74,10 @@ public class MapVoxel extends EngineMap { new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); + ComponentPhysics physics = new ComponentPhysics(); + PhysicMapVoxel box = new PhysicMapVoxel(tmpVoxelChunk); + physics.addShape(box); + tmpEntity.addComponent(physics); this.env.addEntity(tmpEntity); } diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicBox.java b/src/org/atriaSoft/gameEngine/physics/PhysicBox.java new file mode 100644 index 0000000..8edfe03 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicBox.java @@ -0,0 +1,36 @@ +package org.atriaSoft.gameEngine.physics; + +import org.atriaSoft.etk.Color; +import org.atriaSoft.etk.math.Transform3D; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.resource.ResourceColored3DObject; + +public class PhysicBox extends PhysicShape { + // Box size property in X, Y and Z + private Vector3f size = new Vector3f(1,1,1); + public PhysicBox() { + super(PhysicShapeType.BOX); + } + public Vector3f getSize() { + return size; + } + public void setSize(Vector3f size) { + this.size = size; + } + @Override + public void updateAABB(Transform3D transform, PhysicCollisionAABB aabb) { + // TODO Auto-generated method stub + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(this.size.x*0.5f,this.size.y*0.5f,this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(-this.size.x*0.5f,this.size.y*0.5f,this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(-this.size.x*0.5f,-this.size.y*0.5f,this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(this.size.x*0.5f,-this.size.y*0.5f,this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(this.size.x*0.5f,this.size.y*0.5f,-this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(-this.size.x*0.5f,this.size.y*0.5f,-this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(-this.size.x*0.5f,-this.size.y*0.5f,-this.size.z*0.5f)))); + aabb.update(transform.multiply(this.transform.multiply(new Vector3f(this.size.x*0.5f,-this.size.y*0.5f,-this.size.z*0.5f)))); + } + @Override + public void renderDebug(Transform3D transform, ResourceColored3DObject debugDrawProperty) { + debugDrawProperty.drawSquare(this.size.multiply_new(0.5f), this.transform.getOpenGLMatrix().multiply_new(transform.getOpenGLMatrix()), new Color(0,1,0,0.25f)); + } +} diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicCollisionAABB.java b/src/org/atriaSoft/gameEngine/physics/PhysicCollisionAABB.java new file mode 100644 index 0000000..10f3465 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicCollisionAABB.java @@ -0,0 +1,74 @@ +package org.atriaSoft.gameEngine.physics; + +import org.atriaSoft.etk.math.Vector3f; + +public class PhysicCollisionAABB { + public float minX; + public float minY; + public float minZ; + public float maxX; + public float maxY; + public float maxZ; + public PhysicCollisionAABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { + super(); + this.minX = minX; + this.minY = minY; + this.minZ = minZ; + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + } + public boolean intersect(PhysicCollisionAABB other) { + if (minX > other.maxX) { + return false; + } + if (maxX < other.minX) { + return false; + } + if (minY > other.maxY) { + return false; + } + if (maxY < other.minY) { + return false; + } + if (minZ > other.maxZ) { + return false; + } + if (maxZ < other.minZ) { + return false; + } + return true; + } + public void update(Vector3f point) { + if (minX > point.x) { + minX = point.x; + } + if (maxX < point.x) { + maxX = point.x; + } + if (minY > point.y) { + minY = point.y; + } + if (maxY < point.y) { + maxY = point.y; + } + if (minZ > point.z) { + minZ = point.z; + } + if (maxZ < point.z) { + maxZ = point.z; + } + } + public Vector3f getMin() { + return new Vector3f(minX, minY, minZ); + } + public Vector3f getMax() { + return new Vector3f(maxX, maxY, maxZ); + } + public static PhysicCollisionAABB beforeCalculated() { + // TODO Auto-generated method stub + return new PhysicCollisionAABB(999999,999999,999999,-999999,-999999,-999999); + } +} + + diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicMapVoxel.java b/src/org/atriaSoft/gameEngine/physics/PhysicMapVoxel.java new file mode 100644 index 0000000..eaa4ac4 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicMapVoxel.java @@ -0,0 +1,31 @@ +package org.atriaSoft.gameEngine.physics; + +import org.atriaSoft.etk.math.Transform3D; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.resource.ResourceColored3DObject; +import org.atriaSoft.gameEngine.map.VoxelChunk; + +public class PhysicMapVoxel extends PhysicShape { + // Box size property in X, Y and Z + private VoxelChunk chunk; + public PhysicMapVoxel(VoxelChunk chunk) { + super(PhysicShapeType.MAP_VOXEL); + this.chunk = chunk; + } + @Override + public void updateAABB(Transform3D transform, PhysicCollisionAABB aabb) { + if (this.chunk == null) { + return; + } + aabb.update(new Vector3f(this.chunk.getPosition().x,this.chunk.getPosition().y,this.chunk.getPosition().z)); + aabb.update(new Vector3f( + this.chunk.getPosition().x + VoxelChunk.VOXEL_CHUNK_SIZE, + this.chunk.getPosition().y + VoxelChunk.VOXEL_CHUNK_SIZE, + this.chunk.getPosition().z + VoxelChunk.VOXEL_CHUNK_SIZE)); + } + @Override + public void renderDebug(Transform3D transform, ResourceColored3DObject debugDrawProperty) { + + + } +} diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicShape.java b/src/org/atriaSoft/gameEngine/physics/PhysicShape.java new file mode 100644 index 0000000..12d0028 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicShape.java @@ -0,0 +1,59 @@ +package org.atriaSoft.gameEngine.physics; + +import org.atriaSoft.etk.math.Quaternion; +import org.atriaSoft.etk.math.Transform3D; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.resource.ResourceColored3DObject; + +public abstract class PhysicShape { +// protected Quaternion quaternion; +// protected Vector3f origin; + protected Transform3D transform; + protected float mass = 0; + protected final PhysicShapeType type; + + public PhysicShape(PhysicShapeType type) { + this.type = type; + this.transform = new Transform3D(); +// this.quaternion = Quaternion.identity(); +// this.origin = Vector3f.zero(); + this.mass = 0; + } + public PhysicShape(PhysicShapeType type, Quaternion quaternion, Vector3f origin, float mass) { + this.type = type; + this.transform = new Transform3D(origin, quaternion); +// this.quaternion = quaternion; +// this.origin = origin; + this.mass = mass; + } + public Quaternion getQuaternion() { + return transform.getOrientation(); + } + public void setQuaternion(Quaternion quaternion) { + this.transform.setOrientation(quaternion); + } + public Vector3f getOrigin() { + return this.transform.getPosition(); + } + public void setOrigin(Vector3f origin) { + this.transform.setPosition(origin); + } + public Transform3D getTransform() { + return transform; + } + public void setTransform(Transform3D transform) { + this.transform = transform; + } + public float getMass() { + return mass; + } + public void setMass(float mass) { + this.mass = mass; + } + public PhysicShapeType getType() { + return type; + } + public abstract void updateAABB(Transform3D transform, PhysicCollisionAABB aabb); + public abstract void renderDebug(Transform3D transform, ResourceColored3DObject debugDrawProperty); + +} diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicShapeType.java b/src/org/atriaSoft/gameEngine/physics/PhysicShapeType.java new file mode 100644 index 0000000..2522644 --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicShapeType.java @@ -0,0 +1,13 @@ +package org.atriaSoft.gameEngine.physics; + +public enum PhysicShapeType { + UNKNOWN, + BOX, + CAPSULE, + CONE, + CONVEXHULL, + CYLINDER, + SPHERE, + CONCAVE, + MAP_VOXEL +} diff --git a/src/org/atriaSoft/gameEngine/physics/PhysicSphere.java b/src/org/atriaSoft/gameEngine/physics/PhysicSphere.java new file mode 100644 index 0000000..24973ab --- /dev/null +++ b/src/org/atriaSoft/gameEngine/physics/PhysicSphere.java @@ -0,0 +1,34 @@ +package org.atriaSoft.gameEngine.physics; + +import org.atriaSoft.etk.Color; +import org.atriaSoft.etk.math.Transform3D; +import org.atriaSoft.etk.math.Vector3f; +import org.atriaSoft.gale.resource.ResourceColored3DObject; + +public class PhysicSphere extends PhysicShape { + // Box size property in X, Y and Z + private float size; + public PhysicSphere() { + super(PhysicShapeType.SPHERE); + } + public float getSize() { + return size; + } + public void setSize(float size) { + this.size = size; + } + @Override + public void updateAABB(Transform3D transform, PhysicCollisionAABB aabb) { + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(this.size,0,0))); + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(-this.size,0,0))); + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(0,this.size,0))); + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(0,-this.size,0))); + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(0,0,this.size))); + aabb.update(transform.multiply(this.transform.getPosition()).add_new(new Vector3f(0,0,-this.size))); + } + @Override + public void renderDebug(Transform3D transform, ResourceColored3DObject debugDrawProperty) { + debugDrawProperty.drawSphere(this.size, 9, 9, this.transform.getOpenGLMatrix().multiply_new(transform.getOpenGLMatrix()), new Color(0,1,0,1)); + + } +} \ No newline at end of file diff --git a/src/org/atriaSoft/gameEngine/sample/LoxelEngine/Log.java b/src/org/atriaSoft/gameEngine/sample/LoxelEngine/Log.java index 355d372..73a5e77 100644 --- a/src/org/atriaSoft/gameEngine/sample/LoxelEngine/Log.java +++ b/src/org/atriaSoft/gameEngine/sample/LoxelEngine/Log.java @@ -1,7 +1,7 @@ package org.atriaSoft.gameEngine.sample.LoxelEngine; public class Log { - private static String LIBNAME = "Sample1"; + private static String LIBNAME = "LoxelEngine"; public static void print(String data) { System.out.println(data); } diff --git a/src/org/atriaSoft/gameEngine/sample/LoxelEngine/LoxelApplication.java b/src/org/atriaSoft/gameEngine/sample/LoxelEngine/LoxelApplication.java index 95ab0eb..fc92a28 100644 --- a/src/org/atriaSoft/gameEngine/sample/LoxelEngine/LoxelApplication.java +++ b/src/org/atriaSoft/gameEngine/sample/LoxelEngine/LoxelApplication.java @@ -23,6 +23,7 @@ import org.atriaSoft.gameEngine.camera.Camera; import org.atriaSoft.gameEngine.components.ComponentLight; import org.atriaSoft.gameEngine.components.ComponentLightSun; import org.atriaSoft.gameEngine.components.ComponentMaterial; +import org.atriaSoft.gameEngine.components.ComponentPhysics; import org.atriaSoft.gameEngine.components.ComponentPlayer; import org.atriaSoft.gameEngine.components.ComponentPosition; import org.atriaSoft.gameEngine.components.ComponentPositionPlayer; @@ -33,6 +34,7 @@ import org.atriaSoft.gameEngine.components.ComponentStaticMesh; import org.atriaSoft.gameEngine.components.ComponentTexture; import org.atriaSoft.gameEngine.engines.EngineLight; import org.atriaSoft.gameEngine.map.MapVoxel; +import org.atriaSoft.gameEngine.physics.PhysicBox; import org.atriaSoft.gameEngine.tools.MeshGenerator; import org.atriaSoft.gale.key.KeyKeyboard; import org.atriaSoft.gale.key.KeySpecial; @@ -46,7 +48,6 @@ public class LoxelApplication extends Application { private Quaternion basicRotation2 = Quaternion.identity(); private boolean creationDone; private ControlCameraPlayer simpleControl; - private Material materialCube; private ComponentPosition lightPosition; private float angleLight = 0; private MapVoxel map; @@ -92,17 +93,24 @@ public class LoxelApplication extends Application { env.addEntity(gird); Entity player = new Entity(this.env); - objectPosition = new ComponentPositionPlayer(new Transform3D(new Vector3f(16,16,15))); + objectPosition = new ComponentPositionPlayer(new Transform3D(new Vector3f(5,5,13))); player.addComponent(objectPosition); objectPlayer = new ComponentPlayer(); player.addComponent(objectPlayer); player.addComponent(new ComponentMaterial(new Material())); - player.addComponent(new ComponentStaticMesh(new Uri("RES", "person.obj"))); + //player.addComponent(new ComponentStaticMesh(new Uri("RES", "person.obj"))); + player.addComponent(new ComponentStaticMesh(new Uri("RES", "person_-yfw_zup.obj"))); player.addComponent(new ComponentTexture(new Uri("RES", "playerTexture.png"))); -// player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh( -// new Uri("DATA", "basicMaterial.vert"), -// new Uri("DATA", "basicMaterial.frag"), -// (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); + player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh( + new Uri("DATA", "basicMaterial.vert"), + new Uri("DATA", "basicMaterial.frag"), + (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); + ComponentPhysics physics = new ComponentPhysics(); + PhysicBox box = new PhysicBox(); + box.setSize(new Vector3f(0.6f,0.6f,1.8f)); + box.setOrigin(new Vector3f(0,0,0.9f)); + physics.addShape(box); + player.addComponent(physics); env.addEntity(player); @@ -130,10 +138,6 @@ public class LoxelApplication extends Application { if (this.creationDone == false) { return; } - //materialCube.setAmbientFactor(new Vector3f(1.0f,1.0f,1.0f)); - // apply a little rotation to show the element move - //objectPosition.getTransform().applyRotation(basicRotation); - //objectPosition.getTransform().applyRotation(basicRotation2); angleLight += 0.01; lightPosition.getTransform().getPosition().x = 5 + (float)Math.cos(angleLight) * 7.0f; lightPosition.getTransform().getPosition().y = 5 + (float)Math.sin(angleLight) * 7.0f; @@ -169,7 +173,6 @@ public class LoxelApplication extends Application { OpenGL.enable(Flag.flag_depthTest); env.render(20, "default"); - // Restore context of matrix OpenGL.pop(); } @@ -189,6 +192,12 @@ public class LoxelApplication extends Application { if (type == KeyKeyboard.f1 ) { Gale.getContext().grabPointerEvents(false, new Vector2f(0,0)); } + if (type == KeyKeyboard.f2 ) { + Gale.getContext().grabPointerEvents(true, new Vector2f(0,0)); + } + if (type == KeyKeyboard.f12 ) { + Gale.getContext().setFullScreen(!Gale.getContext().getFullScreen()); + } env.onKeyboard(special, type, value, state); } }