MCPcopy Create free account
hub / github.com/beefytech/Beef / Evaluate

Method Evaluate

BeefySysLib/util/BSpline.cpp:103–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 point *output)*/
102
103void BSpline2D::Evaluate(float pct, float* x, float* y)
104{
105 if (mUVals == NULL)
106 Calculate();
107
108 int k;
109 float temp;
110
111 int n = (int) mInputPoints.size();
112 int t = (int)mInputPoints.size() - 3; // ????
113 t = 1;
114
115 Point2D* control = &mInputPoints[0];
116
117 // initialize the variables that will hold our outputted point
118
119 float oX = 0;
120 float oY = 0;
121
122 for (k=0; k<=n; k++)
123 {
124 temp = blend(t,t,mUVals,pct); // same blend is used for each dimension coordinate
125 oX = oX + (control[k]).mX * temp;
126 oY = oY + (control[k]).mY * temp;
127 }
128
129 *x = oX;
130 *y = oY;
131}

Callers 1

GetValMethod · 0.45

Calls 2

blendFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected