skeletal and morph animation samples

beginning of light animation, easier animation building and triangle winding order
This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent 85fa337163
commit 1d102d091f
29 changed files with 2623 additions and 29876 deletions
+9 -1
View File
@@ -23,7 +23,7 @@ namespace vb01{
float KeyframeChannel::interpolateBezier(vector<float> points, float ratio){
int numPoints = points.size();
vector<float> newPoints;
for(int i = 0; i < numPoints - 1; i++)
for(int i = 0; i < numPoints - 1; i++)
newPoints.push_back(points[i] + (points[i + 1] - points[i]) * ratio);
if(newPoints.size() >= 2)
@@ -79,4 +79,12 @@ for(int i = 0; i < numPoints - 1; i++)
}
return keyframeChannel.keyframes[pastKeyframeId + (last ? 0 : 1)];
}
Keyframe KeyframeChannel::createKeyframe(KeyframeInterpolation interpolation, float frame, float value){
Keyframe keyframe;
keyframe.interpolation = interpolation;
keyframe.frame = frame;
keyframe.value = value;
return keyframe;
}
}