Merge branch 'master' of https://github.com/Faerbit/swp
Conflicts: Levels/ObjectSetups/Level1.xml
This commit is contained in:
commit
e7839b3363
@ -2,198 +2,198 @@
|
||||
# www.blender.org
|
||||
mtllib block.mtl
|
||||
o Block_Cube
|
||||
v 1.977493 -0.678752 -1.000000
|
||||
v 1.977493 -0.678752 -1.000000
|
||||
v -1.970033 -0.678752 -1.000001
|
||||
v 2.003582 -0.652663 -0.973911
|
||||
v 2.003582 1.295159 -0.973911
|
||||
v 2.003581 1.295159 0.973912
|
||||
v 0.003582 -0.678752 1.000000
|
||||
v -1.970034 -0.678752 0.999999
|
||||
v -1.970034 -0.678752 0.999999
|
||||
v 1.977494 1.321248 -0.999999
|
||||
v -1.970034 1.321248 -1.000000
|
||||
v -1.970034 1.321248 0.999999
|
||||
v -1.996123 1.295159 0.973910
|
||||
v -1.996123 1.295159 -0.973912
|
||||
v -1.996122 -0.652663 -0.973912
|
||||
v 1.977492 1.321248 1.000001
|
||||
v 1.977492 1.321248 1.000001
|
||||
v 0.003582 1.321248 -1.000000
|
||||
v 1.977494 1.321248 -0.999999
|
||||
v 1.977493 -0.678752 1.000000
|
||||
v 0.003582 -0.678752 -1.000000
|
||||
v -1.970033 -0.678752 -1.000001
|
||||
v -1.970034 1.321248 -1.000000
|
||||
v 1.977493 -0.678752 1.000000
|
||||
v -1.970034 1.321248 0.999999
|
||||
v 1.981206 -0.678487 -0.998011
|
||||
v 1.984843 -0.674549 -0.998943
|
||||
v 1.984843 -0.677695 -0.995797
|
||||
v 1.988331 -0.672154 -0.997642
|
||||
v 1.988331 -0.676394 -0.993402
|
||||
v 1.991598 -0.669629 -0.995858
|
||||
v 1.991598 -0.674611 -0.990877
|
||||
v 1.994578 -0.667024 -0.993628
|
||||
v 1.994578 -0.672380 -0.988272
|
||||
v 1.997210 -0.664392 -0.990996
|
||||
v 1.997210 -0.669748 -0.985640
|
||||
v 1.999440 -0.661786 -0.988016
|
||||
v 1.999440 -0.666768 -0.983034
|
||||
v 2.001224 -0.659261 -0.984749
|
||||
v 2.001224 -0.663501 -0.980509
|
||||
v 2.002525 -0.656867 -0.981261
|
||||
v 2.002525 -0.660013 -0.978115
|
||||
v 2.003316 -0.654652 -0.977624
|
||||
v 2.003316 -0.656376 -0.975900
|
||||
v 2.003316 -0.654652 0.977624
|
||||
v 2.003316 -0.656376 0.975900
|
||||
v 2.003582 -0.652663 0.973911
|
||||
v 2.002525 -0.656867 0.981261
|
||||
v 2.002525 -0.660013 0.978115
|
||||
v 2.001224 -0.659261 0.984749
|
||||
v 2.001224 -0.663501 0.980509
|
||||
v 1.999440 -0.661786 0.988016
|
||||
v 1.999440 -0.666768 0.983034
|
||||
v 1.997210 -0.669748 0.985640
|
||||
v 1.994578 -0.672380 0.988272
|
||||
v 1.997210 -0.664392 0.990996
|
||||
v 1.991598 -0.669629 0.995859
|
||||
v 1.991598 -0.674611 0.990877
|
||||
v 1.988331 -0.672154 0.997642
|
||||
v 1.988331 -0.676394 0.993402
|
||||
v 1.984843 -0.674549 0.998943
|
||||
v 1.984843 -0.677695 0.995797
|
||||
v 1.981206 -0.676763 0.999735
|
||||
v 1.981206 -0.678487 0.998011
|
||||
v 1.981206 1.319259 -0.999734
|
||||
v 1.984844 1.320191 -0.995796
|
||||
v 1.984843 1.317045 -0.998943
|
||||
v 1.988331 1.318890 -0.993402
|
||||
v 1.988331 1.314650 -0.997642
|
||||
v 1.991598 1.312125 -0.995858
|
||||
v 1.994578 1.314876 -0.988271
|
||||
v 1.994578 1.309520 -0.993627
|
||||
v 1.997210 1.306888 -0.990995
|
||||
v 1.999441 1.304282 -0.988015
|
||||
v 1.997210 1.312244 -0.985639
|
||||
v 2.001225 1.301757 -0.984748
|
||||
v 1.999441 1.309264 -0.983034
|
||||
v 2.002526 1.299363 -0.981261
|
||||
v 2.001225 1.305997 -0.980508
|
||||
v 2.003317 1.297148 -0.977623
|
||||
v 2.002526 1.302509 -0.978114
|
||||
v 2.003317 1.298872 -0.975900
|
||||
v 2.003315 1.298872 0.975901
|
||||
v 2.003315 1.297148 0.977625
|
||||
v 2.002524 1.302509 0.978115
|
||||
v 2.002524 1.299363 0.981262
|
||||
v 2.001224 1.305997 0.980510
|
||||
v 2.001224 1.301757 0.984750
|
||||
v 1.999439 1.304282 0.988017
|
||||
v 1.997209 1.312244 0.985640
|
||||
v 1.997209 1.306888 0.990996
|
||||
v 1.994577 1.314876 0.988272
|
||||
v 1.994577 1.309520 0.993628
|
||||
v 1.991597 1.312125 0.995859
|
||||
v 1.988330 1.318890 0.993403
|
||||
v 1.988330 1.314650 0.997643
|
||||
v 1.984842 1.317045 0.998944
|
||||
v 1.984842 1.320191 0.995797
|
||||
v 1.981205 1.320983 0.998011
|
||||
v 1.981205 1.319259 0.999735
|
||||
v -1.973747 -0.678487 0.998010
|
||||
v -1.977384 -0.674549 0.998943
|
||||
v -1.977384 -0.677696 0.995796
|
||||
v -1.980871 -0.676395 0.993402
|
||||
v -1.984138 -0.669629 0.995858
|
||||
v -1.984138 -0.674611 0.990876
|
||||
v -1.987118 -0.667024 0.993627
|
||||
v -1.987118 -0.672380 0.988271
|
||||
v -1.989750 -0.664392 0.990995
|
||||
v -1.989750 -0.669748 0.985639
|
||||
v -1.991981 -0.666768 0.983034
|
||||
v -1.993765 -0.659261 0.984748
|
||||
v -1.993765 -0.663501 0.980508
|
||||
v -1.995066 -0.656867 0.981261
|
||||
v -1.995066 -0.660014 0.978114
|
||||
v -1.995857 -0.654653 0.977624
|
||||
v -1.996123 -0.652663 0.973911
|
||||
v -1.995857 -0.656376 0.975900
|
||||
v -1.995857 -0.654653 -0.977625
|
||||
v -1.995857 -0.656376 -0.975901
|
||||
v -1.995065 -0.660014 -0.978115
|
||||
v -1.993765 -0.659261 -0.984750
|
||||
v -1.993765 -0.663501 -0.980510
|
||||
v -1.991981 -0.661787 -0.988017
|
||||
v -1.991981 -0.666768 -0.983035
|
||||
v -1.989750 -0.669748 -0.985640
|
||||
v -1.987118 -0.672380 -0.988273
|
||||
v -1.989750 -0.664392 -0.990997
|
||||
v -1.984138 -0.674611 -0.990878
|
||||
v -1.987118 -0.667024 -0.993629
|
||||
v -1.980871 -0.672155 -0.997643
|
||||
v -1.980871 -0.676395 -0.993403
|
||||
v -1.977383 -0.677696 -0.995798
|
||||
v -1.977383 -0.674549 -0.998944
|
||||
v -1.973746 -0.676763 -0.999735
|
||||
v -1.973746 -0.678487 -0.998012
|
||||
v -1.973747 1.319259 0.999734
|
||||
v -1.977384 1.317044 0.998942
|
||||
v -1.973747 1.320982 0.998010
|
||||
v -1.980872 1.314650 0.997642
|
||||
v -1.977384 1.320191 0.995796
|
||||
v -1.984139 1.312125 0.995858
|
||||
v -1.980872 1.318890 0.993402
|
||||
v -1.987119 1.309519 0.993627
|
||||
v -1.984139 1.317106 0.990876
|
||||
v -1.989751 1.306887 0.990995
|
||||
v -1.987119 1.314876 0.988271
|
||||
v -1.991982 1.309264 0.983034
|
||||
v -1.991982 1.304282 0.988015
|
||||
v -1.993766 1.301757 0.984748
|
||||
v -1.995066 1.299362 0.981260
|
||||
v -1.993766 1.305997 0.980508
|
||||
v -1.995857 1.297148 0.977623
|
||||
v -1.995066 1.302509 0.978114
|
||||
v -1.995857 1.298872 0.975900
|
||||
v -1.995857 1.298872 -0.975901
|
||||
v -1.995857 1.297148 -0.977625
|
||||
v -1.995066 1.302509 -0.978115
|
||||
v -1.995066 1.299362 -0.981262
|
||||
v -1.993765 1.305997 -0.980509
|
||||
v -1.993765 1.301757 -0.984749
|
||||
v -1.991981 1.304282 -0.988016
|
||||
v -1.989750 1.312244 -0.985640
|
||||
v -1.989750 1.306887 -0.990996
|
||||
v -1.987118 1.314876 -0.988272
|
||||
v -1.987118 1.309519 -0.993628
|
||||
v -1.984138 1.312125 -0.995859
|
||||
v -1.980871 1.318890 -0.993403
|
||||
v -1.980871 1.314650 -0.997643
|
||||
v -1.977384 1.317044 -0.998944
|
||||
v -1.977384 1.320191 -0.995797
|
||||
v -1.973747 1.320982 -0.998011
|
||||
v -1.973747 1.319259 -0.999735
|
||||
v 1.994578 -0.667024 0.993628
|
||||
v 1.991597 1.317107 0.990878
|
||||
v 1.991598 1.317107 -0.990876
|
||||
v 1.999439 1.309264 0.983035
|
||||
v -1.973747 -0.676763 0.999734
|
||||
v -1.980871 -0.672155 0.997642
|
||||
v -1.991981 -0.661787 0.988015
|
||||
v -1.995065 -0.656867 -0.981262
|
||||
v -1.984138 -0.669629 -0.995859
|
||||
v -1.984138 1.317106 -0.990877
|
||||
v -1.989751 1.312244 0.985639
|
||||
v -1.991981 1.309264 -0.983035
|
||||
v 0.003582 -0.678752 -1.000000
|
||||
v 0.003582 -0.678752 1.000000
|
||||
v 0.003581 1.321248 1.000000
|
||||
v 0.003581 1.321248 1.000000
|
||||
v 0.003582 1.321248 -1.000000
|
||||
v 1.981206 -0.676763 -0.999734
|
||||
v 1.981206 1.320983 -0.998010
|
||||
v 1.977493 -1.057121 -1.000000
|
||||
v 1.977493 -1.057121 -1.000000
|
||||
v -1.970033 -1.057121 -1.000001
|
||||
v 2.003582 -1.031032 -0.973911
|
||||
v 2.003582 0.916790 -0.973911
|
||||
v 2.003581 0.916790 0.973912
|
||||
v 0.003582 -1.057121 1.000000
|
||||
v -1.970034 -1.057121 0.999999
|
||||
v -1.970034 -1.057121 0.999999
|
||||
v 1.977494 0.942879 -0.999999
|
||||
v -1.970034 0.942879 -1.000000
|
||||
v -1.970034 0.942879 0.999999
|
||||
v -1.996123 0.916790 0.973910
|
||||
v -1.996123 0.916790 -0.973912
|
||||
v -1.996122 -1.031032 -0.973912
|
||||
v 1.977492 0.942879 1.000001
|
||||
v 1.977492 0.942879 1.000001
|
||||
v 0.003582 0.942879 -1.000000
|
||||
v 1.977494 0.942879 -0.999999
|
||||
v 1.977493 -1.057121 1.000000
|
||||
v 0.003582 -1.057121 -1.000000
|
||||
v -1.970033 -1.057121 -1.000001
|
||||
v -1.970034 0.942879 -1.000000
|
||||
v 1.977493 -1.057121 1.000000
|
||||
v -1.970034 0.942879 0.999999
|
||||
v 1.981206 -1.056856 -0.998011
|
||||
v 1.984843 -1.052918 -0.998943
|
||||
v 1.984843 -1.056064 -0.995797
|
||||
v 1.988331 -1.050523 -0.997642
|
||||
v 1.988331 -1.054763 -0.993402
|
||||
v 1.991598 -1.047998 -0.995858
|
||||
v 1.991598 -1.052980 -0.990877
|
||||
v 1.994578 -1.045393 -0.993628
|
||||
v 1.994578 -1.050749 -0.988272
|
||||
v 1.997210 -1.042761 -0.990996
|
||||
v 1.997210 -1.048117 -0.985640
|
||||
v 1.999440 -1.040155 -0.988016
|
||||
v 1.999440 -1.045137 -0.983034
|
||||
v 2.001224 -1.037630 -0.984749
|
||||
v 2.001224 -1.041870 -0.980509
|
||||
v 2.002525 -1.035236 -0.981261
|
||||
v 2.002525 -1.038382 -0.978115
|
||||
v 2.003316 -1.033021 -0.977624
|
||||
v 2.003316 -1.034745 -0.975900
|
||||
v 2.003316 -1.033021 0.977624
|
||||
v 2.003316 -1.034745 0.975900
|
||||
v 2.003582 -1.031032 0.973911
|
||||
v 2.002525 -1.035236 0.981261
|
||||
v 2.002525 -1.038382 0.978115
|
||||
v 2.001224 -1.037630 0.984749
|
||||
v 2.001224 -1.041870 0.980509
|
||||
v 1.999440 -1.040155 0.988016
|
||||
v 1.999440 -1.045137 0.983034
|
||||
v 1.997210 -1.048117 0.985640
|
||||
v 1.994578 -1.050749 0.988272
|
||||
v 1.997210 -1.042761 0.990996
|
||||
v 1.991598 -1.047998 0.995859
|
||||
v 1.991598 -1.052980 0.990877
|
||||
v 1.988331 -1.050523 0.997642
|
||||
v 1.988331 -1.054763 0.993402
|
||||
v 1.984843 -1.052918 0.998943
|
||||
v 1.984843 -1.056064 0.995797
|
||||
v 1.981206 -1.055132 0.999735
|
||||
v 1.981206 -1.056856 0.998011
|
||||
v 1.981206 0.940890 -0.999734
|
||||
v 1.984844 0.941822 -0.995796
|
||||
v 1.984843 0.938676 -0.998943
|
||||
v 1.988331 0.940521 -0.993402
|
||||
v 1.988331 0.936281 -0.997642
|
||||
v 1.991598 0.933756 -0.995858
|
||||
v 1.994578 0.936507 -0.988271
|
||||
v 1.994578 0.931151 -0.993627
|
||||
v 1.997210 0.928519 -0.990995
|
||||
v 1.999441 0.925913 -0.988015
|
||||
v 1.997210 0.933875 -0.985639
|
||||
v 2.001225 0.923388 -0.984748
|
||||
v 1.999441 0.930895 -0.983034
|
||||
v 2.002526 0.920994 -0.981261
|
||||
v 2.001225 0.927628 -0.980508
|
||||
v 2.003317 0.918779 -0.977623
|
||||
v 2.002526 0.924140 -0.978114
|
||||
v 2.003317 0.920503 -0.975900
|
||||
v 2.003315 0.920503 0.975901
|
||||
v 2.003315 0.918779 0.977625
|
||||
v 2.002524 0.924140 0.978115
|
||||
v 2.002524 0.920994 0.981262
|
||||
v 2.001224 0.927628 0.980510
|
||||
v 2.001224 0.923388 0.984750
|
||||
v 1.999439 0.925913 0.988017
|
||||
v 1.997209 0.933875 0.985640
|
||||
v 1.997209 0.928519 0.990996
|
||||
v 1.994577 0.936507 0.988272
|
||||
v 1.994577 0.931151 0.993628
|
||||
v 1.991597 0.933756 0.995859
|
||||
v 1.988330 0.940521 0.993403
|
||||
v 1.988330 0.936281 0.997643
|
||||
v 1.984842 0.938676 0.998944
|
||||
v 1.984842 0.941822 0.995797
|
||||
v 1.981205 0.942614 0.998011
|
||||
v 1.981205 0.940890 0.999735
|
||||
v -1.973747 -1.056856 0.998010
|
||||
v -1.977384 -1.052918 0.998943
|
||||
v -1.977384 -1.056065 0.995796
|
||||
v -1.980871 -1.054764 0.993402
|
||||
v -1.984138 -1.047998 0.995858
|
||||
v -1.984138 -1.052980 0.990876
|
||||
v -1.987118 -1.045393 0.993627
|
||||
v -1.987118 -1.050749 0.988271
|
||||
v -1.989750 -1.042761 0.990995
|
||||
v -1.989750 -1.048117 0.985639
|
||||
v -1.991981 -1.045137 0.983034
|
||||
v -1.993765 -1.037630 0.984748
|
||||
v -1.993765 -1.041870 0.980508
|
||||
v -1.995066 -1.035236 0.981261
|
||||
v -1.995066 -1.038383 0.978114
|
||||
v -1.995857 -1.033022 0.977624
|
||||
v -1.996123 -1.031032 0.973911
|
||||
v -1.995857 -1.034745 0.975900
|
||||
v -1.995857 -1.033022 -0.977625
|
||||
v -1.995857 -1.034745 -0.975901
|
||||
v -1.995065 -1.038383 -0.978115
|
||||
v -1.993765 -1.037630 -0.984750
|
||||
v -1.993765 -1.041870 -0.980510
|
||||
v -1.991981 -1.040156 -0.988017
|
||||
v -1.991981 -1.045137 -0.983035
|
||||
v -1.989750 -1.048117 -0.985640
|
||||
v -1.987118 -1.050749 -0.988273
|
||||
v -1.989750 -1.042761 -0.990997
|
||||
v -1.984138 -1.052980 -0.990878
|
||||
v -1.987118 -1.045393 -0.993629
|
||||
v -1.980871 -1.050524 -0.997643
|
||||
v -1.980871 -1.054764 -0.993403
|
||||
v -1.977383 -1.056065 -0.995798
|
||||
v -1.977383 -1.052918 -0.998944
|
||||
v -1.973746 -1.055132 -0.999735
|
||||
v -1.973746 -1.056856 -0.998012
|
||||
v -1.973747 0.940890 0.999734
|
||||
v -1.977384 0.938675 0.998942
|
||||
v -1.973747 0.942613 0.998010
|
||||
v -1.980872 0.936281 0.997642
|
||||
v -1.977384 0.941822 0.995796
|
||||
v -1.984139 0.933756 0.995858
|
||||
v -1.980872 0.940521 0.993402
|
||||
v -1.987119 0.931150 0.993627
|
||||
v -1.984139 0.938737 0.990876
|
||||
v -1.989751 0.928518 0.990995
|
||||
v -1.987119 0.936507 0.988271
|
||||
v -1.991982 0.930895 0.983034
|
||||
v -1.991982 0.925913 0.988015
|
||||
v -1.993766 0.923388 0.984748
|
||||
v -1.995066 0.920993 0.981260
|
||||
v -1.993766 0.927628 0.980508
|
||||
v -1.995857 0.918779 0.977623
|
||||
v -1.995066 0.924140 0.978114
|
||||
v -1.995857 0.920503 0.975900
|
||||
v -1.995857 0.920503 -0.975901
|
||||
v -1.995857 0.918779 -0.977625
|
||||
v -1.995066 0.924140 -0.978115
|
||||
v -1.995066 0.920993 -0.981262
|
||||
v -1.993765 0.927628 -0.980509
|
||||
v -1.993765 0.923388 -0.984749
|
||||
v -1.991981 0.925913 -0.988016
|
||||
v -1.989750 0.933875 -0.985640
|
||||
v -1.989750 0.928518 -0.990996
|
||||
v -1.987118 0.936507 -0.988272
|
||||
v -1.987118 0.931150 -0.993628
|
||||
v -1.984138 0.933756 -0.995859
|
||||
v -1.980871 0.940521 -0.993403
|
||||
v -1.980871 0.936281 -0.997643
|
||||
v -1.977384 0.938675 -0.998944
|
||||
v -1.977384 0.941822 -0.995797
|
||||
v -1.973747 0.942613 -0.998011
|
||||
v -1.973747 0.940890 -0.999735
|
||||
v 1.994578 -1.045393 0.993628
|
||||
v 1.991597 0.938738 0.990878
|
||||
v 1.991598 0.938738 -0.990876
|
||||
v 1.999439 0.930895 0.983035
|
||||
v -1.973747 -1.055132 0.999734
|
||||
v -1.980871 -1.050524 0.997642
|
||||
v -1.991981 -1.040156 0.988015
|
||||
v -1.995065 -1.035236 -0.981262
|
||||
v -1.984138 -1.047998 -0.995859
|
||||
v -1.984138 0.938737 -0.990877
|
||||
v -1.989751 0.933875 0.985639
|
||||
v -1.991981 0.930895 -0.983035
|
||||
v 0.003582 -1.057121 -1.000000
|
||||
v 0.003582 -1.057121 1.000000
|
||||
v 0.003581 0.942879 1.000000
|
||||
v 0.003581 0.942879 1.000000
|
||||
v 0.003582 0.942879 -1.000000
|
||||
v 1.981206 -1.055132 -0.999734
|
||||
v 1.981206 0.942614 -0.998010
|
||||
vt 0.839733 0.000000
|
||||
vt -0.537296 -0.000000
|
||||
vt 0.839733 0.013044
|
||||
|
@ -222,9 +222,9 @@
|
||||
<specularFactor>0.4</specularFactor>
|
||||
<shininess>2.0</shininess>
|
||||
<physicType>Box</physicType>
|
||||
<width>5.0</width>
|
||||
<width>6</width>
|
||||
<height>3</height>
|
||||
<length>1.8</length>
|
||||
<length>3</length>
|
||||
<dampningL>0.8</dampningL>
|
||||
<dampningA>0.9</dampningA>
|
||||
</objectData>
|
||||
|
@ -13779,7 +13779,40 @@
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<manualPos>false</manualPos>
|
||||
<<<<<<< HEAD
|
||||
<xPos>81.500000</xPos>
|
||||
=======
|
||||
<xPos>212.500000</xPos>
|
||||
<yOffset>3.0</yOffset>
|
||||
<zPos>-222.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>67</idBlue>
|
||||
<typeID>40</typeID>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
|
||||
<composition>
|
||||
<scale>1.0</scale>
|
||||
<xRot>0.0</xRot>
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<manualPos>false</manualPos>
|
||||
<xPos>210.500000</xPos>
|
||||
>>>>>>> 12ee9a4ac5b8c3350e8afc3b6b251992020790e2
|
||||
<yOffset>0.0</yOffset>
|
||||
<zPos>-244.500000</zPos>
|
||||
<idGreen>1</idGreen>
|
||||
|
54
physics.cc
54
physics.cc
@ -30,6 +30,16 @@ void Physics::takeUpdateStep(float timeDiff)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*- cameraBody->getCenterOfMassPosition(); // gives vector from player to camera
|
||||
position.normalize();
|
||||
position *=5;
|
||||
position += playerBall->getCenterOfMassPosition(); //is the position 5 units away from the player in the direction of the camera
|
||||
|
||||
|
||||
btVector3 dir = cameraBody->getCenterOfMassPosition() - position;
|
||||
cameraBody->applyCentralForce(dir);
|
||||
*/
|
||||
}
|
||||
|
||||
void Physics::removePositionConstraint(int bodyIndice)
|
||||
@ -87,7 +97,7 @@ void Physics::addTerrainTriangles(int width, int length, float** heightData)
|
||||
|
||||
terrainBody = tBody;
|
||||
|
||||
world->addRigidBody(tBody);
|
||||
world->addRigidBody(tBody,COL_TERRAIN,COL_OBJECTS);
|
||||
|
||||
}
|
||||
|
||||
@ -112,7 +122,7 @@ void Physics::addTerrain(int width, int length, float** heightData)
|
||||
|
||||
btRigidBody* tBody = new btRigidBody(0,new btDefaultMotionState(),terrianShape);
|
||||
|
||||
tBody->getWorldTransform().setOrigin(btVector3(0,((float)highest - 1)/2,0));
|
||||
tBody->getWorldTransform().setOrigin(btVector3(0,((float)highest)/2,0));
|
||||
|
||||
//tBody->getWoorldTransform().setRotation(btQuaternion(0,0,0,1));
|
||||
|
||||
@ -127,7 +137,7 @@ void Physics::addPlayer(float friction, float rad, Entity entity, float mass, fl
|
||||
if(bodies.size() == indice)
|
||||
throw std::invalid_argument( "Bodies out of Sync" );
|
||||
|
||||
btSphereShape* sphere = new btSphereShape(rad);
|
||||
btSphereShape* sphere = new btSphereShape(rad/1.5f);
|
||||
btVector3 inertia(0,0,0);
|
||||
if(mass != 0.0)
|
||||
{
|
||||
@ -145,7 +155,7 @@ void Physics::addPlayer(float friction, float rad, Entity entity, float mass, fl
|
||||
|
||||
playerBall->setDamping(dampningL, dampningA);
|
||||
|
||||
world->addRigidBody(playerBall);
|
||||
world->addRigidBody(playerBall,COL_OBJECTS,COL_OBJECTS|COL_OBJECTS_NO_TERRAIN|COL_TERRAIN);
|
||||
|
||||
bodies.push_back(playerBall);
|
||||
|
||||
@ -202,7 +212,7 @@ void Physics::addTriangleMeshBody(Entity entity, std::string path, float mass, f
|
||||
}
|
||||
|
||||
btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(triMesh,true);
|
||||
|
||||
shape->setLocalScaling(btVector3(0.5f,0.5f,0.5f));
|
||||
btDefaultMotionState* motion = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(entity.getPosition().x,entity.getPosition().y,entity.getPosition().z)));
|
||||
|
||||
btVector3 inertia(0,0,0);
|
||||
@ -226,6 +236,34 @@ void Physics::addTriangleMeshBody(Entity entity, std::string path, float mass, f
|
||||
throw std::invalid_argument( "Bodies out of Sync" );
|
||||
}
|
||||
|
||||
void Physics::addButton(float radius, float height, Entity entity, float mass, float dampningL, float dampningA, unsigned indice)
|
||||
{
|
||||
|
||||
if(bodies.size() == indice)
|
||||
throw std::invalid_argument( "Bodies out of Sync" );
|
||||
btCylinderShape* shape = new btCylinderShape(btVector3(height/2, radius,radius));
|
||||
btDefaultMotionState* motion = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(entity.getPosition().x,entity.getPosition().y,entity.getPosition().z)));
|
||||
|
||||
btVector3 inertia(0,0,0);
|
||||
if(mass != 0.0)
|
||||
{
|
||||
shape->calculateLocalInertia((btScalar)mass,inertia);
|
||||
}
|
||||
|
||||
btRigidBody::btRigidBodyConstructionInfo info(mass,motion,shape,inertia);
|
||||
|
||||
btRigidBody* body = new btRigidBody(info);
|
||||
|
||||
body->setDamping(dampningL, dampningA);
|
||||
|
||||
world->addRigidBody(body,COL_OBJECTS_NO_TERRAIN, specialPhysicsCollision);
|
||||
|
||||
bodies.push_back(body);
|
||||
|
||||
if(bodies.size() != indice)
|
||||
throw std::invalid_argument( "Bodies out of Sync" );
|
||||
}
|
||||
|
||||
void Physics::addBox(float width, float height, float length, Entity entity, float mass, float dampningL, float dampningA, unsigned indice)
|
||||
{
|
||||
|
||||
@ -248,8 +286,8 @@ void Physics::addBox(float width, float height, float length, Entity entity, flo
|
||||
|
||||
body->setDamping(dampningL, dampningA);
|
||||
|
||||
world->addRigidBody(body);
|
||||
|
||||
world->addRigidBody(body,COL_OBJECTS, objectsPhysicsCollision);
|
||||
|
||||
bodies.push_back(body);
|
||||
|
||||
if(bodies.size() != indice)
|
||||
@ -277,7 +315,7 @@ void Physics::addSphere(float rad, Entity entity, float mass, float dampningL, f
|
||||
|
||||
body->setDamping(dampningL, dampningA);
|
||||
|
||||
world->addRigidBody(body);
|
||||
world->addRigidBody(body,COL_OBJECTS, objectsPhysicsCollision);
|
||||
|
||||
bodies.push_back(body);
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "extern/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h"
|
||||
#include "extern/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h"
|
||||
#include "extern/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
|
||||
#include "extern/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h"
|
||||
|
||||
#include "extern/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h"
|
||||
#include "extern/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"//YAY!
|
||||
@ -64,6 +65,7 @@ class Physics {
|
||||
void addBox(float width, float height, float length, Entity entity, float mass, float dampningL, float dampningA, unsigned indice); //this is used to ensuer that the system is synchronized
|
||||
void addPositionConstraint(int bodyIndice, float strength, glm::vec3 position);
|
||||
void removePositionConstraint(int bodyIndice);
|
||||
void addButton(float radius, float height, Entity entity, float mass, float dampningL, float dampningA, unsigned indice);
|
||||
|
||||
struct positionConstraint{btRigidBody* body; float strength; btVector3 position;};
|
||||
|
||||
@ -80,6 +82,10 @@ class Physics {
|
||||
btCollisionConfiguration* colConfig; //defines the type of collision detection.
|
||||
btBroadphaseInterface* broadphase; //defines how objects are culled from collision detection.
|
||||
btConstraintSolver* solver; //solver for forces and impulses.
|
||||
int objectsPhysicsCollision = 1 | 2 | 4;
|
||||
int specialPhysicsCollision = 2 | 4;
|
||||
int terrainPhysicsCollision = 2;
|
||||
|
||||
};
|
||||
|
||||
enum collisionTypes{
|
||||
@ -89,6 +95,7 @@ enum collisionTypes{
|
||||
COL_OBJECTS_NO_TERRAIN = 4
|
||||
};
|
||||
|
||||
//world->addRigidBody(playerBall,COL_OBJECTS_NO_TERRAIN, COL_OBJECTS);
|
||||
class btDistanceConstraint : public btPoint2PointConstraint
|
||||
{
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user