[Bf-blender-cvs] [1adaf731a07] collada: Refactor Collada: Added new Class BCKeyPoint
Gaia Clary
noreply at git.blender.org
Thu Apr 19 18:56:30 CEST 2018
Commit: 1adaf731a0715d434e29f96972005fc956ef83a2
Author: Gaia Clary
Date: Thu Apr 19 18:37:06 2018 +0200
Branches: collada
https://developer.blender.org/rB1adaf731a0715d434e29f96972005fc956ef83a2
Refactor Collada: Added new Class BCKeyPoint
===================================================================
M source/blender/collada/BCAnimationCurve.h
===================================================================
diff --git a/source/blender/collada/BCAnimationCurve.h b/source/blender/collada/BCAnimationCurve.h
index 5dc044abbdf..a341230695d 100644
--- a/source/blender/collada/BCAnimationCurve.h
+++ b/source/blender/collada/BCAnimationCurve.h
@@ -93,6 +93,72 @@ public:
};
+class BCKeyPoint {
+private:
+ float inTangent[2];
+ float val;
+ int frame;
+ float outTangent[2];
+ bool hasHandles;
+
+public:
+
+ BCKeyPoint()
+ {
+ val = 0;
+ frame = 0;
+ inTangent[0] = inTangent[1] = 0;
+ outTangent[0] = outTangent[1] = 0;
+ hasHandles = false;
+ }
+
+ BCKeyPoint(const float value, const int frame_index)
+ {
+ frame = frame_index;
+ val = value;
+ hasHandles = false;
+ }
+
+ BCKeyPoint(const BezTriple &bezt)
+ {
+ frame = bezt.vec[1][0];
+ val = bezt.vec[1][1];
+
+ inTangent[0] = bezt.vec[0][0];
+ inTangent[1] = bezt.vec[0][1];
+ outTangent[0] = bezt.vec[2][0];
+ outTangent[1] = bezt.vec[2][1];
+ hasHandles = true;
+ }
+
+ const float(&get_in_tangent() const)[2]
+ {
+ return inTangent;
+ }
+
+ const float(&get_out_tangent()const )[2]
+ {
+ return outTangent;
+ }
+
+ const float get_value() const
+ {
+ return val;
+ }
+
+ const float get_frame() const
+ {
+ return frame;
+ }
+
+ const bool has_handles() const
+ {
+ return hasHandles;
+ }
+
+};
+
+
class BCAnimationCurve {
private:
BCCurveKey curve_key;
More information about the Bf-blender-cvs
mailing list