Changeset 1353
- Timestamp:
- May 9, 2012, 1:35:04 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/orbital/orbital.cpp
r1351 r1353 31 31 for (int i = 0; i < 20; i++) 32 32 { 33 m.SendCommand(((i + j) % 2) ? "sc. 2,.6,.7,1,scb.2,.6,.7,1"34 : "sc. 2,.2,.6,1,scb.2,.2,.6,1");33 m.SendCommand(((i + j) % 2) ? "sc.0,.1,.2,1,scb.0,.1,.2,1" 34 : "sc.0,.0,.1,1,scb.0,.0,.1,1"); 35 35 m.SendCommand("ac4,2,44,40,0,0,ty-1,ad4,40,0,ry45"); 36 36 m.Scale(vec3(std::sqrt(0.5f))); … … 58 58 /* Orange/white alien */ 59 59 m.SendCommand("sc1,0.7,0,1,afcb12,3,10,0.4,tz3,sc1,1,1,1,afcb2,10,10,0.4"); 60 m.SendCommand("rx20,ry30,t0,40,-20,fl"); 60 m.SendCommand("t0,40,-20,fl"); 61 //m.SendCommand("rx20,ry30,t0,40,-20,fl"); 61 62 62 63 /* Orange fire */ … … 71 72 72 73 /* Create a camera that matches the settings of XNA Orbital */ 73 m_camera = new Camera(vec3(0 , 50, 0),74 vec3(0 , 0, 0),74 m_camera = new Camera(vec3(0.f, 600.f, 50.f), 75 vec3(0.f, 0.f, 50.f), 75 76 vec3(0, 0, -1)); 77 m_camera->SetRotation(quat::fromeuler_yxz(0.f, -30.f, 0.f)); 76 78 m_camera->SetOrtho(1280.f / 3, 960.f / 3, -1000.f, 1000.f); 77 79 Ticker::Ref(m_camera); 78 80 79 81 /* Add tanks */ 80 for (int j = 0; j < 10; j++)81 for (int i = 0; i < 10; i++)82 for (int j = 0; j < 5; j++) 83 for (int i = 0; i < 5; i++) 82 84 { 83 85 m_tanks << new Tank(); 84 m_tanks.Last()->m_position = vec3(i * 40.f - 250.f, 0, j * 40.f - 100.f);85 m_tanks.Last()->SetTarget(vec3(i * 80.f - 200.f, 0, j * 80.f - 130.f));86 m_tanks.Last()->m_position = vec3(i * 80.f - 250.f, 0, j * 80.f - 100.f); 87 m_tanks.Last()->SetTarget(vec3(i * 160.f - 200.f, 0, j * 160.f - 130.f)); 86 88 Ticker::Ref(m_tanks.Last()); 87 89 } -
trunk/orbital/player.h
r1348 r1353 30 30 m_drone_mesh.SendCommand("sc0.2,0.7,0,1,afcb3,6,10,0.4,tx-8,afcb3,6,10,0.4,tx4,ty13,fl,sc1,1,1,1,afcb3,6,10,0.4,rx-30,ty13,fl"); 31 31 32 m_position = vec3(0.f, 3.5f , 0.f);32 m_position = vec3(0.f, 3.5f + 50.f, 0.f); 33 33 } 34 34 -
trunk/src/camera.cpp
r1350 r1353 44 44 { 45 45 m_position = pos; 46 } 47 48 void Camera::SetRotation(quat const &rot) 49 { 50 m_rotation = rot; 46 51 } 47 52 … … 94 99 m_target += vec3(rightleft, 0, -updown) * 200.f * seconds; 95 100 96 m_view_matrix = mat4::lookat(m_position, m_target, m_up); 101 m_view_matrix = mat4::lookat(m_position, m_target, m_up) 102 * mat4(m_rotation); 97 103 } 98 104 -
trunk/src/camera.h
r1350 r1353 31 31 32 32 void SetPosition(vec3 const &pos); 33 void SetRotation(quat const &rot); 33 34 void SetOrtho(float width, float height, float near, float far); 34 35 void SetPerspective(float fov, float width, float height,
Note: See TracChangeset
for help on using the changeset viewer.