File indexing completed on 2026-09-26 09:02:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _AIS_WalkDelta_HeaderFile
0015 #define _AIS_WalkDelta_HeaderFile
0016
0017 #include <Standard_Real.hxx>
0018
0019
0020 enum AIS_WalkTranslation
0021 {
0022 AIS_WalkTranslation_Forward = 0,
0023 AIS_WalkTranslation_Side,
0024 AIS_WalkTranslation_Up,
0025 };
0026
0027
0028 enum AIS_WalkRotation
0029 {
0030 AIS_WalkRotation_Yaw = 0,
0031 AIS_WalkRotation_Pitch,
0032 AIS_WalkRotation_Roll,
0033 };
0034
0035
0036 struct AIS_WalkPart
0037 {
0038 double Value;
0039 double Pressure;
0040 double Duration;
0041
0042
0043 bool IsEmpty() const { return std::abs(Value) <= RealSmall(); }
0044
0045
0046 AIS_WalkPart()
0047 : Value(0.0),
0048 Pressure(1.0),
0049 Duration(0.0)
0050 {
0051 }
0052 };
0053
0054
0055 struct AIS_WalkDelta
0056 {
0057
0058 AIS_WalkDelta()
0059 : myIsDefined(false),
0060 myIsJumping(false),
0061 myIsCrouching(false),
0062 myIsRunning(false)
0063 {
0064 }
0065
0066
0067 const AIS_WalkPart& operator[](AIS_WalkTranslation thePart) const
0068 {
0069 return myTranslation[thePart];
0070 }
0071
0072
0073 AIS_WalkPart& operator[](AIS_WalkTranslation thePart) { return myTranslation[thePart]; }
0074
0075
0076 const AIS_WalkPart& operator[](AIS_WalkRotation thePart) const { return myRotation[thePart]; }
0077
0078
0079 AIS_WalkPart& operator[](AIS_WalkRotation thePart) { return myRotation[thePart]; }
0080
0081
0082 bool IsJumping() const { return myIsJumping; }
0083
0084
0085 void SetJumping(bool theIsJumping) { myIsJumping = theIsJumping; }
0086
0087
0088 bool IsCrouching() const { return myIsCrouching; }
0089
0090
0091 void SetCrouching(bool theIsCrouching) { myIsCrouching = theIsCrouching; }
0092
0093
0094 bool IsRunning() const { return myIsRunning; }
0095
0096
0097 void SetRunning(bool theIsRunning) { myIsRunning = theIsRunning; }
0098
0099
0100 bool IsDefined() const { return myIsDefined || !IsEmpty(); }
0101
0102
0103 void SetDefined(bool theIsDefined) { myIsDefined = theIsDefined; }
0104
0105
0106 bool IsEmpty() const { return !ToMove() && !ToRotate(); }
0107
0108
0109 bool ToMove() const
0110 {
0111 return !myTranslation[AIS_WalkTranslation_Forward].IsEmpty()
0112 || !myTranslation[AIS_WalkTranslation_Side].IsEmpty()
0113 || !myTranslation[AIS_WalkTranslation_Up].IsEmpty();
0114 }
0115
0116
0117 bool ToRotate() const
0118 {
0119 return !myRotation[AIS_WalkRotation_Yaw].IsEmpty()
0120 || !myRotation[AIS_WalkRotation_Pitch].IsEmpty()
0121 || !myRotation[AIS_WalkRotation_Roll].IsEmpty();
0122 }
0123
0124 private:
0125 AIS_WalkPart myTranslation[3];
0126 AIS_WalkPart myRotation[3];
0127 bool myIsDefined;
0128 bool myIsJumping;
0129 bool myIsCrouching;
0130 bool myIsRunning;
0131 };
0132
0133 #endif