Changeset 1378
 Timestamp:
 May 12, 2012, 9:56:02 PM (9 years ago)
 Location:
 trunk/orbital
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/orbital/orbital.cpp
r1376 r1378 187 187 #endif 188 188 189 vec3 new_camera_pos = vec3(0,0,0); 190 for (int i = 0; i < m_players.Count(); i++) 191 new_camera_pos += m_players[i]>m_position; 192 new_camera_pos /= (float)m_players.Count(); 193 new_camera_pos += vec3(0.f, 0.f, 50.f); 194 195 new_camera_pos = m_camera>GetTarget() + (new_camera_pos  m_camera>GetTarget()) * (seconds / (seconds + 0.15f)); 196 m_camera>SetPosition(new_camera_pos + vec3(0.f, 600.f, 0.f)); 197 m_camera>SetTarget(new_camera_pos); 198 189 199 m_model = mat4(1.f); 190 200 } 
trunk/orbital/player.h
r1377 r1378 21 21 vec4(0.1f,0.1f,0.6f,1.0f) }; 22 22 23 //Red Mesh 23 24 if (type == 0) 24 25 { … … 29 30 m_ship_mesh.SendCommand("scb1,1,1,1,ac4,15,.2,.6,1,1,tz2,ac4,15,.2,.6,1,1,rx90,t0,2,7,fl"); 30 31 31 m_exhaust_mesh.SendCommand("sc0,1,1,1,scb0,0,0,1,ac5,15,0,1.5,0,1,ac7,35,1.1,4,0,1,rx90,t3,0,27,mx,fl"); 32 } 32 m_exhaust_mesh.SendCommand("sc0,1,1,1,scb0,0,0,1,ac5,15,0,1.5,0,1,ac7,35,1.1,4,0,1,rx90,t0,0,27,fl"); 33 } 34 //Blue Mesh 33 35 else 34 36 { … … 37 39 m_ship_mesh.SendCommand("afcb3,4,7,.4,t4,0,0,mx,fl,afcb3,6,5,.4,sc1,1,1,1,afcb2,3,9,.4"); 38 40 39 m_exhaust_mesh.SendCommand("sc0,1,1,1,scb0,0,0,1,ac5,10,0,1.5,0,1,ac7,25,1.1,4,0,1,rx90,t0,0, 25");41 m_exhaust_mesh.SendCommand("sc0,1,1,1,scb0,0,0,1,ac5,10,0,1.5,0,1,ac7,25,1.1,4,0,1,rx90,t0,0,19"); 40 42 } 41 43 … … 49 51 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 50 52 m_options.Push(m_position, vec3(0.f, 0.f, 0.f)); 53 54 move_rotation_timer = 0.0f; 51 55 } 52 56 … … 120 124 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 125 122 if (damped_stick.x < 0. 00001f && damped_stick.x > 0.00001f)126 if (damped_stick.x < 0.3f && damped_stick.x > 0.3f) 123 127 m_options[i].m2[2] += seconds * (i & 1 ? 600.f : 600.f); 124 128 else … … 126 130 } 127 131 132 if (damped_stick.x > 0.5f  damped_stick.x < 0.5f) 133 { 134 if (move_rotation_timer > 0.8f) 135 move_rotation.z += damped_stick.x * 220.f * seconds; 136 else 137 move_rotation_timer += seconds; 138 } 139 else 140 { 141 move_rotation_timer = 0.0f; 142 move_rotation.z = move_rotation.z * (seconds / (seconds + 0.2f)); 143 } 144 145 exhaust_rotation.z += 600.0f * seconds; 146 147 if (move_rotation.z > 180.f) 148 move_rotation.z = 360.f; 149 else if (move_rotation.z < 180.f) 150 move_rotation.z += 360.f; 151 152 if (exhaust_rotation.z > 180.f) 153 exhaust_rotation.z = 360.f; 154 else if (exhaust_rotation.z < 180.f) 155 exhaust_rotation.z += 360.f; 156 157 m_rotation = quat::fromeuler_xyz(vec3(((damped_stick.z <= 0.0f)?(damped_stick.z):(0.0f)) * 60.0f, 0.f, damped_stick.x * 50.0f) + move_rotation); 128 158 m_position += vec3(rightleft, 0.f, updown) * 200.f * seconds; 129 159 } … … 142 172 143 173 mat4 model = mat4::translate(m_position) * mat4(m_rotation); 144 m_ship_mesh.Render(model); 145 m_exhaust_mesh.Render(model); 174 175 m_ship_mesh.Render(model); 176 177 if (m_type == 0) 178 { 179 m_exhaust_mesh.Render(model * mat4::translate(vec3(4.f,0.f,0.f)) * mat4::fromeuler_xyz(exhaust_rotation * 1.0f)); 180 m_exhaust_mesh.Render(model * mat4::translate(vec3( 4.f,0.f,0.f)) * mat4::fromeuler_xyz(exhaust_rotation)); 181 } 182 else 183 m_exhaust_mesh.Render(model * mat4::fromeuler_xyz(exhaust_rotation)); 146 184 147 185 for (int i = 0; i < m_options.Count(); i++) … … 162 200 163 201 vec3 damped_stick; 202 vec3 move_rotation; 203 vec3 exhaust_rotation; 204 float move_rotation_timer; 164 205 165 206 bool m_ready;
Note: See TracChangeset
for help on using the changeset viewer.