game getting better

This commit is contained in:
Vladislav Khorev 2013-01-27 21:48:57 +00:00
parent 43d93746d8
commit dca24f25e3
17 changed files with 5379 additions and 5543 deletions

123
assets/box.xml Normal file
View File

@ -0,0 +1,123 @@
<Model>
<SamplerMap>
<Sampler name="Texture" value="tube_i.png"/>
</SamplerMap>
<Vec3ArrMap>
<Vec3Arr name="vPosition">
<Vec3>1.54974e-005, -75.0, -75.0</Vec3>
<Vec3>8.9407e-006, 75.0, -75.0</Vec3>
<Vec3>-1.54974e-005, 75.0, 75.0</Vec3>
<Vec3>-1.54974e-005, 75.0, 75.0</Vec3>
<Vec3>-8.9407e-006, -75.0, 75.0</Vec3>
<Vec3>1.54974e-005, -75.0, -75.0</Vec3>
<Vec3>-150.0, -75.0, -75.0</Vec3>
<Vec3>-150.0, -75.0, 75.0</Vec3>
<Vec3>-150.0, 75.0, 75.0</Vec3>
<Vec3>-150.0, 75.0, 75.0</Vec3>
<Vec3>-150.0, 75.0, -75.0</Vec3>
<Vec3>-150.0, -75.0, -75.0</Vec3>
<Vec3>1.54974e-005, -75.0, -75.0</Vec3>
<Vec3>-8.9407e-006, -75.0, 75.0</Vec3>
<Vec3>-150.0, -75.0, 75.0</Vec3>
<Vec3>-150.0, -75.0, 75.0</Vec3>
<Vec3>-150.0, -75.0, -75.0</Vec3>
<Vec3>1.54974e-005, -75.0, -75.0</Vec3>
<Vec3>-8.9407e-006, -75.0, 75.0</Vec3>
<Vec3>-1.54974e-005, 75.0, 75.0</Vec3>
<Vec3>-150.0, 75.0, 75.0</Vec3>
<Vec3>-150.0, 75.0, 75.0</Vec3>
<Vec3>-150.0, -75.0, 75.0</Vec3>
<Vec3>-8.9407e-006, -75.0, 75.0</Vec3>
<Vec3>-1.54974e-005, 75.0, 75.0</Vec3>
<Vec3>8.9407e-006, 75.0, -75.0</Vec3>
<Vec3>-150.0, 75.0, -75.0</Vec3>
<Vec3>-150.0, 75.0, -75.0</Vec3>
<Vec3>-150.0, 75.0, 75.0</Vec3>
<Vec3>-1.54974e-005, 75.0, 75.0</Vec3>
<Vec3>8.9407e-006, 75.0, -75.0</Vec3>
<Vec3>1.54974e-005, -75.0, -75.0</Vec3>
<Vec3>-150.0, -75.0, -75.0</Vec3>
<Vec3>-150.0, -75.0, -75.0</Vec3>
<Vec3>-150.0, 75.0, -75.0</Vec3>
<Vec3>8.9407e-006, 75.0, -75.0</Vec3>
</Vec3Arr>
<Vec3Arr name="Normal">
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>1.0, 0.0, 1.62921e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>-1.0, 0.0, -2.03451e-007</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 0.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>-1.52588e-007, 0.0, 1.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>0.0, 1.0, 0.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
<Vec3>1.52588e-007, 0.0, -1.0</Vec3>
</Vec3Arr>
</Vec3ArrMap>
<Vec2ArrMap>
<Vec2Arr name="vTexCoord">
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
<Vec2>1.0, 0.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>1.0, 1.0</Vec2>
<Vec2>0.0, 1.0</Vec2>
<Vec2>0.0, 0.0</Vec2>
</Vec2Arr>
</Vec2ArrMap>
</Model>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

File diff suppressed because it is too large Load Diff

1023
assets/tube2.xml Normal file

File diff suppressed because it is too large Load Diff

483
assets/tube3.xml Normal file
View File

@ -0,0 +1,483 @@
<Model>
<SamplerMap>
<Sampler name="Texture" value="tube_i.png"/>
</SamplerMap>
<Vec3ArrMap>
<Vec3Arr name="vPosition">
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>469.846, -171.011, 2500.0</Vec3>
<Vec3>500.0, -0.000109278, 2500.0</Vec3>
<Vec3>500.0, -0.000109278, 2500.0</Vec3>
<Vec3>469.846, 171.01, 2500.0</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>500.0, -0.000109278, 2500.0</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>-469.846, -171.01, -7.47508e-006</Vec3>
<Vec3>-500.0, 7.54979e-005, 0.0</Vec3>
<Vec3>-500.0, 7.54979e-005, 0.0</Vec3>
<Vec3>-469.846, 171.01, 7.47509e-006</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>-500.0, 7.54979e-005, 0.0</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>-469.846, -171.01, 2500.0</Vec3>
<Vec3>-469.846, -171.01, 2500.0</Vec3>
<Vec3>-383.022, -321.394, 2500.0</Vec3>
<Vec3>-250.0, -433.013, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>-469.846, -171.01, 2500.0</Vec3>
<Vec3>-250.0, -433.013, 2500.0</Vec3>
<Vec3>-250.0, -433.013, 2500.0</Vec3>
<Vec3>-86.8243, -492.404, 2500.0</Vec3>
<Vec3>86.8238, -492.404, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>-250.0, -433.013, 2500.0</Vec3>
<Vec3>86.8238, -492.404, 2500.0</Vec3>
<Vec3>86.8238, -492.404, 2500.0</Vec3>
<Vec3>250.0, -433.013, 2500.0</Vec3>
<Vec3>383.022, -321.394, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>86.8238, -492.404, 2500.0</Vec3>
<Vec3>383.022, -321.394, 2500.0</Vec3>
<Vec3>350.0, -99.9999, 2500.0</Vec3>
<Vec3>383.022, -321.394, 2500.0</Vec3>
<Vec3>469.846, -171.011, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-469.846, 171.01, 2500.0</Vec3>
<Vec3>-500.0, -3.37806e-005, 2500.0</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-500.0, -3.37806e-005, 2500.0</Vec3>
<Vec3>-350.0, -99.9999, 2500.0</Vec3>
<Vec3>-500.0, -3.37806e-005, 2500.0</Vec3>
<Vec3>-469.846, -171.01, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>350.0, 100.0, 2500.0</Vec3>
<Vec3>469.846, 171.01, 2500.0</Vec3>
<Vec3>469.846, 171.01, 2500.0</Vec3>
<Vec3>383.022, 321.394, 2500.0</Vec3>
<Vec3>250.0, 433.013, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>469.846, 171.01, 2500.0</Vec3>
<Vec3>250.0, 433.013, 2500.0</Vec3>
<Vec3>250.0, 433.013, 2500.0</Vec3>
<Vec3>86.8241, 492.404, 2500.0</Vec3>
<Vec3>-86.8242, 492.404, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>250.0, 433.013, 2500.0</Vec3>
<Vec3>-86.8242, 492.404, 2500.0</Vec3>
<Vec3>-86.8242, 492.404, 2500.0</Vec3>
<Vec3>-250.0, 433.013, 2500.0</Vec3>
<Vec3>-383.022, 321.394, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-86.8242, 492.404, 2500.0</Vec3>
<Vec3>-383.022, 321.394, 2500.0</Vec3>
<Vec3>-350.0, 100.0, 2500.0</Vec3>
<Vec3>-383.022, 321.394, 2500.0</Vec3>
<Vec3>-469.846, 171.01, 2500.0</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>469.846, -171.01, -7.4751e-006</Vec3>
<Vec3>383.022, -321.394, -1.40486e-005</Vec3>
<Vec3>383.022, -321.394, -1.40486e-005</Vec3>
<Vec3>250.0, -433.013, -1.89276e-005</Vec3>
<Vec3>86.8238, -492.404, -2.15237e-005</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>383.022, -321.394, -1.40486e-005</Vec3>
<Vec3>86.8238, -492.404, -2.15237e-005</Vec3>
<Vec3>86.8238, -492.404, -2.15237e-005</Vec3>
<Vec3>-86.8243, -492.404, -2.15237e-005</Vec3>
<Vec3>-250.0, -433.013, -1.89276e-005</Vec3>
<Vec3>-250.0, -433.013, -1.89276e-005</Vec3>
<Vec3>-383.022, -321.394, -1.40486e-005</Vec3>
<Vec3>-469.846, -171.01, -7.47508e-006</Vec3>
<Vec3>86.8238, -492.404, -2.15237e-005</Vec3>
<Vec3>-250.0, -433.013, -1.89276e-005</Vec3>
<Vec3>-469.846, -171.01, -7.47508e-006</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>86.8238, -492.404, -2.15237e-005</Vec3>
<Vec3>-469.846, -171.01, -7.47508e-006</Vec3>
<Vec3>-350.0, -100.0, 3.37758e-005</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>-469.846, -171.01, -7.47508e-006</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>469.846, 171.01, 7.47509e-006</Vec3>
<Vec3>500.0, 0.0, 0.0</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>500.0, 0.0, 0.0</Vec3>
<Vec3>350.0, -100.0, -8.18585e-006</Vec3>
<Vec3>500.0, 0.0, 0.0</Vec3>
<Vec3>469.846, -171.01, -7.4751e-006</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>-350.0, 99.9998, 5.56432e-007</Vec3>
<Vec3>-469.846, 171.01, 7.47509e-006</Vec3>
<Vec3>-469.846, 171.01, 7.47509e-006</Vec3>
<Vec3>-383.022, 321.394, 1.40486e-005</Vec3>
<Vec3>-250.0, 433.013, 1.89276e-005</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>-469.846, 171.01, 7.47509e-006</Vec3>
<Vec3>-250.0, 433.013, 1.89276e-005</Vec3>
<Vec3>-250.0, 433.013, 1.89276e-005</Vec3>
<Vec3>-86.8242, 492.404, 2.15237e-005</Vec3>
<Vec3>86.8241, 492.404, 2.15237e-005</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>-250.0, 433.013, 1.89276e-005</Vec3>
<Vec3>86.8241, 492.404, 2.15237e-005</Vec3>
<Vec3>86.8241, 492.404, 2.15237e-005</Vec3>
<Vec3>250.0, 433.013, 1.89276e-005</Vec3>
<Vec3>383.022, 321.394, 1.40486e-005</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>86.8241, 492.404, 2.15237e-005</Vec3>
<Vec3>383.022, 321.394, 1.40486e-005</Vec3>
<Vec3>350.0, 99.9998, 4.25181e-005</Vec3>
<Vec3>383.022, 321.394, 1.40486e-005</Vec3>
<Vec3>469.846, 171.01, 7.47509e-006</Vec3>
</Vec3Arr>
<Vec3Arr name="Normal">
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 2.03507e-007, -1.0</Vec3>
<Vec3>0.0, 1.80149e-007, -1.0</Vec3>
<Vec3>1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 2.03507e-007, -1.0</Vec3>
<Vec3>1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>0.0, 1.0, -1.2207e-007</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>1.0, 0.0, 0.0</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>0.0, -1.0, 1.2207e-007</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>-1.0, 0.0, 0.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 0.0, 1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.80149e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.80149e-007, -1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.80149e-007, -1.0</Vec3>
<Vec3>0.0, 2.03507e-007, -1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>0.0, 1.80149e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>-2.62679e-007, 0.0, -1.0</Vec3>
<Vec3>-1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>-1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>0.0, 1.78135e-007, -1.0</Vec3>
<Vec3>-1.24604e-007, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>0.0, 0.0, -1.0</Vec3>
<Vec3>-2.62679e-007, 0.0, -1.0</Vec3>
</Vec3Arr>
</Vec3ArrMap>
<Vec2ArrMap>
<Vec2Arr name="vTexCoord">
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.67101, 0.969846</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>1.0, 0.958498</Vec2>
<Vec2>1.0, 0.0552745</Vec2>
<Vec2>0.0, 0.0552745</Vec2>
<Vec2>0.0, 0.0552745</Vec2>
<Vec2>0.0, 0.958498</Vec2>
<Vec2>1.0, 0.958498</Vec2>
<Vec2>0.0415016, 1.0</Vec2>
<Vec2>0.944726, 1.0</Vec2>
<Vec2>0.944726, 0.0</Vec2>
<Vec2>0.944726, 0.0</Vec2>
<Vec2>0.0415016, 0.0</Vec2>
<Vec2>0.0415016, 1.0</Vec2>
<Vec2>0.0, 0.0552745</Vec2>
<Vec2>0.0, 0.958498</Vec2>
<Vec2>1.0, 0.958498</Vec2>
<Vec2>1.0, 0.958498</Vec2>
<Vec2>1.0, 0.0552745</Vec2>
<Vec2>0.0, 0.0552745</Vec2>
<Vec2>0.958498, 0.0</Vec2>
<Vec2>0.0552745, 0.0</Vec2>
<Vec2>0.0552745, 1.0</Vec2>
<Vec2>0.0552745, 1.0</Vec2>
<Vec2>0.958498, 1.0</Vec2>
<Vec2>0.958498, 0.0</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.821394, 0.116978</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.992404, 0.413176</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.933013, 0.75</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.67101, 0.969846</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.5, 0.0</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
<Vec2>0.178606, 0.883022</Vec2>
<Vec2>0.0669873, 0.75</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
<Vec2>0.0669873, 0.75</Vec2>
<Vec2>0.0669873, 0.75</Vec2>
<Vec2>0.00759611, 0.586824</Vec2>
<Vec2>0.00759611, 0.413176</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.0669873, 0.75</Vec2>
<Vec2>0.00759611, 0.413176</Vec2>
<Vec2>0.00759611, 0.413176</Vec2>
<Vec2>0.0669873, 0.25</Vec2>
<Vec2>0.178606, 0.116978</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.00759611, 0.413176</Vec2>
<Vec2>0.178606, 0.116978</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.178606, 0.116978</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.67101, 0.969846</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.933013, 0.75</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.821394, 0.883022</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.992404, 0.413176</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.821394, 0.116978</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.933013, 0.25</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.992404, 0.586824</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.6, 0.15</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.67101, 0.0301536</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.6, 0.85</Vec2>
<Vec2>0.5, 1.0</Vec2>
<Vec2>0.67101, 0.969846</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.4, 0.15</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.178606, 0.116978</Vec2>
<Vec2>0.0669873, 0.25</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.32899, 0.0301537</Vec2>
<Vec2>0.0669873, 0.25</Vec2>
<Vec2>0.0669873, 0.25</Vec2>
<Vec2>0.00759611, 0.413176</Vec2>
<Vec2>0.00759611, 0.586824</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.0669873, 0.25</Vec2>
<Vec2>0.00759611, 0.586824</Vec2>
<Vec2>0.00759611, 0.586824</Vec2>
<Vec2>0.0669873, 0.75</Vec2>
<Vec2>0.178606, 0.883022</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.00759611, 0.586824</Vec2>
<Vec2>0.178606, 0.883022</Vec2>
<Vec2>0.4, 0.85</Vec2>
<Vec2>0.178606, 0.883022</Vec2>
<Vec2>0.32899, 0.969846</Vec2>
</Vec2Arr>
</Vec2ArrMap>
</Model>

3255
assets/tube4.xml Normal file

File diff suppressed because it is too large Load Diff

BIN
assets/tube_i.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -91,10 +91,12 @@ m.lock();
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, float x, float y, long time)
{
m.lock();
*Console<<"OuterOnTapDown";
m.lock();
try
{
Renderer->MoveDist(1.0f);
*Console<<"OuterOnTapDown2";
App->OuterOnTapDown(vec2(x,y));
}
catch (...)
{
@ -106,10 +108,38 @@ m.lock();
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, float x, float y, long time)
{
*Console<<"OuterOnTapUp";
m.lock();
try
{
*Console<<"OuterOnTapUp2";
App->OuterOnTapUp(vec2(x,y));
}
catch (...)
{
throw;
}
m.unlock();
}
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapUpAfterShift(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time)
{
m.lock();
try
{
*Console<<"OuterOnTapUp2";
App->OuterOnTapUpAfterShift(vec2(x,y));
}
catch (...)
{
throw;
}
m.unlock();
}
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, float x, float y, long time)
{
//NIU???
}
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time)
@ -119,7 +149,18 @@ JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnFling(JN
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time)
{
*Console<<"OuterOnMove";
m.lock();
try
{
*Console<<"OuterOnMove2";
App->OuterOnMove(vec2(distanceX,distanceY));
}
catch (...)
{
throw;
}
m.unlock();
}
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode)

View File

@ -23,7 +23,8 @@ extern "C" {
JNIEXPORT int JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_IsInited(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnTapUpAfterShift(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time);
JNIEXPORT void JNICALL Java_fishrungames_salmonjnitemplate_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode);

View File

@ -13,6 +13,29 @@
#include "main_code.h"
const int CONST_TUBE_COUNT = 1;
const int CONST_MAX_BOXES = 50;
TFlexModel GenerateFlexModel(int i)
{
return ResourceManager->FlexModelManager.InstanciateModel("tube"+tostr(i+1)+".xml");
}
/*
std::pair<TFlexModel, TVolumeBody> GenerateBox(int pos)
{
std::pair<TFlexModel, TVolumeBody> r;
r.first = ResourceManager->FlexModelManager.InstanciateModel("box.xml");
//r.first.ScaleModel(0.1f);
r.first.MoveModel(vec3(rand() % 800 - 400, rand() % 800 - 400, -2500.f+pos*(-100)));
r.first.RefreshBuffer();
r.second.AssignFromFlexModel(r.first);
return r;
}*/
void TMyApplication::InnerInit()
{
@ -42,48 +65,64 @@ void TMyApplication::InnerInit()
ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.bmp32", "droid_sans14_font_charmap.txt");
ResourceManager->FontManager.PushFont("droid_sans14");
ResourceManager->SoundManager.LoadMusic("level1ogg.ogg");
//ResourceManager->SoundManager.LoadMusic("level1ogg.ogg");
ResourceManager->SoundManager.LoadSound("shot.wav");
//ResourceManager->SoundManager.LoadSound("shot.wav");
//Renderer->MovePhi(pi/6);
Renderer->CameraMover = TPitCamera();
//boost::get<TPanoramicCamera>(Renderer->CameraMover).MoveDist(3.5f);
ResourceManager->LightManager.SetLightDirection(vec3(-1,0,-1));
ResourceManager->LightManager.SetLightColor(vec4(1,0,0,1));
ResourceManager->TexList.AddTexture("bt_box_yellow.bmp");
ResourceManager->TexList.AddTexture("tube.png");
ResourceManager->FlexModelManager.LoadModelFromXml("model.xml");
ResourceManager->TexList.AddTexture("tube_i.png");
//ResourceManager->FlexModelManager.LoadModelFromXml("model.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("box.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("pit.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("tube1.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("tube2.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("tube3.xml");
ResourceManager->FlexModelManager.LoadModelFromXml("tube4.xml");
FlexModel = ResourceManager->FlexModelManager.InstanciateModel("pit.xml");
FlexModel.MoveModel(vec3(0, -40.f, 0));
FlexModel.ScaleModel(0.03f);
FlexModel.MoveModel(vec3(0, 0.f, -3.5f));
//FlexModel.ScaleModel(0.03f);
//FlexModel.MoveModel(vec3(0, -1.2f, -3.5f));
//FlexModel.ScaleModel(0.3f);
FlexModel.MoveModel(vec3(0, -36.f, -105.f));
FlexModel.RefreshBuffer();
//TubeModelArr.resize(20);
TubeModelArr.resize(2);
TubeModelArr.resize(4);
TubeBodyArr.resize(4);
for (size_t i = 0; i < TubeModelArr.size(); ++i)
{
TubeModelArr[i] = ResourceManager->FlexModelManager.InstanciateModel("tube1.xml");
TubeModelArr[i].MoveModel(vec3(0, 0, -250.f*i));
TubeModelArr[i].ScaleModel(10.f);
TubeModelArr[i] = GenerateFlexModel(rand() % CONST_TUBE_COUNT);
TubeModelArr[i].PushModelDataTriangleList();
TubeModelArr[i].MoveModel(vec3(0, 0, -2500.f*i));
TubeModelArr[i].RefreshBuffer();
//TubeModelArr[i].PushModelDataTriangleList();
TubeBodyArr[i].AssignFromFlexModel(TubeModelArr[i]);
}
/*
for (int i=0; i< CONST_MAX_BOXES; i++)
{
BoxList.push_back(GenerateBox(i));
}*/
//Uncomment to start music playing
//ResourceManager->SoundManager.PlayMusic("level1ogg.ogg");
Velocity = 10.f;
Velocity = 4.f;
PrevCamVec = boost::get<TPitCamera>(Renderer->CameraMover).CamVec;
RotateShift = vec2(0.f, 0.f);
*Console<<"Inner init end!\n";
}
@ -110,13 +149,44 @@ void TMyApplication::InnerDraw()
{
TubeModelArr[i].Draw();
}
/*
BOOST_FOREACH(auto& i, BoxList)
{
i.first.Draw();
}*/
Renderer->PopMatrix();
Renderer->PopProjectionMatrix();
glClear(GL_DEPTH_BUFFER_BIT);
Renderer->PushMatrix();
vec4 q;
vec3 camVec = boost::get<TPitCamera>(Renderer->CameraMover).CamVec;
vec4 camQuat = boost::get<TPitCamera>(Renderer->CameraMover).CameraQuat;
vec3 n = Normalize(CrossProduct(camVec, PrevCamVec));
float cos_a = min(DotProduct(camVec, PrevCamVec), 1.f);
n = InverseQuat(camQuat) * vec4(n) * (camQuat);
float sin_a = sqrtf(1 - cos_a*cos_a);
q = vec4(n.v[0] * sin_a, n.v[1] * sin_a, n.v[2] * sin_a, cos_a);
Renderer->RotateMatrix(q);
FlexModel.Draw();
Renderer->PopMatrix();
}
@ -128,6 +198,33 @@ void TMyApplication::InnerUpdate(cardinal dt)
vec3 camVec = boost::get<TPitCamera>(Renderer->CameraMover).CamVec;
camShift += camVec * (static_cast<float>(dt)*Velocity);
while (camShift.v[2] < -2500.f)
{
camShift.v[2] += 2500.f;
TubeModelArr.erase(TubeModelArr.begin());
TubeModelArr.push_back(GenerateFlexModel(rand() % CONST_TUBE_COUNT));
for (size_t i = 0; i < TubeModelArr.size()-1; ++i)
{
TubeModelArr[i].MoveModel(vec3(0, 0, 2500.f));
TubeModelArr[i].RefreshBuffer();
}
TubeModelArr[TubeModelArr.size()-1].MoveModel(vec3(0, 0, -2500.f*(TubeModelArr.size()-1)));
TubeModelArr[TubeModelArr.size()-1].RefreshBuffer();
for (size_t i = 0; i < TubeBodyArr.size(); ++i)
{
TubeBodyArr[i].AssignFromFlexModel(TubeModelArr[i]);
}
/*
BOOST_FOREACH(auto& i, BoxList)
{
i.first.Draw();
}*/
}
boost::get<TPitCamera>(Renderer->CameraMover).CamShift = camShift;
@ -139,71 +236,129 @@ void TMyApplication::InnerUpdate(cardinal dt)
if (a != b)
{
for (size_t i = 0; i < TubeModelArr.size(); ++i)
BOOST_FOREACH(TVolumeBody& body, TubeBodyArr)
{
TDataTriangleList& dataTriangleList = TubeModelArr[i].GetDataTriangleList();
for (size_t j = 0; j < dataTriangleList.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB].size(); j+=3)
if (body.CheckCollision(a,b))
{
TSmpTriangle smpTriangle;
smpTriangle.p[0] = dataTriangleList.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][j];
smpTriangle.p[1] = dataTriangleList.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][j + 1];
smpTriangle.p[2] = dataTriangleList.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][j + 2];
smpTriangle.v = smpTriangle.p[1] - smpTriangle.p[0];
smpTriangle.w = smpTriangle.p[2] - smpTriangle.p[1];
smpTriangle.n = CrossProduct(smpTriangle.v, smpTriangle.w);
if (LineCouldCrossTriangle(a, b, smpTriangle))
{
if (LineCrossTriangle(a, b, smpTriangle) == 1)
{
Velocity = 0;
}
}
Velocity = 0.f;
}
}
/*
BOOST_FOREACH(auto& i, BoxList)
{
if (i.second.CheckCollision(a,b))
{
Velocity = 0.f;
}
}*/
}
}
UpdatePitVector(dt);
const float CONST_ROTATE_SPEED = 0.001f;
float rotateShift = Length(RotateShift) * 0.01f / 2.f;
vec4 quat = vec4(RotateAxis.v[0] * sin(rotateShift*dt*CONST_ROTATE_SPEED), RotateAxis.v[1] * sin(rotateShift*dt*CONST_ROTATE_SPEED), RotateAxis.v[2] * sin(rotateShift*dt*CONST_ROTATE_SPEED), cos(rotateShift*dt*CONST_ROTATE_SPEED));
boost::get<TPitCamera>(Renderer->CameraMover).RotateByQuat(quat);
boost::get<TPitCamera>(Renderer->CameraMover).CalcCamVec();
}
void TMyApplication::InnerOnMove(vec2 shift)
{
float len = Length(shift);
RotateShift += shift;
//vec3 rotation = Normalize(vec3(shift, 0)); //Non-inverse
vec3 rotation = -Normalize(vec3(shift, 0)); //Inverse
//float len = Length(shift);
rotation.v[0] = -rotation.v[0];
vec3 rotation = Normalize(vec3(RotateShift, 0)); //Inverse
rotation.v[1] =-rotation.v[1]; //Inverse
vec3 z = vec3(0,0,-1);
vec4 startQuat = boost::get<TPitCamera>(Renderer->CameraMover).CameraQuat;
vec3 rotate_axis = Normalize(CrossProduct(rotation, z));
RotateAxis = Normalize(CrossProduct(rotation, z));
rotate_axis = startQuat * vec4(rotate_axis) * InverseQuat(startQuat);
RotateAxis = startQuat * vec4(RotateAxis) * InverseQuat(startQuat);
float half_alpha = len * 0.01f / 2.f;
//RotateShift = len * 0.01f / 2.f;
vec4 quat = vec4(rotate_axis.v[0] * sin(half_alpha), rotate_axis.v[1] * sin(half_alpha), rotate_axis.v[2] * sin(half_alpha), cos(half_alpha));
UpdatePitVector(0);
}
boost::get<TPitCamera>(Renderer->CameraMover).RotateByQuat(quat);
void TMyApplication::InnerOnTapUp(vec2 p)
{
RotateShift = vec2(0.f, 0.f);
boost::get<TPitCamera>(Renderer->CameraMover).CalcCamVec();
RotateAxis = vec3(0,0,0);
}
void TMyApplication::InnerOnTapUpAfterShift(vec2 p)
{
RotateShift = vec2(0.f, 0.f);
RotateAxis = vec3(0,0,0);
}
void TMyApplication::OnMouseWheel(short int delta)
{
Velocity = 10.f;
Velocity = 4.f;
boost::get<TPitCamera>(Renderer->CameraMover).CamShift = ZeroVec3;
}
void TMyApplication::UpdatePitVector(cardinal dt)
{
//Update pit vector
vec3 camVec = boost::get<TPitCamera>(Renderer->CameraMover).CamVec;
vec4 q;
vec3 n = -Normalize(CrossProduct(camVec, PrevCamVec));
float min_cos_a = min(DotProduct(camVec, PrevCamVec), 1.f);
const float diff_alpha = pi/96;
float angle = acos(min_cos_a);
if (angle >= diff_alpha)
{
//Correcting PrevCamVec;
min_cos_a = cosf(diff_alpha);
vec4 quat(-n.v[0]*sin(diff_alpha/2.f), -n.v[1]*sin(diff_alpha/2.f), -n.v[2]*sin(diff_alpha/2.f), cos(diff_alpha/2.f));
PrevCamVec = quat * vec4(camVec) * InverseQuat(quat);
}
//Catch up
const float omega = 0.0002f;
if (angle < omega * dt)
{
PrevCamVec = camVec;
}
else
{
vec4 delta_quat(n.v[0]*sin(omega * dt / 2.f), n.v[1]*sin(omega * dt / 2.f), n.v[2]*sin(omega * dt / 2.f), cos(omega * dt / 2.f));
PrevCamVec = delta_quat * vec4(PrevCamVec) * InverseQuat(delta_quat);
}
}

View File

@ -36,9 +36,15 @@ public:
TFlexModel FlexModel;
std::vector<TFlexModel> TubeModelArr;
std::vector<TVolumeBody> TubeBodyArr;
//std::list<std::pair<TFlexModel, TVolumeBody>> BoxList;
vec3 PrevCamVec;
vec3 RotateAxis;
//float RotateShift;
vec2 RotateShift;
TMyApplication() : TApplication(), Inited(false) { }
virtual void InnerInit();
@ -51,9 +57,13 @@ public:
bool IsInited() { return Inited; }
virtual void InnerOnMove(vec2 shift);
virtual void InnerOnTapUp(vec2 p);
virtual void InnerOnTapUpAfterShift(vec2 p);
virtual void OnMouseWheel(short int delta);
void UpdatePitVector(cardinal dt);
};

View File

@ -14,6 +14,7 @@ public class JniWrapper
public static native int IsInited();
public static native void OnTapDown(float x, float y, long time);
public static native void OnTapUp(float x, float y, long time);
public static native void OnTapUpAfterShift(float x, float y, long time);
public static native void OnTapMove(float x, float y, long time);
public static native void OnFling(float velocityX, float velocityY, long time);

View File

@ -134,6 +134,36 @@ public class MainActivity extends Activity
public boolean onTouchEvent(MotionEvent event)
{
if (event.getAction() == MotionEvent.ACTION_UP)
{
if (IsScrolling)
{
float x = event.getX();
float y = (float) mView.getHeight() - event.getY();
JniWrapper.OnTapUpAfterShift(x, y, event.getEventTime());
}
}
if (event.getAction() == MotionEvent.ACTION_MOVE)
{
/*
float x = event.getX();
float y = (float) mView.getHeight() - event.getY();
int historysize = event.getHistorySize();
float prevX = event.getHistoricalX(0);
float prevY = (float) mView.getHeight() - event.getHistoricalY(0);
JniWrapper.OnScroll(x-prevX, y-prevY, event.getEventTime());
IsScrolling = true;*/
}
if (gestureDetector.onTouchEvent(event))
{
return true;
@ -163,15 +193,17 @@ public class MainActivity extends Activity
float velocityY)
{
JniWrapper.OnFling(velocityX, velocityY, e2.getEventTime());
return true;
}
public boolean onScroll(MotionEvent e1, MotionEvent e2,
float distanceX, float distanceY)
{
JniWrapper.OnScroll(distanceX, distanceY, e2.getEventTime());
IsScrolling = true;
//JniWrapper.OnScroll(distanceX, distanceY, e2.getEventTime());
//IsScrolling = true;
return true;
}

View File

@ -65,6 +65,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../../../jni;$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TARGET_WIN32;TARGET_SALMON;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>