Changeset 1548 for trunk/games/ToukyDemo/Character.h
 Timestamp:
 Jul 1, 2012, 1:39:19 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/games/ToukyDemo/Character.h
r1547 r1548 217 217 { 218 218 m_body_cos[i].z += 2.0f * seconds; 219 m_body_rotation[i].z = lol::cos(m_body_cos[i].z) * 30.0f; 219 float fPI = M_PI; 220 float Tmp = (abs(fmodf(m_body_cos[i].z, fPI * 2.0f)  fPI) / fPI); 221 Tmp = Tmp * Tmp * (3  2 * Tmp); 222 Tmp = Tmp * 2.0f  1.f; 223 m_body_rotation[i].z = Tmp * 30.0f; 224 //m_body_rotation[i].z = lol::cos(m_body_cos[i].z) * 30.0f; 220 225 break; 221 226 } … … 235 240 } 236 241 } 242 243 for (int i = 0; i < EBP_MAX; ++i) 244 { 245 mat4 WorldMatrix = mat4(1.0f); 246 int CurParent = m_body_parent[i]; 247 248 if (CurParent != i) 249 WorldMatrix = m_body_matrix_world[CurParent]; 250 251 m_body_matrix_world[i] = WorldMatrix * m_body_matrix_local[i] * mat4(quat::fromeuler_xyz(m_body_rotation[i])); 252 } 253 254 m_velocity = vec3(20.f, .0f, .0f); 255 256 m_position += m_rotation.transform(m_velocity) * seconds; 237 257 } 238 258 … … 248 268 } 249 269 250 for (int i = 0; i < EBP_MAX; ++i) 251 { 252 mat4 WorldMatrix = mat4(1.0f); 253 int CurParent = m_body_parent[i]; 254 255 if (CurParent != i) 256 WorldMatrix = m_body_matrix_world[CurParent]; 257 258 m_body_matrix_world[i] = WorldMatrix * m_body_matrix_local[i] * mat4(quat::fromeuler_xyz(m_body_rotation[i])); 259 } 260 261 m_rotation *= quat::rotate(seconds * 30.0f, vec3(0, 1, 0)); 262 mat4 main_matrix = mat4::translate(m_position) * mat4(quat::fromeuler_xyz(vec3(45.0f, .0f, .0f))) * mat4(m_rotation); 270 m_rotation *= quat::rotate(seconds * 30.0f, vec3(0, 1, 0)); 271 mat4 main_matrix = mat4::translate(m_position) * mat4(m_rotation); 263 272 264 273 for (int i = 0; i < EBP_MAX; ++i)
Note: See TracChangeset
for help on using the changeset viewer.