mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
skeletal and morph animation samples
beginning of light animation, easier animation building and triangle winding order
This commit is contained in:
+9
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user