Beispiel #1
0
        //============================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        public PoseData(PoseData a_pose)
        {
            PoseId        = a_pose.PoseId;
            AnimId        = a_pose.AnimId;
            TracksId      = a_pose.TracksId;
            PrimaryClipId = a_pose.PrimaryClipId;
            Time          = a_pose.Time;
            LocalVelocity = a_pose.LocalVelocity;
            NextPoseId    = a_pose.NextPoseId;
            LastPoseId    = a_pose.LastPoseId;

            Favour = a_pose.Favour;

            JointsData = new JointData[a_pose.JointsData.Length];
            for (int i = 0; i < a_pose.JointsData.Length; ++i)
            {
                JointsData[i] = a_pose.JointsData[i];
            }

            Trajectory = new TrajectoryPoint[a_pose.Trajectory.Length];
            for (int i = 0; i < Trajectory.Length; ++i)
            {
                Trajectory[i] = a_pose.Trajectory[i];
            }

            Tags        = a_pose.Tags;
            FavourTags  = a_pose.FavourTags;
            GenericTags = a_pose.GenericTags;
            UserTags    = a_pose.UserTags;
            AnimType    = a_pose.AnimType;
        }
Beispiel #2
0
        public EMxMAnimtype AnimType;    //Composite, IdleSet or BlendSpace

        //============================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        public PoseData(int a_poseId, int a_clipId, int a_tracksId, float a_time, Vector3 a_localVelocity,
                        int a_jointCount, int a_trajCount, float a_favour, ETags a_tags = ETags.None,
                        ETags a_favourTags   = ETags.None, EGenericTags a_genericTags  = EGenericTags.None,
                        EUserTags a_userTags = EUserTags.None, EMxMAnimtype a_animType = EMxMAnimtype.Composite)

        {
            PoseId        = a_poseId;
            AnimId        = a_clipId;
            TracksId      = a_tracksId;
            PrimaryClipId = a_clipId;
            Time          = a_time;
            LocalVelocity = a_localVelocity;

            Favour = a_favour;

            JointsData = new JointData[a_jointCount];
            Trajectory = new TrajectoryPoint[a_trajCount];

            NextPoseId = -1;
            LastPoseId = -1;

            Tags        = a_tags;
            FavourTags  = a_favourTags;
            GenericTags = a_genericTags;
            UserTags    = a_userTags;
            AnimType    = a_animType;
        }
        //===========================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        public static void SetData(MxMAnimationIdleSet a_data)
        {
            if (a_data == null)
            {
                return;
            }

            m_idleSetData = a_data;
            MxMAnimationIdleSetWindow.SetData(m_idleSetData);
            m_nextAnimType = EMxMAnimtype.IdleSet;
        }
        //===========================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        public static void SetData(MxMAnimationClipComposite a_data)
        {
            if (a_data == null)
            {
                return;
            }

            m_compositeData = a_data;
            MxMAnimationClipCompositeWindow.SetData(m_compositeData);
            m_nextAnimType = EMxMAnimtype.Composite;
        }
        //===========================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        public static void SetData(MxMBlendSpace a_data)
        {
            if (a_data == null)
            {
                return;
            }

            m_blendSpaceData = a_data;
            MxMBlendSpaceWindow.SetData(m_blendSpaceData);
            m_nextAnimType = EMxMAnimtype.BlendSpace;
        }
Beispiel #6
0
 //============================================================================================
 /**
 *  @brief Sets the status of the Playable State to chosen with the passed pose data
 *  
 *  @param [ref PoseData] a_pose - the pose to set as chosen
 *         
 *********************************************************************************************/
 public void SetAsChosenWithPose(ref PoseData a_pose)
 {
     Weight = 0f; //This may be wrong, start blend weight of 0?
     HighestWeight = 0f;
     AnimType = a_pose.AnimType;
     AnimId = a_pose.AnimId;
     StartPoseId = a_pose.PoseId;
     StartTime = a_pose.Time;
     Age = 0f;
     DecayAge = 0f;
     BlendStatus = EBlendStatus.Chosen;
 }
        //===========================================================================================

        /**
         *  @brief
         *
         *********************************************************************************************/
        private void OnGUI()
        {
            if (Event.current.type != EventType.Repaint)
            {
                if (m_nextAnimType != m_curAnimType)
                {
                    m_curAnimType = m_nextAnimType;
                }
            }

            switch (m_curAnimType)
            {
            case EMxMAnimtype.Composite:
            {
                if (m_compositeWindow != null)
                {
                    m_compositeWindow.OnGUI(position);
                }
                else
                {
                    DrawNoAnimMessage();
                }
            }
            break;

            case EMxMAnimtype.IdleSet:
            {
                if (m_idleSetWindow != null)
                {
                    m_idleSetWindow.OnGUI(position);
                }
                else
                {
                    DrawNoAnimMessage();
                }
            }
            break;

            case EMxMAnimtype.BlendSpace:
            {
                if (m_blendSpaceWindow != null)
                {
                    m_blendSpaceWindow.OnGUI(position);
                }
                else
                {
                    DrawNoAnimMessage();
                }
            }
            break;
            }
        }
Beispiel #8
0
        //============================================================================================
        /**
        *  @brief Constructorfor the Playable state
        *  
        *  @param [int] a_inputIndex - the input index that this playable is connected to 
        *  @param [ref AnimationMixerPlayable] a_mixerPlayer - the animation mixer that this playable state is connected to
        *         
        *********************************************************************************************/
        public MxMPlayableState(int a_inputIndex, ref AnimationMixerPlayable a_mixerPlayable)
        {
            TargetPlayable = new Playable();
            ParentMixer = a_mixerPlayable;
            InputIndex = a_inputIndex;
            Weight = 0f;
            HighestWeight = 0f;
            AnimType = EMxMAnimtype.Clip;
            AnimId = -1;
            AnimDataId = 0;

            StartPoseId = -1;
            StartTime = 0f;
            Age = 0f;
            DecayAge = 0f;
            BlendStatus = EBlendStatus.None;
        }