QBezier.vector C# (CSharp) Method

vector() public method

public vector ( float t ) : PathVector,
t float
return PathVector,
    public PathVector vector(float t)
    {
        float tp = 1.0f - t;
        return new PathVector(_x0 * tp * tp + 2.0f * _cx * t * tp + _x1 * t * t,
                                _y0 * tp * tp + 2.0f * _cy * t * tp + _y1 * t * t,
                                _z0 * tp * tp + 2.0f * _cz * t * tp + _z1 * t * t,
                                2.0f * (t * (_x0 + _x1 - 2.0f * _cx) - _x0 + _cx),
                                2.0f * (t * (_y0 + _y1 - 2.0f * _cy) - _y0 + _cy),
                                2.0f * (t * (_z0 + _z1 - 2.0f * _cz) - _z0 + _cz),
                              Quaternion.Lerp(_rot0, _rot1, t)
                              );
    }

Usage Example

Example #1
0
 public PathVector vector(float t)
 {
     return(qBezier.vector(t));
 }