Changeset 1723
 Timestamp:
 Aug 12, 2012, 11:06:22 PM (7 years ago)
 Location:
 trunk/games/demojnat
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/games/demojnat/demojnat.cpp
r1716 r1723 40 40 // set color 41 41 m_mesh.Compile("sc#221 scb#1c1"); 42 m_mesh.AppendFlatChamfBox(vec3(1000, 10, 500), 1.f); 42 m_mesh.OpenBrace(); 43 m_mesh.AppendFlatChamfBox(vec3(500, 50, 100), 1.f); 44 m_mesh.CloseBrace(); 45 m_mesh.OpenBrace(); 46 m_mesh.AppendFlatChamfBox(vec3(500, 50, 100), 1.f); 47 m_mesh.Translate(vec3(300, 100,0)); 48 m_mesh.AppendFlatChamfBox(vec3(100, 200, 100), 1.f); 49 m_mesh.Translate(vec3(900, 100,0)); 50 m_mesh.CloseBrace(); 43 51 44 52 m_player = new Player(); 53 m_player>m_position = vec3(0.f,30.f,30.f); 45 54 Ticker::Ref(m_player); 46 47 /* Center everything  is it needed? */48 //m_mesh.Compile("tx4 tz4");49 55 50 56 m_camera = new Camera(vec3(0.f, 600.f, 0.f), 51 57 vec3(0.f, 0.f, 0.f), 52 58 vec3(0, 1, 0)); 53 m_camera>SetPerspective( 70.f, 960.f, 600.f, .1f, 1000.f);59 m_camera>SetPerspective(20.f, 960.f, 600.f, .1f, 1000.f); 54 60 m_camera>SetTarget(vec3(0.f, 0.f, 0.f)); 55 m_camera>SetPosition(vec3(0.f, 80.f, 100.f));61 m_camera>SetPosition(vec3(0.f, 60.f, 100.f)); 56 62 Ticker::Ref(m_camera); 57 63 … … 74 80 m_angle = 0; 75 81 76 m_camera>SetTarget(m_player>m_position );77 82 m_camera>SetTarget(m_player>m_position + vec3(0.f,100.f,0.f)); 83 m_camera>SetPosition(m_player>m_position + vec3(0.0f, 0.0f, 1000.0f)); 78 84 mat4 anim = mat4::rotate(m_angle, vec3(0, 1, 0)); 79 85 mat4 model = mat4::translate(vec3(0, 0, 0)); 
trunk/games/demojnat/player.h
r1717 r1723 14 14 m_ready(false) 15 15 { 16 m_bodymesh.Compile("sc#f21 scb#1c1"); 17 m_bodymesh.AppendFlatChamfBox(vec3(10, 30, 10), 1.f); 18 m_position = vec3(0.f,10.0f,0.f); 16 m_bodymesh.Compile("[sc#3a0 afcb5 10 5 0.4 ty5]""[sc#a30 afcb8 7 10 0.4]"); 19 17 } 20 18 … … 41 39 { 42 40 rightleft += 1.f * m_stick>GetAxis(0); 43 updown += 1.f * m_stick>GetAxis(1);41 //updown += 1.f * m_stick>GetAxis(1); 44 42 } 45 43 … … 54 52 55 53 //Player control 54 //vec3 deltapos; 56 55 if (rightleft * rightleft + updown * updown > 0.2f){ 57 m_velocity = vec3( rightleft,0,updown);//120.f * m_rotation.transform(vec3(0, 0, 1));58 vec3 deltapos = 50.f* seconds * m_velocity;56 m_velocity = vec3(rightleft,0,0);//120.f * m_rotation.transform(vec3(0, 0, 1)); 57 vec3 deltapos = 200.f* seconds * m_velocity; 59 58 60 59 m_position += deltapos; 61 60 } 61 62 //m_position += deltapos; 62 63 63 64 }
Note: See TracChangeset
for help on using the changeset viewer.