Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shields, newer-better-meshier... #2491

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/models/ships/malabar/malabar.model
@@ -1,3 +1,5 @@
# Malabar

material malabar-material
diffuse 1.0 1.0 1.0
specular 0.9 0.9 0.9
Expand All @@ -9,6 +11,7 @@ tex_spec malabar_spec.png

lod 300
mesh malabar_hi.dae
mesh malabar_shield.dae

lod 100
mesh malabar_med.dae
Expand Down
76 changes: 76 additions & 0 deletions data/models/ships/malabar/malabar_shield.dae

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions data/models/ships/malabar/vatakara.model
@@ -1,3 +1,5 @@
# Malabar

material malabar-material
diffuse 1.0 1.0 1.0
specular 0.9 0.9 0.9
Expand All @@ -9,6 +11,7 @@ tex_spec vatakara_spec.png

lod 300
mesh vatakara_hi.dae
mesh malabar_shield.dae

lod 100
mesh malabar_med.dae
Expand Down
2 changes: 1 addition & 1 deletion data/models/ships/nerodia/nerodia.model
Expand Up @@ -11,6 +11,6 @@ anim gear_down 1 80

collision nerodia_col.obj


lod 75
mesh nerodia_LOD.dae
mesh nerodia_shield.dae
120 changes: 120 additions & 0 deletions data/models/ships/nerodia/nerodia_shield.dae

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/models/ships/sinonatrix/sinonatrix.model
Expand Up @@ -9,8 +9,8 @@ mesh sinonatrix.dae

anim gear_down 1 100


collision sinonatrix_col.obj

lod 75
mesh sinonatrix_LOD.dae
mesh sinonatrix_LOD.dae
mesh sinonatrix_shield.dae
76 changes: 76 additions & 0 deletions data/models/ships/sinonatrix/sinonatrix_shield.dae
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author>Bálint Szilárd [bszlrd@gmail.com]</author>
<authoring_tool>Blender 2.69.0 r60995</authoring_tool>
</contributor>
<created>2014-01-14T22:48:14</created>
<modified>2014-01-14T22:48:14</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images/>
<library_effects/>
<library_geometries>
<geometry id="sinonatrix_shield-mesh" name="sinonatrix_shield">
<mesh>
<source id="sinonatrix_shield-mesh-positions">
<float_array id="sinonatrix_shield-mesh-positions-array" count="198">-5.903012 2.89619 0 2.594177 7.847055 0 7.412515 -4.543553 0 -3.945196 -9.355186 0 2.951506 3.554311 -2.152022 -2.951506 3.554311 2.152022 -2.594177 7.847055 0 3.945196 -9.355186 0 -2.951506 3.554311 -2.152022 2.951506 3.554311 2.152022 -7.412515 -4.543553 0 5.903012 2.89619 0 3.664955 -5.053856 -3.15128 -3.664955 -5.053856 3.15128 -3.664955 -5.053856 -3.15128 3.664955 -5.053856 3.15128 -6.745004 -7.607978 0 -5.165136 3.06072 1.394885 -4.718475 5.988097 0 -6.456486 -4.671286 -2.035955 2.68351 6.773869 1.381252 4.718475 5.988097 0 -2.68351 6.773869 -1.381252 6.456486 -4.671286 2.035955 6.745003 -7.607978 0 5.165135 3.06072 -1.394885 -3.865651 -8.278092 2.438137 3.865651 -8.278092 -2.438137 -2.68351 6.773869 1.381252 2.68351 6.773869 -1.381252 3.865651 -8.278092 2.438137 -3.865651 -8.278092 -2.438137 0 8.468298 0 0 -9.898653 0 0 -5.308608 -3.482825 0 -5.308608 3.482825 -6.456486 -4.671286 2.035955 -5.165136 3.06072 -1.394885 5.165135 3.06072 1.394885 6.456486 -4.671286 -2.035955 0 3.883371 -2.371153 0 3.883371 2.371153 -6.709458 -0.7966348 0 6.709458 -0.7966346 0 3.32382 -0.7296997 -2.705922 -3.32382 -0.7296997 2.705922 -3.32382 -0.7296997 -2.705922 3.32382 -0.7296997 2.705922 -5.889499 -7.029948 -1.604398 -4.31331 5.443687 -0.9947252 4.31331 5.443687 -0.9947252 5.889499 -7.029948 -1.604398 -5.889499 -7.029948 1.604398 -4.31331 5.443687 0.9947252 4.31331 5.443687 0.9947252 5.889499 -7.029948 1.604398 0 7.322066 1.516301 0 7.322066 -1.516301 0 -8.749016 2.708029 0 -8.749016 -2.708029 -5.848417 -0.7813609 1.754742 -5.848417 -0.7813609 -1.754742 5.848417 -0.7813609 1.754742 5.848417 -0.7813609 -1.754742 0 -0.6932066 -2.984178 0 -0.6932066 2.984178</float_array>
<technique_common>
<accessor source="#sinonatrix_shield-mesh-positions-array" count="66" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="sinonatrix_shield-mesh-normals">
<float_array id="sinonatrix_shield-mesh-normals-array" count="192">-0.8790763 0.1945847 0.4351571 -0.8261379 0.3401148 0.4492416 -0.826138 0.3401148 -0.4492416 -0.8790763 0.1945847 -0.4351571 0.1885598 0.782433 0.5935013 0.5876942 0.6303246 0.5072538 0.5876941 0.6303247 -0.5072539 0.1885598 0.782433 -0.5935013 0.8869637 0.1681173 0.4301532 0.8591322 -0.2318748 0.4562082 0.8591322 -0.2318748 -0.4562082 0.8869637 0.1681173 -0.4301532 -0.1317166 -0.9090287 0.3953701 -0.5296026 -0.7350028 0.4234287 -0.5296026 -0.7350028 -0.4234287 -0.1317166 -0.9090287 -0.3953701 0.08603817 0.1336395 -0.9872881 0.09803462 0.2397641 -0.9658687 0.3874004 0.2621581 -0.8838518 0.3505365 0.1494975 -0.9245402 -0.08603817 0.1336395 0.9872881 -0.09803462 0.2397641 0.9658687 -0.3874003 0.2621582 0.8838518 -0.3505364 0.1494974 0.9245403 -0.5876942 0.6303247 0.5072538 -0.1885598 0.7824329 0.5935013 -0.1885598 0.782433 -0.5935013 -0.5876941 0.6303247 -0.5072539 0.5296027 -0.7350029 0.4234287 0.1317166 -0.9090287 0.3953701 0.1317166 -0.9090287 -0.3953701 0.5296027 -0.7350029 -0.4234287 -0.3505364 0.1494974 -0.9245403 -0.3874003 0.2621582 -0.8838518 -0.09803462 0.2397641 -0.9658687 -0.08603817 0.1336395 -0.9872881 0.3505365 0.1494975 0.9245402 0.3874004 0.2621581 0.8838518 0.09803462 0.2397641 0.9658687 0.08603817 0.1336395 0.9872881 -0.8591321 -0.2318747 0.4562083 -0.8869637 0.1681173 0.4301532 -0.8869637 0.1681173 -0.4301532 -0.8591321 -0.2318747 -0.4562083 0.8261379 0.3401147 0.4492418 0.8790762 0.1945848 0.4351572 0.8790762 0.1945848 -0.4351572 0.8261379 0.3401147 -0.4492418 0.09824347 -0.2140213 -0.9718761 0.08307653 0.1077865 -0.9906969 0.3529177 0.1228289 -0.9275571 0.4267768 -0.2084348 -0.8800094 -0.09824347 -0.2140213 0.9718761 -0.08307653 0.1077865 0.9906969 -0.3529177 0.1228289 0.9275571 -0.4267768 -0.2084348 0.8800094 -0.4267768 -0.2084348 -0.8800094 -0.3529177 0.1228289 -0.9275571 -0.08307653 0.1077865 -0.9906969 -0.09824347 -0.2140213 -0.9718761 0.4267768 -0.2084348 0.8800094 0.3529177 0.1228289 0.9275571 0.08307653 0.1077865 0.9906969 0.09824347 -0.2140213 0.9718761</float_array>
<technique_common>
<accessor source="#sinonatrix_shield-mesh-normals-array" count="64" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="sinonatrix_shield-mesh-map-0">
<float_array id="sinonatrix_shield-mesh-map-0-array" count="512">0.5961981 0.5228205 0.67186 0.6372596 0.6105691 0.6703454 0.5419303 0.5429556 0.5961981 0.5228205 0.5419303 0.5429556 0.5006863 0.4567755 0.5291002 0.4213349 0.5961981 0.5228205 0.5291002 0.4213349 0.5728384 0.4090718 0.6359795 0.4807745 0.5961981 0.5228205 0.6359795 0.4807745 0.7263082 0.5938239 0.67186 0.6372596 0.9254918 0.28209 0.9230469 0.1953574 0.9944329 0.1933451 0.9864815 0.3016087 0.9254918 0.28209 0.9864815 0.3016087 0.9761061 0.3856844 0.9284146 0.3857815 0.9254918 0.28209 0.9284146 0.3857815 0.8807934 0.3883711 0.8656985 0.3050134 0.9254918 0.28209 0.8656985 0.3050134 0.851661 0.1973696 0.9230469 0.1953574 0.919399 0.5069781 0.9216163 0.6447544 0.8523508 0.6520735 0.8407818 0.5052357 0.919399 0.5069781 0.8407818 0.5052357 0.844913 0.4107519 0.9175348 0.3911404 0.919399 0.5069781 0.9175348 0.3911404 0.99075 0.4084049 0.9979195 0.5027068 0.919399 0.5069781 0.9979195 0.5027068 0.9910812 0.6498411 0.9216163 0.6447544 0.7429776 0.1226989 0.7398985 0.262712 0.6290947 0.2602754 0.6459882 0.1111689 0.7429776 0.1226989 0.6459882 0.1111689 0.6730101 0.01748108 0.7456476 0.001299023 0.7429776 0.1226989 0.7456476 0.001299023 0.8175033 0.02065885 0.8403801 0.1154441 0.7429776 0.1226989 0.8403801 0.1154441 0.8507022 0.2651488 0.7398985 0.262712 0.4693725 0.3499637 0.3087984 0.3652234 0.3078562 0.2421994 0.4790816 0.2397779 0.4693725 0.3499637 0.4790816 0.2397779 0.6116473 0.2379031 0.5936647 0.3400568 0.4693725 0.3499637 0.5936647 0.3400568 0.5483058 0.407191 0.4566267 0.4386663 0.4693725 0.3499637 0.4566267 0.4386663 0.3110883 0.4642589 0.3087984 0.3652234 0.4671797 0.8567793 0.3064708 0.8705447 0.3066727 0.7475172 0.4779133 0.7466887 0.4671797 0.8567793 0.4779133 0.7466887 0.6104908 0.7460473 0.5915584 0.848029 0.4671797 0.8567793 0.5915584 0.848029 0.5455772 0.9147384 0.4536093 0.9453592 0.4671797 0.8567793 0.4536093 0.9453592 0.3078393 0.9695969 0.3064708 0.8705447 0.920602 0.1086248 0.9176791 0.004933178 0.9653003 0.002343654 0.9803954 0.08570134 0.920602 0.1086248 0.9803954 0.08570134 0.9944329 0.1933451 0.9230469 0.1953574 0.920602 0.1086248 0.9230469 0.1953574 0.851661 0.1973696 0.8596124 0.08910602 0.920602 0.1086248 0.8596124 0.08910602 0.8699877 0.005030393 0.9176791 0.004933178 0.7368194 0.4027251 0.7341496 0.5241248 0.6622938 0.504765 0.639417 0.40998 0.7368194 0.4027251 0.639417 0.40998 0.6290947 0.2602754 0.7398985 0.262712 0.7368194 0.4027251 0.7398985 0.262712 0.8507022 0.2651488 0.8338087 0.414255 0.7368194 0.4027251 0.8338087 0.414255 0.806787 0.5079426 0.7341496 0.5241248 0.4662605 0.1299108 0.3053193 0.1191979 0.3048078 0.02013748 0.4510114 0.04160428 0.4662605 0.1299108 0.4510114 0.04160428 0.5435438 0.07047432 0.5907829 0.1362989 0.4662605 0.1299108 0.5907829 0.1362989 0.6116473 0.2379031 0.4790816 0.2397779 0.4662605 0.1299108 0.4790816 0.2397779 0.3078562 0.2421994 0.3053193 0.1191979 0.4661149 0.6367069 0.30528 0.6244974 0.3056898 0.5254363 0.4516879 0.5482621 0.4661149 0.6367069 0.4516879 0.5482621 0.5439479 0.5779919 0.5905726 0.6442531 0.4661149 0.6367069 0.5905726 0.6442531 0.6104908 0.7460473 0.4779133 0.7466887 0.4661149 0.6367069 0.4779133 0.7466887 0.3066727 0.7475172 0.30528 0.6244974 0.7478554 0.7522027 0.8117498 0.848843 0.7407457 0.8736815 0.6839661 0.7980487 0.7478554 0.7522027 0.6839661 0.7980487 0.6105691 0.6703454 0.67186 0.6372596 0.7478554 0.7522027 0.67186 0.6372596 0.7263082 0.5938239 0.8150618 0.7113739 0.7478554 0.7522027 0.8150618 0.7113739 0.8624135 0.7932399 0.8117498 0.848843 0.9238237 0.7819263 0.9257813 0.9035719 0.8823152 0.8903767 0.8676691 0.795965 0.9238237 0.7819263 0.8676691 0.795965 0.8523508 0.6520735 0.9216163 0.6447544 0.9238237 0.7819263 0.9216163 0.6447544 0.9910812 0.6498411 0.9804008 0.7941507 0.9238237 0.7819263 0.9804008 0.7941507 0.9688003 0.8889849 0.9257813 0.9035719 0.1496201 0.3775806 0.02826094 0.3916518 0.008540332 0.2464318 0.1377028 0.2446056 0.1496201 0.3775806 0.1377028 0.2446056 0.3078562 0.2421994 0.3087984 0.3652234 0.1496201 0.3775806 0.3087984 0.3652234 0.3110883 0.4642589 0.1653993 0.4856656 0.1496201 0.3775806 0.1653993 0.4856656 0.07440924 0.4749591 0.02826094 0.3916518 0.1471845 0.881421 0.02569997 0.8943629 0.007330656 0.748966 0.1365044 0.7483409 0.1471845 0.881421 0.1365044 0.7483409 0.3066727 0.7475172 0.3064708 0.8705447 0.1471845 0.881421 0.3064708 0.8705447 0.3078393 0.9695969 0.1619578 0.9896478 0.1471845 0.881421 0.1619578 0.9896478 0.07107144 0.9780957 0.02569997 0.8943629 0.1458555 0.1113468 0.02414715 0.1007127 0.06792134 0.0161339 0.158572 0.002858996 0.1458555 0.1113468 0.158572 0.002858996 0.3048078 0.02013748 0.3053193 0.1191979 0.1458555 0.1113468 0.3053193 0.1191979 0.3078562 0.2421994 0.1377028 0.2446056 0.1458555 0.1113468 0.1377028 0.2446056 0.008540332 0.2464318 0.02414715 0.1007127 0.1458958 0.6151636 0.02429163 0.6033983 0.06885039 0.5192301 0.1596208 0.5067986 0.1458958 0.6151636 0.1596208 0.5067986 0.3056898 0.5254363 0.30528 0.6244974 0.1458958 0.6151636 0.30528 0.6244974 0.3066727 0.7475172 0.1365044 0.7483409 0.1458958 0.6151636 0.1365044 0.7483409 0.007330656 0.748966 0.02429163 0.6033983</float_array>
<technique_common>
<accessor source="#sinonatrix_shield-mesh-map-0-array" count="256" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="sinonatrix_shield-mesh-vertices">
<input semantic="POSITION" source="#sinonatrix_shield-mesh-positions"/>
</vertices>
<polylist count="64">
<input semantic="VERTEX" source="#sinonatrix_shield-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#sinonatrix_shield-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#sinonatrix_shield-mesh-map-0" offset="2" set="0"/>
<vcount>4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 </vcount>
<p>0 0 0 42 0 1 60 0 2 17 0 3 0 1 4 17 1 5 53 1 6 18 1 7 0 2 8 18 2 9 49 2 10 37 2 11 0 3 12 37 3 13 61 3 14 42 3 15 1 4 16 32 4 17 56 4 18 20 4 19 1 5 20 20 5 21 54 5 22 21 5 23 1 6 24 21 6 25 50 6 26 29 6 27 1 7 28 29 7 29 57 7 30 32 7 31 2 8 32 43 8 33 62 8 34 23 8 35 2 9 36 23 9 37 55 9 38 24 9 39 2 10 40 24 10 41 51 10 42 39 10 43 2 11 44 39 11 45 63 11 46 43 11 47 3 12 48 33 12 49 58 12 50 26 12 51 3 13 52 26 13 53 52 13 54 16 13 55 3 14 56 16 14 57 48 14 58 31 14 59 3 15 60 31 15 61 59 15 62 33 15 63 4 16 64 44 16 65 64 16 66 40 16 67 4 17 68 40 17 69 57 17 70 29 17 71 4 18 72 29 18 73 50 18 74 25 18 75 4 19 76 25 19 77 63 19 78 44 19 79 5 20 80 45 20 81 65 20 82 41 20 83 5 21 84 41 21 85 56 21 86 28 21 87 5 22 88 28 22 89 53 22 90 17 22 91 5 23 92 17 23 93 60 23 94 45 23 95 6 24 96 18 24 97 53 24 98 28 24 99 6 25 100 28 25 101 56 25 102 32 25 103 6 26 104 32 26 105 57 26 106 22 26 107 6 27 108 22 27 109 49 27 110 18 27 111 7 28 112 24 28 113 55 28 114 30 28 115 7 29 116 30 29 117 58 29 118 33 29 119 7 30 120 33 30 121 59 30 122 27 30 123 7 31 124 27 31 125 51 31 126 24 31 127 8 32 128 46 32 129 61 32 130 37 32 131 8 33 132 37 33 133 49 33 134 22 33 135 8 34 136 22 34 137 57 34 138 40 34 139 8 35 140 40 35 141 64 35 142 46 35 143 9 36 144 47 36 145 62 36 146 38 36 147 9 37 148 38 37 149 54 37 150 20 37 151 9 38 152 20 38 153 56 38 154 41 38 155 9 39 156 41 39 157 65 39 158 47 39 159 10 40 160 16 40 161 52 40 162 36 40 163 10 41 164 36 41 165 60 41 166 42 41 167 10 42 168 42 42 169 61 42 170 19 42 171 10 43 172 19 43 173 48 43 174 16 43 175 11 44 176 21 44 177 54 44 178 38 44 179 11 45 180 38 45 181 62 45 182 43 45 183 11 46 184 43 46 185 63 46 186 25 46 187 11 47 188 25 47 189 50 47 190 21 47 191 12 48 192 27 48 193 59 48 194 34 48 195 12 49 196 34 49 197 64 49 198 44 49 199 12 50 200 44 50 201 63 50 202 39 50 203 12 51 204 39 51 205 51 51 206 27 51 207 13 52 208 26 52 209 58 52 210 35 52 211 13 53 212 35 53 213 65 53 214 45 53 215 13 54 216 45 54 217 60 54 218 36 54 219 13 55 220 36 55 221 52 55 222 26 55 223 14 56 224 31 56 225 48 56 226 19 56 227 14 57 228 19 57 229 61 57 230 46 57 231 14 58 232 46 58 233 64 58 234 34 58 235 14 59 236 34 59 237 59 59 238 31 59 239 15 60 240 30 60 241 55 60 242 23 60 243 15 61 244 23 61 245 62 61 246 47 61 247 15 62 248 47 62 249 65 62 250 35 62 251 15 63 252 35 63 253 58 63 254 30 63 255</p>
</polylist>
</mesh>
<extra><technique profile="MAYA"><double_sided>1</double_sided></technique></extra>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node id="sinonatrix_shield" name="sinonatrix_shield" type="NODE">
<translate sid="location">0 0 0</translate>
<rotate sid="rotationZ">0 0 1 0</rotate>
<rotate sid="rotationY">0 1 0 0</rotate>
<rotate sid="rotationX">1 0 0 0</rotate>
<scale sid="scale">1 1 1</scale>
<instance_geometry url="#sinonatrix_shield-mesh"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>
7 changes: 4 additions & 3 deletions data/models/ships/wave/wave.model
Expand Up @@ -17,12 +17,13 @@ material landing-gear-material
diffuse 0.3 0.3 0.3
specular 0 0 0

lod 50
mesh wave-mq.dae

lod 1000
mesh wave.dae
mesh wave_shield.dae

lod 50
mesh wave-mq.dae

anim gear_down 0 85

collision wave_coll.dae
20 changes: 13 additions & 7 deletions src/ModelViewer.cpp
Expand Up @@ -266,11 +266,14 @@ bool ModelViewer::OnHitIt(UI::Widget*)
void ModelViewer::HitImpl()
{
if(m_model) {
assert(m_shields.get());
// pick a point on the shield to serve as the point of impact.
SceneGraph::StaticGeometry* sg = m_shields->GetFirstShieldMesh();
Graphics::VertexArray *verts = sg->GetMesh(0)->GetSurface(0)->GetVertices();
vector3f pos = verts->position[ m_rng.Int32() % (sg->GetMesh(0)->GetNumVerts()-1) ];
m_shields->AddHit(vector3d(pos.x, pos.y, pos.z));
if(sg) {
Graphics::VertexArray *verts = sg->GetMesh(0)->GetSurface(0)->GetVertices();
vector3f pos = verts->position[ m_rng.Int32() % (sg->GetMesh(0)->GetNumVerts()-1) ];
m_shields->AddHit(vector3d(pos.x, pos.y, pos.z));
}
}
m_shieldHitPan = -1.48f;
m_shieldIsHit = true;
Expand Down Expand Up @@ -1020,9 +1023,12 @@ void ModelViewer::SetupUI()

add_pair(c, mainBox, toggleGridButton = c->SmallButton(), "Grid mode");
add_pair(c, mainBox, collMeshCheck = c->CheckBox(), "Collision mesh");
add_pair(c, mainBox, showShieldsCheck = c->CheckBox(), "Show Shields");
add_pair(c, mainBox, hitItButton = c->SmallButton(), "Hit it!");
hitItButton->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnHitIt), hitItButton));
// not everything has a shield
if( m_shields.get() && m_shields->GetFirstShieldMesh() ) {
add_pair(c, mainBox, showShieldsCheck = c->CheckBox(), "Show Shields");
add_pair(c, mainBox, hitItButton = c->SmallButton(), "Hit it!");
hitItButton->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnHitIt), hitItButton));
}

//pattern selector
if (m_model->SupportsPatterns()) {
Expand Down Expand Up @@ -1163,7 +1169,7 @@ void ModelViewer::SetupUI()

//event handlers
collMeshCheck->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnToggleCollMesh), collMeshCheck));
showShieldsCheck->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnToggleShowShields), showShieldsCheck));
if( m_shields.get() && showShieldsCheck ) { showShieldsCheck->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnToggleShowShields), showShieldsCheck)); }
gunsCheck->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnToggleGuns), gunsCheck));
lightSelector->onOptionSelected.connect(sigc::mem_fun(*this, &ModelViewer::OnLightPresetChanged));
toggleGridButton->onClick.connect(sigc::bind(sigc::mem_fun(*this, &ModelViewer::OnToggleGrid), toggleGridButton));
Expand Down
1 change: 1 addition & 0 deletions src/Shields.cpp
Expand Up @@ -113,6 +113,7 @@ void Shields::ReparentShieldNodes(SceneGraph::Model* model)
// find the accumulated transform from the root to our node
matrix4x4f accum(matrix4x4f::Identity());
matrix4x4f outMat(matrix4x4f::Identity());
model->GetRoot()->GatherTransforms(mt->GetName(), accum, outMat);

// set our nodes transformation to be the accumulated transform
MatrixTransform *sg_transform_parent = new MatrixTransform(renderer, outMat);
Expand Down
9 changes: 9 additions & 0 deletions src/Shields.h
Expand Up @@ -13,6 +13,15 @@
namespace Graphics { class Renderer; }
namespace SceneGraph { class Model; class StaticGeometry; }

struct ShieldRenderParameters {
static const Uint32 MAX_SHIELD_HITS = 5; // Also defined in ShieldMaterial.h
float strength;
float coolDown;
vector3f hitPos[MAX_SHIELD_HITS];
float radii[MAX_SHIELD_HITS];
Sint32 numHits;
};

class Shields
{
public:
Expand Down
9 changes: 0 additions & 9 deletions src/Ship.h
Expand Up @@ -31,15 +31,6 @@ struct HeatGradientParameters_t {
float heatingAmount; // 0.0 to 1.0 used for `u` component of heatGradient texture
};

struct ShieldRenderParameters {
static const Uint32 MAX_SHIELD_HITS = 5; // Also defined in ShieldMaterial.h
float strength;
float coolDown;
vector3f hitPos[MAX_SHIELD_HITS];
float radii[MAX_SHIELD_HITS];
Uint32 numHits;
};

struct shipstats_t {
int used_capacity;
int used_cargo;
Expand Down