MCPcopy Create free account
hub / github.com/MethanePowered/MethaneKit / Animate

Method Animate

Apps/07-ParallelRendering/ParallelRenderingApp.cpp:371–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371bool ParallelRenderingApp::Animate(double, double delta_seconds)
372{
373 META_FUNCTION_TASK();
374 m_camera.Rotate(m_camera.GetOrientation().up, static_cast<float>(delta_seconds * 360.0 / 16.0));
375
376 const double delta_angle_rad = delta_seconds * std::numbers::pi;
377 tf::Taskflow task_flow;
378 task_flow.for_each(m_cube_array_parameters.begin(), m_cube_array_parameters.end(),
379 [delta_angle_rad](CubeParameters& cube_params)
380 {
381 const hlslpp::float4x4 rotate_matrix = hlslpp::mul(
382 hlslpp::float4x4::rotation_z(static_cast<float>(delta_angle_rad * cube_params.rotation_speed_z)),
383 hlslpp::float4x4::rotation_y(static_cast<float>(delta_angle_rad * cube_params.rotation_speed_y))
384 );
385 cube_params.model_matrix = hlslpp::mul(rotate_matrix, cube_params.model_matrix);
386 });
387
388 GetRenderContext().GetParallelExecutor().run(task_flow).get();
389 return true;
390}
391
392bool ParallelRenderingApp::Resize(const gfx::FrameSize& frame_size, bool is_minimized)
393{

Callers

nothing calls this directly

Calls 3

RotateMethod · 0.80
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected