Changeset 1377
 Timestamp:
 May 12, 2012, 8:12:12 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/orbital/player.h
r1362 r1377 45 45 m_position = vec3(0.f + type * 80.f, 3.5f + 50.f, 0.f); 46 46 47 m_options.Push( vec3(0.f), vec3(20.f, 0.f, 0.f));48 m_options.Push( vec3(0.f), vec3(20.f, 0.f, 0.f));49 m_options.Push( vec3(0.f), vec3(20.f, 0.f, 0.f));50 m_options.Push( vec3(0.f), vec3(20.f, 0.f, 0.f));47 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 48 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 49 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 50 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 51 51 } 52 52 … … 90 90 } 91 91 92 damped_stick.x = damped_stick.x + (seconds / (seconds + 0.18f)) * (rightleft  damped_stick.x); 93 damped_stick.z = damped_stick.z + (seconds / (seconds + 0.18f)) * (updown  damped_stick.z); 94 vec3 applied_stick = vec3(abs(damped_stick.x), 0.0f, damped_stick.z); 95 vec3 offset = vec3(((damped_stick.x < 0.0f)?(abs(damped_stick.x) * 30.f):(0.f)), 0.0f, 0.0f); 96 92 97 for (int i = 0; i < m_options.Count(); i++) 93 98 { 94 vec3 pos[4] = { vec3(11.f, 0.f, 0.f), 95 vec3(11.f, 0.f, 0.f), 96 vec3(21.f, 0.f, 0.f), 97 vec3(21.f, 0.f, 0.f) }; 99 vec3 rot[4] = { 100 vec3(20.f, 0.f, 0.f), 101 vec3(20.f, 0.f, 0.f), 102 vec3(20.f, 0.f, 0.f), 103 vec3(20.f, 0.f, 0.f) }; 104 105 vec3 pos[4] = { 106 vec3(11.f, 0.f, 0.f), 107 vec3(11.f, 0.f, 0.f), 108 vec3(21.f, 0.f, 0.f), 109 vec3(21.f, 0.f, 0.f) }; 110 111 vec3 move_pos[4] = { 112 vec3( 8.f, 0.f, 5.f), 113 vec3(19.f, 0.f, 5.f), 114 vec3( 3.f, 0.f, 5.f), 115 vec3(30.f, 0.f, 5.f) }; 116 98 117 /* FIXME: this is not deltatimed */ 99 m_options[i].m1 = 0.1f * (m_position + pos[i]) 100 + 0.9f * m_options[i].m1; 101 m_options[i].m2[2] += seconds * (i & 1 ? 600.f : 600.f); 118 vec3 target_pos = m_position + pos[i] + (move_pos[i]  pos[i]) * applied_stick + offset; 119 m_options[i].m1 = m_options[i].m1 + (seconds / (seconds + 0.1f)) * (target_pos  m_options[i].m1); 120 m_options[i].m2[0] = rot[i][0] + (((damped_stick.x < 0.0f)?(20.0f):(20.0f))  rot[i][0]) * abs(damped_stick.x); 121 122 if (damped_stick.x < 0.00001f && damped_stick.x > 0.00001f) 123 m_options[i].m2[2] += seconds * (i & 1 ? 600.f : 600.f); 124 else 125 m_options[i].m2[2] += seconds * ((damped_stick.x < 0.0f)?(600.0f):(600.0f)); 102 126 } 103 127 … … 137 161 Array<vec3, vec3> m_options; 138 162 163 vec3 damped_stick; 164 139 165 bool m_ready; 140 166 };
Note: See TracChangeset
for help on using the changeset viewer.