Setup forward-differencing matrix to be used for speedy curve rendering. It's based on using a specific number of curve segments and just doing incremental adds for each vertex of the segment, rather than running the mathematically expensive cubic equation. @param segments number of curve segments t
(int segments, PMatrix3D matrix)
| 3680 | * @param matrix target object for the new matrix |
| 3681 | */ |
| 3682 | protected void splineForward(int segments, PMatrix3D matrix) { |
| 3683 | float f = 1.0f / segments; |
| 3684 | float ff = f * f; |
| 3685 | float fff = ff * f; |
| 3686 | |
| 3687 | matrix.set(0, 0, 0, 1, |
| 3688 | fff, ff, f, 0, |
| 3689 | 6*fff, 2*ff, 0, 0, |
| 3690 | 6*fff, 0, 0, 0); |
| 3691 | } |
| 3692 | |
| 3693 | |
| 3694 |
no test coverage detected