Got the animator completed tested and working
This commit is contained in:
@@ -238,7 +238,6 @@ V3D<uint32_t> Animator<BOARD_DIMS>::noFillInterpolate(const AnimationFrame &keyF
|
||||
|
||||
template <const V3D<uint32_t> &BOARD_DIMS>
|
||||
V3D<uint32_t> Animator<BOARD_DIMS>::closestColorInterpolate(const AnimationFrame &keyFrame, V3D<uint32_t> cubePosition){
|
||||
Serial.print("X:" + String(cubePosition.x) + ",Y:" + String(cubePosition.y) + ",Z:" + String(cubePosition.z));
|
||||
V3D<uint32_t> returnColor{keyFrame.frame[0].color};
|
||||
V3D<uint32_t> distance{keyFrame.frame[0].position};
|
||||
distance -= cubePosition;
|
||||
|
||||
@@ -30,8 +30,8 @@ namespace TestFrames{
|
||||
AnimationFrame noFillFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::NO_FILL,
|
||||
.frameInterpolation = FrameInterpolation::SNAP,
|
||||
@@ -41,8 +41,8 @@ namespace TestFrames{
|
||||
AnimationFrame closestColorFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
||||
.frameInterpolation = FrameInterpolation::SNAP,
|
||||
@@ -52,8 +52,8 @@ namespace TestFrames{
|
||||
AnimationFrame linearFillFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
||||
.frameInterpolation = FrameInterpolation::SNAP,
|
||||
@@ -63,8 +63,8 @@ namespace TestFrames{
|
||||
AnimationFrame squareFillFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
||||
.frameInterpolation = FrameInterpolation::SNAP,
|
||||
@@ -74,8 +74,8 @@ namespace TestFrames{
|
||||
AnimationFrame noFillFadeFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::NO_FILL,
|
||||
.frameInterpolation = FrameInterpolation::FADE,
|
||||
@@ -85,8 +85,8 @@ namespace TestFrames{
|
||||
AnimationFrame closestColorFadeFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
||||
.frameInterpolation = FrameInterpolation::FADE,
|
||||
@@ -96,8 +96,8 @@ namespace TestFrames{
|
||||
AnimationFrame linearFillFadeFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
||||
.frameInterpolation = FrameInterpolation::FADE,
|
||||
@@ -107,8 +107,8 @@ namespace TestFrames{
|
||||
AnimationFrame squareFillFadeFrame{
|
||||
.frame = {
|
||||
CreateCell(0,0,0,red),
|
||||
// CreateCell(0.5,0.5,0,green),
|
||||
CreateCell(1,1,0,blue)
|
||||
CreateCell(0.5,0.5,0.5,green),
|
||||
CreateCell(1,1,1,blue)
|
||||
},
|
||||
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
||||
.frameInterpolation = FrameInterpolation::FADE,
|
||||
@@ -123,7 +123,8 @@ namespace TestFrames{
|
||||
noFillFadeFrame, // 4
|
||||
closestColorFadeFrame, // 5
|
||||
linearFillFadeFrame, // 6
|
||||
squareFillFadeFrame // 7
|
||||
squareFillFadeFrame, // 7
|
||||
noFillFrame // 8
|
||||
};
|
||||
|
||||
AnimationFrame testFrame1{
|
||||
|
||||
@@ -197,7 +197,7 @@ void setup() {
|
||||
Serial.println("Beginning Board Initializaiton");
|
||||
boardManager.Init();
|
||||
animator.SetLoop(true);
|
||||
animator.StartAnimation(&(TestFrames::testAnimationSequence1));
|
||||
animator.StartAnimation(&(TestFrames::testAnimationSequence2));
|
||||
xTaskCreate(UpdateBoard, "UpdateBoard", 10000, NULL, 0, &updateBoardTask);
|
||||
|
||||
Serial.println("Setup Complete");
|
||||
|
||||
Reference in New Issue
Block a user