/****************************************************************************
 * Copyright (c) 2026 MAK Technologies, Inc.
 * All rights reserved.
 ****************************************************************************/

#pragma once

#include <diguy_vector_classes.h>

//! \brief This class stores a snapshot of a character's motion engine for storing/replicating character position.
//! Experimental class for helping with multichannel synchronization
struct BDI_DECLSPEC_diguy diguyMotionEngineSnapshot
{

   diguyMotionEngineSnapshot()
      : m_current_action_name( nullptr )
      , m_arc_name( nullptr )
      , m_arc_next_name( nullptr )
      , m_is_transitioning( 0 )
      , m_tstart( 0.0f )
      , m_tin( 0.0f )
      , m_tout( 0.0f )
      , m_progress( 0.0f )
      , m_arc_t( 0.0f )
      , m_blend_state( 0 )
      , m_mid_point( 0.0f )
      , m_aim_axis_0( 0.0f )
      , m_aim_axis_1( 0.0f )
      , m_aim_amount( 0.0f )
      , m_reps( 1 )
   {
   }

   // these aren't owned by the structure make sure swig can't leak or memory thrash these
#ifdef SWIG
   %feature("immutable");
#endif

   //! The name of the action that's currently playing.
   const char* m_current_action_name;

   //! The name of the next action that's currently playing.
   const char* m_desired_action_name;

   //! The name of the underlying motion arc that's currently playing.
   const char* m_arc_name;

   //! The name of the motion arc that's next up in the queue.
   const char* m_arc_next_name;

#ifdef SWIG
   %feature("immutable","");
#endif

   //! The index of the action that's ending.
   int m_action_from_index;

   //! The index of the action that's starting.
   int m_action_to_index;

   //! If the character is actively transitioning between actions.
   int m_is_transitioning;

   //! When the current motion arc started.
   float m_tstart;

   //! When the current motion arc started with padding
   float m_tin;

   //! When the current motion arc will end started with padding
   float m_tout;

   //! Normalized time through the current arc
   float m_progress;

   float m_arc_t;

   //! The blending state of the arc
   int m_blend_state;
   float m_mid_point;

   int m_reps;

   // aim data
   float m_aim_amount;
   float m_aim_axis_0;
   float m_aim_axis_1;
   diguyVec3f m_aim_target;

   // only needed for animation blend tree locomotions animations.
   diguyVec3f m_animation_velocity;
   diguyVec3f m_animation_velocity_target;
   diguyVec3f m_animation_velocity_velocity;

};
