mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Cleanup
This commit is contained in:
@@ -30,7 +30,7 @@ public class INode {
|
||||
private double continuity;
|
||||
|
||||
public INode() {
|
||||
this(new Vector(0,0,0));
|
||||
this(new Vector(0, 0, 0));
|
||||
}
|
||||
|
||||
public INode(INode other) {
|
||||
|
||||
@@ -89,15 +89,15 @@ public class KochanekBartelsInterpolation implements PathInterpolation {
|
||||
* Returns the linear combination of the given coefficients with the nodes adjacent to baseIndex.
|
||||
*
|
||||
* @param baseIndex node index
|
||||
* @param f1 coefficient for baseIndex-1
|
||||
* @param f2 coefficient for baseIndex
|
||||
* @param f3 coefficient for baseIndex+1
|
||||
* @param f4 coefficient for baseIndex+2
|
||||
* @param f1 coefficient for baseIndex-1
|
||||
* @param f2 coefficient for baseIndex
|
||||
* @param f3 coefficient for baseIndex+1
|
||||
* @param f4 coefficient for baseIndex+2
|
||||
* @return linear combination of nodes[n-1..n+2] with f1..4
|
||||
*/
|
||||
private Vector linearCombination(int baseIndex, double f1, double f2, double f3, double f4) {
|
||||
final Vector r1 = retrieve(baseIndex - 1).multiply(f1);
|
||||
final Vector r2 = retrieve(baseIndex ).multiply(f2);
|
||||
final Vector r2 = retrieve(baseIndex).multiply(f2);
|
||||
final Vector r3 = retrieve(baseIndex + 1).multiply(f3);
|
||||
final Vector r4 = retrieve(baseIndex + 2).multiply(f4);
|
||||
|
||||
@@ -108,7 +108,7 @@ public class KochanekBartelsInterpolation implements PathInterpolation {
|
||||
* Retrieves a node. Indexes are clamped to the valid range.
|
||||
*
|
||||
* @param index node index to retrieve
|
||||
* @return nodes[clamp(0, nodes.length-1)]
|
||||
* @return nodes[clamp(0, nodes.length - 1)]
|
||||
*/
|
||||
private Vector retrieve(int index) {
|
||||
if (index < 0) {
|
||||
@@ -204,11 +204,11 @@ public class KochanekBartelsInterpolation implements PathInterpolation {
|
||||
case 1:
|
||||
// This case is merely a speed-up for a very common case
|
||||
return arcLengthRecursive(indexLeft, remainderLeft, 1.0)
|
||||
+ arcLengthRecursive(indexRight, 0.0, remainderRight);
|
||||
+ arcLengthRecursive(indexRight, 0.0, remainderRight);
|
||||
|
||||
default:
|
||||
return arcLengthRecursive(indexLeft, remainderLeft, indexRight - 1, 1.0)
|
||||
+ arcLengthRecursive(indexRight, 0.0, remainderRight);
|
||||
+ arcLengthRecursive(indexRight, 0.0, remainderRight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user