forked from bepu/bepuphysics1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVector3.cs
746 lines (698 loc) · 26.6 KB
/
Vector3.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
using System;
namespace BEPUutilities
{
/// <summary>
/// Provides XNA-like 3D vector math.
/// </summary>
public struct Vector3 : IEquatable<Vector3>
{
/// <summary>
/// X component of the vector.
/// </summary>
public float X;
/// <summary>
/// Y component of the vector.
/// </summary>
public float Y;
/// <summary>
/// Z component of the vector.
/// </summary>
public float Z;
/// <summary>
/// Constructs a new 3d vector.
/// </summary>
/// <param name="x">X component of the vector.</param>
/// <param name="y">Y component of the vector.</param>
/// <param name="z">Z component of the vector.</param>
public Vector3(float x, float y, float z)
{
this.X = x;
this.Y = y;
this.Z = z;
}
/// <summary>
/// Constructs a new 3d vector.
/// </summary>
/// <param name="xy">X and Y components of the vector.</param>
/// <param name="z">Z component of the vector.</param>
public Vector3(Vector2 xy, float z)
{
this.X = xy.X;
this.Y = xy.Y;
this.Z = z;
}
/// <summary>
/// Constructs a new 3d vector.
/// </summary>
/// <param name="x">X component of the vector.</param>
/// <param name="yz">Y and Z components of the vector.</param>
public Vector3(float x, Vector2 yz)
{
this.X = x;
this.Y = yz.X;
this.Z = yz.Y;
}
/// <summary>
/// Computes the squared length of the vector.
/// </summary>
/// <returns>Squared length of the vector.</returns>
public float LengthSquared()
{
return X * X + Y * Y + Z * Z;
}
/// <summary>
/// Computes the length of the vector.
/// </summary>
/// <returns>Length of the vector.</returns>
public float Length()
{
return (float)Math.Sqrt(X * X + Y * Y + Z * Z);
}
/// <summary>
/// Normalizes the vector.
/// </summary>
public void Normalize()
{
float inverse = (float)(1 / Math.Sqrt(X * X + Y * Y + Z * Z));
X *= inverse;
Y *= inverse;
Z *= inverse;
}
/// <summary>
/// Gets a string representation of the vector.
/// </summary>
/// <returns>String representing the vector.</returns>
public override string ToString()
{
return "{" + X + ", " + Y + ", " + Z + "}";
}
/// <summary>
/// Computes the dot product of two vectors.
/// </summary>
/// <param name="a">First vector in the product.</param>
/// <param name="b">Second vector in the product.</param>
/// <returns>Resulting dot product.</returns>
public static float Dot(Vector3 a, Vector3 b)
{
return a.X * b.X + a.Y * b.Y + a.Z * b.Z;
}
/// <summary>
/// Computes the dot product of two vectors.
/// </summary>
/// <param name="a">First vector in the product.</param>
/// <param name="b">Second vector in the product.</param>
/// <param name="product">Resulting dot product.</param>
public static void Dot(ref Vector3 a, ref Vector3 b, out float product)
{
product = a.X * b.X + a.Y * b.Y + a.Z * b.Z;
}
/// <summary>
/// Adds two vectors together.
/// </summary>
/// <param name="a">First vector to add.</param>
/// <param name="b">Second vector to add.</param>
/// <param name="sum">Sum of the two vectors.</param>
public static void Add(ref Vector3 a, ref Vector3 b, out Vector3 sum)
{
sum.X = a.X + b.X;
sum.Y = a.Y + b.Y;
sum.Z = a.Z + b.Z;
}
/// <summary>
/// Subtracts two vectors.
/// </summary>
/// <param name="a">Vector to subtract from.</param>
/// <param name="b">Vector to subtract from the first vector.</param>
/// <param name="difference">Result of the subtraction.</param>
public static void Subtract(ref Vector3 a, ref Vector3 b, out Vector3 difference)
{
difference.X = a.X - b.X;
difference.Y = a.Y - b.Y;
difference.Z = a.Z - b.Z;
}
/// <summary>
/// Scales a vector.
/// </summary>
/// <param name="v">Vector to scale.</param>
/// <param name="scale">Amount to scale.</param>
/// <param name="result">Scaled vector.</param>
public static void Multiply(ref Vector3 v, float scale, out Vector3 result)
{
result.X = v.X * scale;
result.Y = v.Y * scale;
result.Z = v.Z * scale;
}
/// <summary>
/// Multiplies two vectors on a per-component basis.
/// </summary>
/// <param name="a">First vector to multiply.</param>
/// <param name="b">Second vector to multiply.</param>
/// <param name="result">Result of the componentwise multiplication.</param>
public static void Multiply(ref Vector3 a, ref Vector3 b, out Vector3 result)
{
result.X = a.X * b.X;
result.Y = a.Y * b.Y;
result.Z = a.Z * b.Z;
}
/// <summary>
/// Divides a vector's components by some amount.
/// </summary>
/// <param name="v">Vector to divide.</param>
/// <param name="divisor">Value to divide the vector's components.</param>
/// <param name="result">Result of the division.</param>
public static void Divide(ref Vector3 v, float divisor, out Vector3 result)
{
float inverse = 1 / divisor;
result.X = v.X * inverse;
result.Y = v.Y * inverse;
result.Z = v.Z * inverse;
}
/// <summary>
/// Scales a vector.
/// </summary>
/// <param name="v">Vector to scale.</param>
/// <param name="f">Amount to scale.</param>
/// <returns>Scaled vector.</returns>
public static Vector3 operator *(Vector3 v, float f)
{
Vector3 toReturn;
toReturn.X = v.X * f;
toReturn.Y = v.Y * f;
toReturn.Z = v.Z * f;
return toReturn;
}
/// <summary>
/// Scales a vector.
/// </summary>
/// <param name="v">Vector to scale.</param>
/// <param name="f">Amount to scale.</param>
/// <returns>Scaled vector.</returns>
public static Vector3 operator *(float f, Vector3 v)
{
Vector3 toReturn;
toReturn.X = v.X * f;
toReturn.Y = v.Y * f;
toReturn.Z = v.Z * f;
return toReturn;
}
/// <summary>
/// Multiplies two vectors on a per-component basis.
/// </summary>
/// <param name="a">First vector to multiply.</param>
/// <param name="b">Second vector to multiply.</param>
/// <returns>Result of the componentwise multiplication.</returns>
public static Vector3 operator *(Vector3 a, Vector3 b)
{
Vector3 result;
Multiply(ref a, ref b, out result);
return result;
}
/// <summary>
/// Divides a vector's components by some amount.
/// </summary>
/// <param name="v">Vector to divide.</param>
/// <param name="f">Value to divide the vector's components.</param>
/// <returns>Result of the division.</returns>
public static Vector3 operator /(Vector3 v, float f)
{
Vector3 toReturn;
f = 1 / f;
toReturn.X = v.X * f;
toReturn.Y = v.Y * f;
toReturn.Z = v.Z * f;
return toReturn;
}
/// <summary>
/// Subtracts two vectors.
/// </summary>
/// <param name="a">Vector to subtract from.</param>
/// <param name="b">Vector to subtract from the first vector.</param>
/// <returns>Result of the subtraction.</returns>
public static Vector3 operator -(Vector3 a, Vector3 b)
{
Vector3 v;
v.X = a.X - b.X;
v.Y = a.Y - b.Y;
v.Z = a.Z - b.Z;
return v;
}
/// <summary>
/// Adds two vectors together.
/// </summary>
/// <param name="a">First vector to add.</param>
/// <param name="b">Second vector to add.</param>
/// <returns>Sum of the two vectors.</returns>
public static Vector3 operator +(Vector3 a, Vector3 b)
{
Vector3 v;
v.X = a.X + b.X;
v.Y = a.Y + b.Y;
v.Z = a.Z + b.Z;
return v;
}
/// <summary>
/// Negates the vector.
/// </summary>
/// <param name="v">Vector to negate.</param>
/// <returns>Negated vector.</returns>
public static Vector3 operator -(Vector3 v)
{
v.X = -v.X;
v.Y = -v.Y;
v.Z = -v.Z;
return v;
}
/// <summary>
/// Tests two vectors for componentwise equivalence.
/// </summary>
/// <param name="a">First vector to test for equivalence.</param>
/// <param name="b">Second vector to test for equivalence.</param>
/// <returns>Whether the vectors were equivalent.</returns>
public static bool operator ==(Vector3 a, Vector3 b)
{
return a.X == b.X && a.Y == b.Y && a.Z == b.Z;
}
/// <summary>
/// Tests two vectors for componentwise inequivalence.
/// </summary>
/// <param name="a">First vector to test for inequivalence.</param>
/// <param name="b">Second vector to test for inequivalence.</param>
/// <returns>Whether the vectors were inequivalent.</returns>
public static bool operator !=(Vector3 a, Vector3 b)
{
return a.X != b.X || a.Y != b.Y || a.Z != b.Z;
}
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <returns>
/// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
/// </returns>
/// <param name="other">An object to compare with this object.</param>
public bool Equals(Vector3 other)
{
return X == other.X && Y == other.Y && Z == other.Z;
}
/// <summary>
/// Indicates whether this instance and a specified object are equal.
/// </summary>
/// <returns>
/// true if <paramref name="obj"/> and this instance are the same type and represent the same value; otherwise, false.
/// </returns>
/// <param name="obj">Another object to compare to. </param><filterpriority>2</filterpriority>
public override bool Equals(object obj)
{
if (obj is Vector3)
{
return Equals((Vector3)obj);
}
return false;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
/// <filterpriority>2</filterpriority>
public override int GetHashCode()
{
return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode();
}
/// <summary>
/// Computes the squared distance between two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <param name="distanceSquared">Squared distance between the two vectors.</param>
public static void DistanceSquared(ref Vector3 a, ref Vector3 b, out float distanceSquared)
{
float x = a.X - b.X;
float y = a.Y - b.Y;
float z = a.Z - b.Z;
distanceSquared = x * x + y * y + z * z;
}
/// <summary>
/// Computes the squared distance between two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <returns>Squared distance between the two vectors.</returns>
public static float DistanceSquared(Vector3 a, Vector3 b)
{
float x = a.X - b.X;
float y = a.Y - b.Y;
float z = a.Z - b.Z;
return x * x + y * y + z * z;
}
/// <summary>
/// Computes the distance between two two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <param name="distance">Distance between the two vectors.</param>
public static void Distance(ref Vector3 a, ref Vector3 b, out float distance)
{
float x = a.X - b.X;
float y = a.Y - b.Y;
float z = a.Z - b.Z;
distance = (float)Math.Sqrt(x * x + y * y + z * z);
}
/// <summary>
/// Computes the distance between two two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <returns>Distance between the two vectors.</returns>
public static float Distance(Vector3 a, Vector3 b)
{
float toReturn;
Distance(ref a, ref b, out toReturn);
return toReturn;
}
/// <summary>
/// Gets the zero vector.
/// </summary>
public static Vector3 Zero
{
get
{
return new Vector3();
}
}
/// <summary>
/// Gets the up vector (0,1,0).
/// </summary>
public static Vector3 Up
{
get
{
return new Vector3()
{
X = 0,
Y = 1,
Z = 0
};
}
}
/// <summary>
/// Gets the down vector (0,-1,0).
/// </summary>
public static Vector3 Down
{
get
{
return new Vector3()
{
X = 0,
Y = -1,
Z = 0
};
}
}
/// <summary>
/// Gets the right vector (1,0,0).
/// </summary>
public static Vector3 Right
{
get
{
return new Vector3()
{
X = 1,
Y = 0,
Z = 0
};
}
}
/// <summary>
/// Gets the left vector (-1,0,0).
/// </summary>
public static Vector3 Left
{
get
{
return new Vector3()
{
X = -1,
Y = 0,
Z = 0
};
}
}
/// <summary>
/// Gets the forward vector (0,0,-1).
/// </summary>
public static Vector3 Forward
{
get
{
return new Vector3()
{
X = 0,
Y = 0,
Z = -1
};
}
}
/// <summary>
/// Gets the back vector (0,0,1).
/// </summary>
public static Vector3 Backward
{
get
{
return new Vector3()
{
X = 0,
Y = 0,
Z = 1
};
}
}
/// <summary>
/// Gets a vector pointing along the X axis.
/// </summary>
public static Vector3 UnitX
{
get { return new Vector3 { X = 1 }; }
}
/// <summary>
/// Gets a vector pointing along the Y axis.
/// </summary>
public static Vector3 UnitY
{
get { return new Vector3 { Y = 1 }; }
}
/// <summary>
/// Gets a vector pointing along the Z axis.
/// </summary>
public static Vector3 UnitZ
{
get { return new Vector3 { Z = 1 }; }
}
/// <summary>
/// Computes the cross product between two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <returns>Cross product of the two vectors.</returns>
public static Vector3 Cross(Vector3 a, Vector3 b)
{
Vector3 toReturn;
Vector3.Cross(ref a, ref b, out toReturn);
return toReturn;
}
/// <summary>
/// Computes the cross product between two vectors.
/// </summary>
/// <param name="a">First vector.</param>
/// <param name="b">Second vector.</param>
/// <param name="result">Cross product of the two vectors.</param>
public static void Cross(ref Vector3 a, ref Vector3 b, out Vector3 result)
{
float resultX = a.Y * b.Z - a.Z * b.Y;
float resultY = a.Z * b.X - a.X * b.Z;
float resultZ = a.X * b.Y - a.Y * b.X;
result.X = resultX;
result.Y = resultY;
result.Z = resultZ;
}
/// <summary>
/// Normalizes the given vector.
/// </summary>
/// <param name="v">Vector to normalize.</param>
/// <returns>Normalized vector.</returns>
public static Vector3 Normalize(Vector3 v)
{
Vector3 toReturn;
Vector3.Normalize(ref v, out toReturn);
return toReturn;
}
/// <summary>
/// Normalizes the given vector.
/// </summary>
/// <param name="v">Vector to normalize.</param>
/// <param name="result">Normalized vector.</param>
public static void Normalize(ref Vector3 v, out Vector3 result)
{
float inverse = (float)(1 / System.Math.Sqrt(v.X * v.X + v.Y * v.Y + v.Z * v.Z));
result.X = v.X * inverse;
result.Y = v.Y * inverse;
result.Z = v.Z * inverse;
}
/// <summary>
/// Negates a vector.
/// </summary>
/// <param name="v">Vector to negate.</param>
/// <param name="negated">Negated vector.</param>
public static void Negate(ref Vector3 v, out Vector3 negated)
{
negated.X = -v.X;
negated.Y = -v.Y;
negated.Z = -v.Z;
}
/// <summary>
/// Computes the absolute value of the input vector.
/// </summary>
/// <param name="v">Vector to take the absolute value of.</param>
/// <param name="result">Vector with nonnegative elements.</param>
public static void Abs(ref Vector3 v, out Vector3 result)
{
if (v.X < 0)
result.X = -v.X;
else
result.X = v.X;
if (v.Y < 0)
result.Y = -v.Y;
else
result.Y = v.Y;
if (v.Z < 0)
result.Z = -v.Z;
else
result.Z = v.Z;
}
/// <summary>
/// Computes the absolute value of the input vector.
/// </summary>
/// <param name="v">Vector to take the absolute value of.</param>
/// <returns>Vector with nonnegative elements.</returns>
public static Vector3 Abs(Vector3 v)
{
Vector3 result;
Abs(ref v, out result);
return result;
}
/// <summary>
/// Creates a vector from the lesser values in each vector.
/// </summary>
/// <param name="a">First input vector to compare values from.</param>
/// <param name="b">Second input vector to compare values from.</param>
/// <param name="min">Vector containing the lesser values of each vector.</param>
public static void Min(ref Vector3 a, ref Vector3 b, out Vector3 min)
{
min.X = a.X < b.X ? a.X : b.X;
min.Y = a.Y < b.Y ? a.Y : b.Y;
min.Z = a.Z < b.Z ? a.Z : b.Z;
}
/// <summary>
/// Creates a vector from the lesser values in each vector.
/// </summary>
/// <param name="a">First input vector to compare values from.</param>
/// <param name="b">Second input vector to compare values from.</param>
/// <returns>Vector containing the lesser values of each vector.</returns>
public static Vector3 Min(Vector3 a, Vector3 b)
{
Vector3 result;
Min(ref a, ref b, out result);
return result;
}
/// <summary>
/// Creates a vector from the greater values in each vector.
/// </summary>
/// <param name="a">First input vector to compare values from.</param>
/// <param name="b">Second input vector to compare values from.</param>
/// <param name="max">Vector containing the greater values of each vector.</param>
public static void Max(ref Vector3 a, ref Vector3 b, out Vector3 max)
{
max.X = a.X > b.X ? a.X : b.X;
max.Y = a.Y > b.Y ? a.Y : b.Y;
max.Z = a.Z > b.Z ? a.Z : b.Z;
}
/// <summary>
/// Creates a vector from the greater values in each vector.
/// </summary>
/// <param name="a">First input vector to compare values from.</param>
/// <param name="b">Second input vector to compare values from.</param>
/// <returns>Vector containing the greater values of each vector.</returns>
public static Vector3 Max(Vector3 a, Vector3 b)
{
Vector3 result;
Max(ref a, ref b, out result);
return result;
}
/// <summary>
/// Computes an interpolated state between two vectors.
/// </summary>
/// <param name="start">Starting location of the interpolation.</param>
/// <param name="end">Ending location of the interpolation.</param>
/// <param name="interpolationAmount">Amount of the end location to use.</param>
/// <returns>Interpolated intermediate state.</returns>
public static Vector3 Lerp(Vector3 start, Vector3 end, float interpolationAmount)
{
Vector3 toReturn;
Lerp(ref start, ref end, interpolationAmount, out toReturn);
return toReturn;
}
/// <summary>
/// Computes an interpolated state between two vectors.
/// </summary>
/// <param name="start">Starting location of the interpolation.</param>
/// <param name="end">Ending location of the interpolation.</param>
/// <param name="interpolationAmount">Amount of the end location to use.</param>
/// <param name="result">Interpolated intermediate state.</param>
public static void Lerp(ref Vector3 start, ref Vector3 end, float interpolationAmount, out Vector3 result)
{
float startAmount = 1 - interpolationAmount;
result.X = start.X * startAmount + end.X * interpolationAmount;
result.Y = start.Y * startAmount + end.Y * interpolationAmount;
result.Z = start.Z * startAmount + end.Z * interpolationAmount;
}
/// <summary>
/// Computes an intermediate location using hermite interpolation.
/// </summary>
/// <param name="value1">First position.</param>
/// <param name="tangent1">Tangent associated with the first position.</param>
/// <param name="value2">Second position.</param>
/// <param name="tangent2">Tangent associated with the second position.</param>
/// <param name="interpolationAmount">Amount of the second point to use.</param>
/// <param name="result">Interpolated intermediate state.</param>
public static void Hermite(ref Vector3 value1, ref Vector3 tangent1, ref Vector3 value2, ref Vector3 tangent2, float interpolationAmount, out Vector3 result)
{
float weightSquared = interpolationAmount * interpolationAmount;
float weightCubed = interpolationAmount * weightSquared;
float value1Blend = 2 * weightCubed - 3 * weightSquared + 1;
float tangent1Blend = weightCubed - 2 * weightSquared + interpolationAmount;
float value2Blend = -2 * weightCubed + 3 * weightSquared;
float tangent2Blend = weightCubed - weightSquared;
result.X = value1.X * value1Blend + value2.X * value2Blend + tangent1.X * tangent1Blend + tangent2.X * tangent2Blend;
result.Y = value1.Y * value1Blend + value2.Y * value2Blend + tangent1.Y * tangent1Blend + tangent2.Y * tangent2Blend;
result.Z = value1.Z * value1Blend + value2.Z * value2Blend + tangent1.Z * tangent1Blend + tangent2.Z * tangent2Blend;
}
/// <summary>
/// Computes an intermediate location using hermite interpolation.
/// </summary>
/// <param name="value1">First position.</param>
/// <param name="tangent1">Tangent associated with the first position.</param>
/// <param name="value2">Second position.</param>
/// <param name="tangent2">Tangent associated with the second position.</param>
/// <param name="interpolationAmount">Amount of the second point to use.</param>
/// <returns>Interpolated intermediate state.</returns>
public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float interpolationAmount)
{
Vector3 toReturn;
Hermite(ref value1, ref tangent1, ref value2, ref tangent2, interpolationAmount, out toReturn);
return toReturn;
}
}
}