Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 965cebf708 | |||
| 4f75736747 | |||
| 857eaf4b7f | |||
| 206b6ee36c | |||
| 90f4d771ac | |||
| 92c9d52de5 | |||
| 3c6c38b2ce | |||
| a630554bb3 | |||
| 2681ca8680 | |||
| 485cdb7b5e | |||
| 525868e228 | |||
| 2cf2975437 |
@@ -5,8 +5,8 @@
|
||||
<author>Blender User</author>
|
||||
<authoring_tool>Blender 2.75.0 commit date:2015-07-07, commit time:14:56, hash:c27589e</authoring_tool>
|
||||
</contributor>
|
||||
<created>2015-10-23T16:10:27</created>
|
||||
<modified>2015-10-23T16:10:27</modified>
|
||||
<created>2015-10-23T14:55:47</created>
|
||||
<modified>2015-10-23T14:55:47</modified>
|
||||
<unit name="meter" meter="1"/>
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
@@ -157,7 +157,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Head_pose_matrix-output">
|
||||
<float_array id="Armature_002_Head_pose_matrix-output-array" count="32">2.8213e-7 0 -1 0 0 -0.9999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1 2.8213e-7 0 -1 0 0 -0.6999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Head_pose_matrix-output-array" count="32">2.8213e-7 0 -1 0 0 -0.8 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1 2.8213e-7 0 -1 0 0 -0.9999999 0 -0.305899 -1 0 -2.8213e-7 0 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Head_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -189,7 +189,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Ear_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_Ear_L_pose_matrix-output-array" count="32">-4.53842e-7 0.6170548 0.7869204 0.1847505 1.46037e-7 -0.7869204 0.6170546 1.127367 1 8.9407e-8 2.73509e-7 -0.002287612 0 0 0 1 -4.39136e-7 0.5461221 0.8377058 0.1847505 1.58507e-7 -0.8377059 0.5461219 1.127367 1 6.76434e-8 2.61131e-7 -0.002287612 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Ear_L_pose_matrix-output-array" count="32">-4.53842e-7 0.6170548 0.7869204 0.1847505 1.46037e-7 -0.7869205 0.6170546 1.127367 1 8.9407e-8 2.73509e-7 -0.002287612 0 0 0 1 -4.39136e-7 0.5461221 0.8377058 0.1847505 1.58507e-7 -0.8377059 0.5461219 1.127367 1 6.76434e-8 2.61131e-7 -0.002287612 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Ear_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -221,7 +221,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Ear_H_pose_matrix-output">
|
||||
<float_array id="Armature_002_Ear_H_pose_matrix-output-array" count="32">-6.18379e-7 -0.6170548 -0.7869204 -0.1847505 3.71728e-7 -0.7869204 0.6170546 1.127367 -1 -2.08617e-7 7.33482e-7 -0.0022877 0 0 0 1 -6.46627e-7 -0.5461221 -0.8377058 -0.1847505 3.06338e-7 -0.8377059 0.5461219 1.127367 -1 -2.01547e-7 7.00461e-7 -0.0022877 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Ear_H_pose_matrix-output-array" count="32">-6.18379e-7 -0.6170548 -0.7869204 -0.1847505 3.71728e-7 -0.7869205 0.6170546 1.127367 -1 -2.08617e-7 7.33482e-7 -0.0022877 0 0 0 1 -6.46627e-7 -0.5461221 -0.8377058 -0.1847505 3.06338e-7 -0.8377059 0.5461219 1.127367 -1 -2.01547e-7 7.00461e-7 -0.0022877 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Ear_H_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -637,7 +637,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm1_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm1_L_pose_matrix-output-array" count="32">-3.13422e-8 6.23634e-9 -1 3.93099e-4 0.08979136 0.9959605 3.39689e-9 -0.2065513 0.9959606 -0.08979137 -3.17755e-8 -0.170607 0 0 0 1 -4.93163e-8 0.08715574 -0.9961947 3.93099e-4 -6.54522e-8 0.9961947 0.08715573 -0.2065513 1 6.95013e-8 -4.34241e-8 -0.170607 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm1_L_pose_matrix-output-array" count="32">-4.37114e-8 0 -1 3.93099e-4 -6.29212e-8 0.9999999 7.10543e-15 -0.2065513 1 6.29212e-8 -4.37114e-8 -0.170607 0 0 0 1 -4.93163e-8 0.08715574 -0.9961947 3.93099e-4 -6.54522e-8 0.9961947 0.08715573 -0.2065513 1 6.95013e-8 -4.34241e-8 -0.170607 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm1_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -669,7 +669,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm2_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm2_L_pose_matrix-output-array" count="32">0.9647611 -0.2631273 1.49274e-7 0 0.2631273 0.9647611 4.47035e-8 0.2368225 -1.58325e-7 0 1 3.72529e-9 0 0 0 1 1 -5.99114e-8 1.13846e-7 0 4.97611e-8 0.9961947 0.08715574 0.2368225 -1.18635e-7 -0.08715574 0.9961947 3.72529e-9 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm2_L_pose_matrix-output-array" count="32">1 -6.29212e-8 1.19209e-7 0 6.29212e-8 1 0 0.2368225 -1.19209e-7 0 1 3.72529e-9 0 0 0 1 1 -5.99114e-8 1.13846e-7 0 4.97611e-8 0.9961947 0.08715574 0.2368225 -1.18635e-7 -0.08715574 0.9961947 3.72529e-9 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm2_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -701,7 +701,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm3_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm3_L_pose_matrix-output-array" count="32">0.9018104 -0.432132 9.99244e-8 1.49012e-8 0.432132 0.9018103 1.04308e-7 0.2368225 -1.41561e-7 -4.47035e-8 0.9999999 -1.49012e-8 0 0 0 1 1 -4.9761e-8 6.34957e-8 1.49012e-8 4.40376e-8 0.9961946 0.08715574 0.2368225 -6.75911e-8 -0.08715576 0.9961947 -1.49012e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm3_L_pose_matrix-output-array" count="32">1 -6.29212e-8 6.29211e-8 1.49012e-8 6.29212e-8 0.9999999 0 0.2368225 -6.29211e-8 -1.49012e-8 0.9999999 -1.49012e-8 0 0 0 1 1 -4.9761e-8 6.34957e-8 1.49012e-8 4.40376e-8 0.9961946 0.08715574 0.2368225 -6.75911e-8 -0.08715576 0.9961947 -1.49012e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm3_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -733,7 +733,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm4_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm4_L_pose_matrix-output-array" count="32">0.9406103 -0.3394882 -2.46615e-8 0 0.3394883 0.9406103 8.9407e-8 0.2368228 1.49012e-8 -8.9407e-8 1 1.49012e-8 0 0 0 1 1 9.28881e-8 -4.82035e-8 0 -8.91413e-8 0.9848078 0.1736482 0.2368228 6.52151e-8 -0.1736482 0.9848078 1.49012e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm4_L_pose_matrix-output-array" count="32">1 5.68864e-8 -6.13071e-8 0 -6.29211e-8 1 2.98023e-8 0.2368228 6.29211e-8 0 1 1.49012e-8 0 0 0 1 1 9.28881e-8 -4.82035e-8 0 -8.91413e-8 0.9848078 0.1736482 0.2368228 6.52151e-8 -0.1736482 0.9848078 1.49012e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm4_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -765,7 +765,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_UpperHand_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_UpperHand_L_pose_matrix-output-array" count="32">0.9033983 -0.4288025 -1.74397e-7 0 0.4288025 0.9033982 -2.98023e-8 0.2368225 1.78814e-7 2.98023e-8 1 0 0 0 0 1 1 4.21468e-8 -2.34937e-7 0 2.99004e-8 0.9396926 0.3420201 0.2368225 2.33146e-7 -0.3420201 0.9396927 0 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_UpperHand_L_pose_matrix-output-array" count="32">1 -1.08477e-8 -2.40456e-7 0 3.55271e-15 0.9999999 0 0.2368225 2.38419e-7 2.98023e-8 1 0 0 0 0 1 1 4.21468e-8 -2.34937e-7 0 2.99004e-8 0.9396926 0.3420201 0.2368225 2.33146e-7 -0.3420201 0.9396927 0 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_UpperHand_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -797,7 +797,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_LowerHand_L_pose_matrix-output">
|
||||
<float_array id="Armature_002_LowerHand_L_pose_matrix-output-array" count="32">0.8926221 -0.4508057 6.9957e-8 1.49012e-8 0.4508057 0.8926221 2.98023e-8 0.147557 -2.98023e-8 8.9407e-8 1 5.96046e-8 0 0 0 1 1 -1.51808e-8 -1.32815e-9 1.49012e-8 1.51808e-8 0.9848077 0.1736482 0.147557 -1.32815e-9 -0.1736482 0.9848077 5.96046e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_LowerHand_L_pose_matrix-output-array" count="32">1 3.55271e-15 0 1.49012e-8 3.55271e-15 0.9999999 2.98023e-8 0.147557 3.55271e-15 0 1 5.96046e-8 0 0 0 1 1 -1.51808e-8 -1.32815e-9 1.49012e-8 1.51808e-8 0.9848077 0.1736482 0.147557 -1.32815e-9 -0.1736482 0.9848077 5.96046e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_LowerHand_L_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -829,7 +829,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm1_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm1_R_pose_matrix-output-array" count="32">-2.93183e-7 -2.30214e-8 -1 3.93073e-4 -0.08979136 0.9959605 3.39687e-9 -0.2065513 0.9959606 0.08979136 -2.94066e-7 0.170607 0 0 0 1 -2.86828e-7 -0.08715574 -0.9961947 3.93073e-4 4.46726e-8 0.9961947 -0.08715573 -0.2065513 1 -6.95013e-8 -2.81843e-7 0.170607 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm1_R_pose_matrix-output-array" count="32">-2.8213e-7 0 -1 3.93073e-4 6.29212e-8 0.9999999 -2.13163e-14 -0.2065513 1 -6.29212e-8 -2.8213e-7 0.170607 0 0 0 1 -2.86828e-7 -0.08715574 -0.9961947 3.93073e-4 4.46726e-8 0.9961947 -0.08715573 -0.2065513 1 -6.95013e-8 -2.81843e-7 0.170607 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm1_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -861,7 +861,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm2_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm2_R_pose_matrix-output-array" count="32">0.9647611 0.2631273 3.27563e-7 0 -0.2631273 0.9647611 4.47035e-8 0.2368225 -3.05474e-7 -1.3411e-7 1 0 0 0 0 1 1 8.0691e-8 3.51358e-7 0 -4.9761e-8 0.9961947 -0.08715574 0.2368225 -3.57053e-7 0.08715574 0.9961947 0 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm2_R_pose_matrix-output-array" count="32">1 6.29212e-8 3.57628e-7 0 -6.29212e-8 1 0 0.2368225 -3.57628e-7 0 1 0 0 0 0 1 1 8.0691e-8 3.51358e-7 0 -4.9761e-8 0.9961947 -0.08715574 0.2368225 -3.57053e-7 0.08715574 0.9961947 0 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm2_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -893,7 +893,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm3_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm3_R_pose_matrix-output-array" count="32">0.9018104 0.432132 -9.99244e-8 -1.49012e-8 -0.432132 0.9018103 8.9407e-8 0.2368225 1.11759e-7 -5.96046e-8 0.9999999 1.49012e-8 0 0 0 1 1 4.9761e-8 -6.23466e-8 -1.49012e-8 -5.50055e-8 0.9961946 -0.08715574 0.2368225 5.77724e-8 0.08715576 0.9961947 1.49012e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm3_R_pose_matrix-output-array" count="32">1 6.29212e-8 -6.29212e-8 -1.49012e-8 -6.29212e-8 0.9999999 0 0.2368225 6.29212e-8 1.49012e-8 0.9999999 1.49012e-8 0 0 0 1 1 4.9761e-8 -6.23466e-8 -1.49012e-8 -5.50055e-8 0.9961946 -0.08715574 0.2368225 5.77724e-8 0.08715576 0.9961947 1.49012e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm3_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -925,7 +925,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_Arm4_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_Arm4_R_pose_matrix-output-array" count="32">0.9406103 0.3394883 2.87647e-8 -1.49012e-8 -0.3394884 0.9406103 1.49012e-8 0.2368228 7.45058e-9 -7.45058e-8 1 -5.96046e-8 0 0 0 1 1 -7.64089e-8 7.17683e-8 -1.49012e-8 7.60813e-8 0.9961948 -0.0871558 0.2368228 -6.23466e-8 0.08715571 0.9961948 -5.96046e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_Arm4_R_pose_matrix-output-array" count="32">1 -6.9213e-8 6.54104e-8 -1.49012e-8 6.29211e-8 1 -2.98023e-8 0.2368228 -6.29212e-8 -2.98023e-8 1 -5.96046e-8 0 0 0 1 1 -7.64089e-8 7.17683e-8 -1.49012e-8 7.60813e-8 0.9961948 -0.0871558 0.2368228 -6.23466e-8 0.08715571 0.9961948 -5.96046e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_Arm4_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -957,7 +957,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_UpperHand_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_UpperHand_R_pose_matrix-output-array" count="32">0.9033983 0.4288025 -2.9989e-7 -1.49012e-8 -0.4288025 0.9033982 0 0.2368226 2.5332e-7 1.49012e-7 1 2.98023e-8 0 0 0 1 1 -2.65734e-9 -2.34158e-7 -1.49012e-8 -7.61939e-9 0.9961946 -0.0871557 0.2368226 2.38086e-7 0.08715576 0.9961948 2.98023e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_UpperHand_R_pose_matrix-output-array" count="32">1 1.01416e-8 -2.33831e-7 -1.49012e-8 -1.77636e-15 0.9999999 2.98023e-8 0.2368226 2.38419e-7 2.98023e-8 1 2.98023e-8 0 0 0 1 1 -2.65734e-9 -2.34158e-7 -1.49012e-8 -7.61939e-9 0.9961946 -0.0871557 0.2368226 2.38086e-7 0.08715576 0.9961948 2.98023e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_UpperHand_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
@@ -989,7 +989,7 @@
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Armature_002_LowerHand_R_pose_matrix-output">
|
||||
<float_array id="Armature_002_LowerHand_R_pose_matrix-output-array" count="32">0.8926221 0.4508058 -7.07346e-8 0 -0.4508058 0.8926222 -5.96046e-8 0.1475569 4.47035e-8 8.9407e-8 1 2.98023e-8 0 0 0 1 1 1.43558e-8 -1.97223e-9 0 -1.51808e-8 0.9848078 -0.1736482 0.1475569 -1.32816e-9 0.1736482 0.9848077 2.98023e-8 0 0 0 1</float_array>
|
||||
<float_array id="Armature_002_LowerHand_R_pose_matrix-output-array" count="32">1 -7.00673e-10 -7.77575e-10 0 -3.55271e-15 1 -2.98023e-8 0.1475569 -1.77636e-15 2.98023e-8 1 2.98023e-8 0 0 0 1 1 1.43558e-8 -1.97223e-9 0 -1.51808e-8 0.9848078 -0.1736482 0.1475569 -1.32816e-9 0.1736482 0.9848077 2.98023e-8 0 0 0 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Armature_002_LowerHand_R_pose_matrix-output-array" count="2" stride="16">
|
||||
<param name="TRANSFORM" type="float4x4"/>
|
||||
|
||||
Binary file not shown.
@@ -34,6 +34,7 @@
|
||||
#include "CTemplate.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Input/InputSystem.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CPointLight.h"
|
||||
@@ -176,6 +177,9 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::InkBlasterBrick>();
|
||||
m_World->ComponentFactory.Register<Components::KrakenAttackBrick>();
|
||||
|
||||
//m_World->SystemFactory.Register<Systems::InputSystem>(
|
||||
// [this]() { return new Systems::InputSystem(m_World.get(), m_EventBroker); });
|
||||
//m_World->AddSystem<Systems::InputSystem>();
|
||||
m_World->SystemFactory.Register<Systems::LevelSystem>(
|
||||
[this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::LevelSystem>();
|
||||
@@ -257,9 +261,10 @@ public:
|
||||
m_LastTime = currentTime;
|
||||
|
||||
// Update input
|
||||
m_EventBroker->Swap();
|
||||
m_InputManager->Update(dt);
|
||||
// Swap event queues to get fresh input data in the read queue
|
||||
//m_EventBroker->Swap();
|
||||
//m_EventBroker->Process<Systems::InputSystem>();
|
||||
m_EventBroker->Swap();
|
||||
|
||||
//ResourceManager::Update();
|
||||
if (m_GameIsRunning) {
|
||||
@@ -284,6 +289,7 @@ public:
|
||||
m_EventBroker->Process<Engine>();
|
||||
// Swap event queues
|
||||
m_EventBroker->Swap();
|
||||
m_EventBroker->Clear();
|
||||
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ public:
|
||||
int Process();
|
||||
int Process(std::string contextTypeName);
|
||||
void Swap();
|
||||
void Clear();
|
||||
void Unsubscribe(BaseEventRelay &relay);
|
||||
|
||||
private:
|
||||
|
||||
@@ -103,6 +103,7 @@ private:
|
||||
bool OnBrickGenerating(const dd::Events::BrickGenerating &event);
|
||||
bool OnArrivedAtNewStage(const dd::Events::ArrivedAtNewStage &event);
|
||||
void GetBrickSet();
|
||||
void CreateBloodEffect(glm::vec3);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ public:
|
||||
private:
|
||||
bool m_Pause = false;
|
||||
EntityID m_Template;
|
||||
Events::Lifebuoy m_SavedEvent;
|
||||
bool m_Lifebuoy = false;
|
||||
float m_Timer;
|
||||
float m_WaitingTime = 0.4;
|
||||
|
||||
dd::EventRelay<LifebuoySystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<LifebuoySystem, dd::Events::Pause> m_EPause;
|
||||
@@ -58,6 +62,7 @@ private:
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnResume(const dd::Events::Resume &event);
|
||||
bool OnLifebuoy(const dd::Events::Lifebuoy &event);
|
||||
bool Lifebuoy(const dd::Events::Lifebuoy &event);
|
||||
bool OnLifebuoyHit(const dd::Events::LifebuoyHit &event);
|
||||
|
||||
struct LifebuoyInfo
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CCircleShape.h"
|
||||
#include "Physics/ESetImpulse.h"
|
||||
#include "Physics/ECreateParticleSequence.h"
|
||||
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CModel.h"
|
||||
|
||||
@@ -26,6 +26,8 @@ struct ParticleEmitter : public Component
|
||||
//values to interpolate between.
|
||||
std::vector<glm::vec3> ScaleValues;
|
||||
std::vector<float> AlphaValues;
|
||||
std::vector<glm::vec3> VelocityValues;
|
||||
|
||||
|
||||
//System variables
|
||||
float GravityScale = 1.0f;
|
||||
|
||||
@@ -29,6 +29,7 @@ struct CreateParticleSequence : public Event
|
||||
bool DefaultScale = false;
|
||||
std::vector<glm::vec3> ScaleValues;
|
||||
std::vector<float> AlphaValues;
|
||||
std::vector<glm::vec3> VelocityValues;
|
||||
|
||||
//Particle
|
||||
std::string SpriteFile = "";
|
||||
|
||||
@@ -91,8 +91,11 @@ int dd::EventBroker::Process(std::string contextTypeName)
|
||||
void dd::EventBroker::Swap()
|
||||
{
|
||||
std::swap(m_EventQueueRead, m_EventQueueWrite);
|
||||
m_EventQueueWrite->clear();
|
||||
}
|
||||
|
||||
void dd::EventBroker::Clear()
|
||||
{
|
||||
m_EventQueueWrite->clear();
|
||||
}
|
||||
|
||||
void dd::EventBroker::subscribeImmediate(dd::BaseEventRelay& relay)
|
||||
|
||||
@@ -216,8 +216,7 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
glm::vec2 dir = glm::normalize(glm::vec2(transform->Velocity.x, transform->Velocity.y));
|
||||
glm::vec2 up = glm::vec2(0.f, 1.f);
|
||||
|
||||
float angle = atan2(dir.x, dir.y);
|
||||
float angle = glm::acos(glm::dot<float>(dir, up)) * glm::sign(dir.x);
|
||||
transform->Orientation = glm::rotate(glm::quat(), angle, glm::vec3(0.f, 0.f, -1.f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,47 +332,7 @@ bool dd::Systems::KrakenSystem::OnKrakenHit(const dd::Events::KrakenHit &event)
|
||||
m_KrakenCurrentSecondsToAction = m_KrakenMaxSecondsToAction - (modifier * timeDifferenceBetweenMaxAndMin);
|
||||
// If modifier is 1, MaxSeconds is 15, MinSeconds is 5, then... 15 - (1 * 10), meaning 5.
|
||||
|
||||
auto ball = m_World->GetComponent<Components::Transform>(event.Hitter);
|
||||
if (ball != nullptr) {
|
||||
//Particle trail
|
||||
Events::CreateParticleSequence trail;
|
||||
trail.parent = event.Hitter;
|
||||
trail.AlphaValues.push_back(1.f);
|
||||
trail.AlphaValues.push_back(0.f);
|
||||
trail.ScaleValues.push_back(glm::vec3(0.08f));
|
||||
trail.ScaleValues.push_back(glm::vec3(0.f));
|
||||
trail.RadiusDistribution = 2;
|
||||
trail.EmitterLifeTime = 1.f;
|
||||
trail.ParticleLifeTime = 1.f;
|
||||
trail.ParticlesPerTick = 1;
|
||||
trail.SpawnRate = 0.5f;
|
||||
trail.Speed = 10.f;
|
||||
trail.EmittingAngle = glm::half_pi<float>();
|
||||
trail.SpriteFile = "Textures/Particles/FadeBall.png";
|
||||
trail.Color = glm::vec4(1, 0, 0, 1);
|
||||
//p.Spread = ...
|
||||
EventBroker->Publish(trail);
|
||||
}
|
||||
|
||||
//ParticlePoof
|
||||
Events::CreateParticleSequence poof;
|
||||
poof.EmitterLifeTime = 4;
|
||||
poof.EmittingAngle = glm::half_pi<float>();
|
||||
poof.Spread = 0.5f;
|
||||
poof.NumberOfTicks = 1;
|
||||
poof.ParticleLifeTime = 1.5f;
|
||||
poof.ParticlesPerTick = 2;
|
||||
poof.Position = transform->Position;
|
||||
poof.ScaleValues.clear();
|
||||
poof.ScaleValues.push_back(glm::vec3(0.5f));
|
||||
poof.ScaleValues.push_back(glm::vec3(2.f, 2.f, 0.2f));
|
||||
poof.SpriteFile = "Textures/Particles/Cloud_Particle.png";
|
||||
poof.Color = glm::vec4(1, 0, 0, 1);
|
||||
poof.AlphaValues.clear();
|
||||
poof.AlphaValues.push_back(1.f);
|
||||
poof.AlphaValues.push_back(0.f);
|
||||
poof.Speed = 20;
|
||||
EventBroker->Publish(poof);
|
||||
CreateBloodEffect(transform->Position);
|
||||
|
||||
//std::cout << kraken->Health << std::endl;
|
||||
//kraken->Health = -1;
|
||||
@@ -489,4 +449,70 @@ bool dd::Systems::KrakenSystem::OnArrivedAtNewStage(const dd::Events::ArrivedAtN
|
||||
m_KrakenHasArrived = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dd::Systems::KrakenSystem::CreateBloodEffect(glm::vec3 pos)
|
||||
{
|
||||
//ParticlePoof
|
||||
Events::CreateParticleSequence dust;
|
||||
dust.EmitterLifeTime = 4;
|
||||
dust.EmittingAngle = glm::half_pi<float>();
|
||||
dust.Spread = 0.5f;
|
||||
dust.NumberOfTicks = 1;
|
||||
dust.ParticleLifeTime = 1.f;
|
||||
dust.ParticlesPerTick = 1;
|
||||
dust.Position = pos;
|
||||
dust.ScaleValues.clear();
|
||||
dust.ScaleValues.push_back(glm::vec3(0.5f));
|
||||
dust.ScaleValues.push_back(glm::vec3(2.f, 2.f, 0.2f));
|
||||
dust.SpriteFile = "Textures/Particles/Cloud_Particle.png";
|
||||
dust.Color = glm::vec4(1, 0, 0, 1);
|
||||
dust.AlphaValues.clear();
|
||||
dust.AlphaValues.push_back(1.f);
|
||||
dust.AlphaValues.push_back(0.f);
|
||||
dust.Speed = 20;
|
||||
EventBroker->Publish(dust);
|
||||
std::uniform_real_distribution<float> dist(glm::pi<float>(), glm::two_pi<float>());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
float angle = dist(m_RandomGenerator);
|
||||
|
||||
Events::CreateParticleSequence squirt;
|
||||
squirt.EmitterLifeTime = 0.3f;
|
||||
squirt.EmittingAngle = angle;
|
||||
squirt.Spread = 0;
|
||||
squirt.SpawnRate = 0.01f;
|
||||
squirt.ParticleLifeTime = 0.5f;
|
||||
squirt.ParticlesPerTick = 1;
|
||||
squirt.Position = pos;
|
||||
squirt.ScaleValues.clear();
|
||||
squirt.ScaleValues.push_back(glm::vec3(0.09f));
|
||||
squirt.SpriteFile = "Textures/Particles/FadeBall.png";
|
||||
squirt.Color = glm::vec4(1, 0, 0, 1);
|
||||
squirt.AlphaValues.clear();
|
||||
squirt.AlphaValues.push_back(1.f);
|
||||
squirt.AlphaValues.push_back(0.f);
|
||||
squirt.Speed = 1000;
|
||||
EventBroker->Publish(squirt);
|
||||
}
|
||||
Events::CreateParticleSequence drop;
|
||||
drop.EmitterLifeTime = 7.f;
|
||||
drop.SpawnRate = 0.1f;
|
||||
//drop.EmittingAngle = glm::two_pi<float>() + glm::pi<float>();
|
||||
drop.EmittingAngle = -glm::half_pi<float>();
|
||||
drop.Spread = 0;
|
||||
//drop.Spread = glm::two_pi<float>();
|
||||
drop.ParticleLifeTime = 1.f;
|
||||
drop.ParticlesPerTick = 2;
|
||||
drop.Position = pos;
|
||||
drop.ScaleValues.clear();
|
||||
drop.ScaleValues.push_back(glm::vec3(.15f));
|
||||
drop.ScaleValues.push_back(glm::vec3(0.1f));
|
||||
drop.SpriteFile = "Textures/Particles/FadeBall.png";
|
||||
drop.Color = glm::vec4(1, 0, 0, 1);
|
||||
drop.AlphaValues.clear();
|
||||
drop.AlphaValues.push_back(1.f);
|
||||
drop.AlphaValues.push_back(0.f);
|
||||
drop.GravityScale = 0;
|
||||
drop.Speed = 300;
|
||||
EventBroker->Publish(drop);
|
||||
}
|
||||
@@ -792,7 +792,7 @@ void dd::Systems::LevelSystem::GetBrickSet(int set, int setCluster) // These are
|
||||
if (set == 1) {
|
||||
level = // The Butterfly
|
||||
{4, 0, 0, 1, 0, 0, 1,
|
||||
1, 6, 0, 1, 0, 6, 1,
|
||||
1, 6, 0, 1, 0, 1, 1,
|
||||
1, 1, 1, 6, 1, 1, 1,
|
||||
1, 1, 0, 1, 0, 1, 1,
|
||||
1, 0, 0, 1, 0, 0, 1,
|
||||
@@ -841,7 +841,7 @@ void dd::Systems::LevelSystem::GetBrickSet(int set, int setCluster) // These are
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
1, 6, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
1, 3, 1, 1, 1, 1, 5 };
|
||||
1, 3, 1, 1, 1, 1, 1 };
|
||||
color =
|
||||
{m, m, m, m, m, m, m,
|
||||
m, m, m, m, m, m, m,
|
||||
|
||||
@@ -76,6 +76,19 @@ void dd::Systems::LifebuoySystem::Update(double dt)
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsPaused()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Lifebuoy) {
|
||||
m_Timer += dt;
|
||||
if (m_Timer > m_WaitingTime) {
|
||||
m_Timer = 0;
|
||||
m_Lifebuoy = false;
|
||||
Lifebuoy(m_SavedEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::LifebuoySystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
@@ -113,7 +126,14 @@ bool dd::Systems::LifebuoySystem::OnContact(const dd::Events::Contact &event)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LifebuoySystem::OnLifebuoy(const dd::Events::Lifebuoy &event)
|
||||
bool dd::Systems::LifebuoySystem::OnLifebuoy(const dd::Events::Lifebuoy &event)
|
||||
{
|
||||
m_Lifebuoy = true;
|
||||
m_SavedEvent = event;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LifebuoySystem::Lifebuoy(const dd::Events::Lifebuoy &event)
|
||||
{
|
||||
auto ent = m_World->CloneEntity(m_Template);
|
||||
m_World->SetProperty(ent, "Name", "Lifebuoy");
|
||||
@@ -121,7 +141,8 @@ bool dd::Systems::LifebuoySystem::OnLifebuoy(const dd::Events::Lifebuoy &event)
|
||||
auto transform = m_World->GetComponent<Components::Transform>(ent);
|
||||
auto physics = m_World->GetComponent<Components::Physics>(ent);
|
||||
physics->CollisionType = CollisionType::Type::Dynamic;
|
||||
transform->Position = glm::vec3(0.f, 0.f, -10.f);
|
||||
//transform->Position = glm::vec3(0.f, 0.f, -10.f);
|
||||
transform->Position = event.Transform->Position;
|
||||
transform->Velocity = glm::vec3(20.f, 3.f, 0.f);
|
||||
LifebuoyInfo info;
|
||||
info.Entity = ent;
|
||||
|
||||
+36
-19
@@ -38,32 +38,49 @@ void dd::Systems::PadSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &PadSystem::OnStickyPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyAttachedToPad, &PadSystem::OnStickyAttachedToPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &PadSystem::OnActionButton);
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EBindKey, &PadSystem::OnBindKey);
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EBindKey, &PadSystem::OnBindKey);
|
||||
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
m_World->SetProperty(ent, "Name", "Pad");
|
||||
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
ctransform->Position = glm::vec3(0.f, m_PadHeight, -10.f);
|
||||
auto rectangleShape = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
rectangleShape->Dimensions = glm::vec2(1.f, 0.1f);
|
||||
auto physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->CollisionType = CollisionType::Type::Kinematic;
|
||||
physics->Category = CollisionLayer::Type::Pad;
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
m_World->SetProperty(ent, "Name", "Pad");
|
||||
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
ctransform->Position = glm::vec3(0.f, m_PadHeight, -10.f);
|
||||
auto rectangleShape = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
rectangleShape->Dimensions = glm::vec2(1.f, 0.1f);
|
||||
auto physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->CollisionType = CollisionType::Type::Kinematic;
|
||||
physics->Category = CollisionLayer::Type::Pad;
|
||||
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Ball | CollisionLayer::PowerUp | CollisionLayer::LifeBuoy);
|
||||
physics->Calculate = true;
|
||||
auto cModel = m_World->AddComponent<Components::Model>(ent);
|
||||
cModel->ModelFile = "Models/Ship/Ship.obj";
|
||||
physics->Calculate = true;
|
||||
auto cModel = m_World->AddComponent<Components::Model>(ent);
|
||||
cModel->ModelFile = "Models/Ship/Ship.obj";
|
||||
|
||||
auto pad = m_World->AddComponent<Components::Pad>(ent);
|
||||
m_World->CommitEntity(ent);
|
||||
auto pad = m_World->AddComponent<Components::Pad>(ent);
|
||||
pad->SlowdownModifier = 10.f;
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
m_Edge = 3.2 - (ctransform->Scale.x / 2);
|
||||
|
||||
m_Edge = 3.2 - (ctransform->Scale.x / 2);
|
||||
|
||||
m_PadEntity = ent;
|
||||
m_PadTransform = ctransform.get();
|
||||
m_PadComponent = pad.get();
|
||||
}
|
||||
|
||||
Events::CreateParticleSequence e;
|
||||
e.SpriteFile = "Textures/Particles/FadeBall.png";
|
||||
e.Color = glm::vec4(0, 0, 1, 1);
|
||||
e.EmitterLifeTime = 9999999999;
|
||||
e.EmittingAngle = glm::two_pi<float>();
|
||||
e.ParticleLifeTime = 0.5f;
|
||||
e.ParticlesPerTick = 2;
|
||||
e.ScaleValues.push_back(glm::vec3(2));
|
||||
e.AlphaValues.push_back(1.f);
|
||||
e.SpawnRate = 0.1;
|
||||
e.Spread = glm::half_pi<float>();
|
||||
e.Speed = 10;
|
||||
e.parent = m_PadEntity;
|
||||
EventBroker->Publish(e);
|
||||
|
||||
}
|
||||
|
||||
//Stick
|
||||
{
|
||||
|
||||
@@ -222,10 +222,10 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
for (auto i : m_EntitiesToParticleHandle[e]){
|
||||
EntityID entity = i.first;
|
||||
const b2ParticleHandle *particleH = i.second;
|
||||
|
||||
|
||||
b2Vec2 positionB2 = positionBuffer[particleH->GetIndex()];
|
||||
glm::vec2 position = glm::vec2(positionB2.x, positionB2.y);
|
||||
|
||||
|
||||
EntityID entityParent = m_World->GetEntityParent(entity);
|
||||
glm::vec3 parentTransform = glm::vec3(0.f);
|
||||
if(entityParent) {
|
||||
@@ -592,7 +592,7 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt)
|
||||
|
||||
|
||||
//Random z-value
|
||||
std::uniform_real_distribution<float> dist(0, 1);
|
||||
std::uniform_real_distribution<float> dist(0, 0.1);
|
||||
float zDistribution = dist(gen);
|
||||
particleTransform->Position = glm::vec3(emitterTransform->Position.x, emitterTransform->Position.y, -9.5f + zDistribution);
|
||||
particleTransform->Scale = particleTemplate->Scale;
|
||||
@@ -730,6 +730,7 @@ bool dd::Systems::PhysicsSystem::CreateParticleSequence(const Events::CreatePart
|
||||
particleEmitter->RadiusDistribution = event.RadiusDistribution;
|
||||
particleEmitter->DefaultScale = event.DefaultScale;
|
||||
particleEmitter->ScaleValues = event.ScaleValues;
|
||||
particleEmitter->VelocityValues = event.VelocityValues;
|
||||
{
|
||||
//Creating Particle Template
|
||||
auto particle = m_World->CreateEntity(emitter);
|
||||
|
||||
Reference in New Issue
Block a user