SSplineNode.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionMath.h>
6 
7 
8 namespace ion
9 {
10  namespace Animation
11  {
12 
14  {
16  vec3f Normal = vec3f(0, 1, 0);
17  vec3f Tangent = vec3f(1, 0, 0);
18 
20  {
22  copy.Position = Position + v.Position;
23  copy.Normal = Normal + v.Normal;
24  copy.Tangent = Tangent + v.Tangent;
25 
26  return copy;
27  }
28 
30  {
32  copy.Position = Position - v.Position;
33  copy.Normal = Normal - v.Normal;
34  copy.Tangent = Tangent - v.Tangent;
35 
36  return copy;
37  }
38 
39  S3DSplineNode operator * (float const & s) const
40  {
42  copy.Position = Position * s;
43  copy.Normal = Normal * s;
44  copy.Tangent = Tangent * s;
45 
46  return copy;
47  }
48 
49  S3DSplineNode operator / (float const & s) const
50  {
52  copy.Position = Position / s;
53  copy.Normal = Normal / s;
54  copy.Tangent = Tangent / s;
55 
56  return copy;
57  }
58 
59  S3DSplineNode operator + (vec3f const & v) const
60  {
61  S3DSplineNode copy = *this;
62  copy.Position = Position + v;
63 
64  return copy;
65  }
66 
67  S3DSplineNode operator - (vec3f const & v) const
68  {
69  S3DSplineNode copy = *this;
70  copy.Position = Position - v;
71 
72  return copy;
73  }
74 
75  float GetLength() const
76  {
77  return Position.Length();
78  }
79 
80  };
81 
82  }
83 }
vec3f Normal
Definition: SSplineNode.h:16
vec3f Position
Definition: SSplineNode.h:15
vec3< f32 > vec3f
Definition: SVector3.h:634
vec3f Tangent
Definition: SSplineNode.h:17
S3DSplineNode operator/(float const &s) const
Definition: SSplineNode.h:49
Definition: SSplineNode.h:13
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
The MIT free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to copy
Definition: LICENSE.txt:7
T Length() const
Length of vector.
Definition: SVector3.h:147
S3DSplineNode operator-(S3DSplineNode const &v) const
Definition: SSplineNode.h:29
S3DSplineNode operator+(S3DSplineNode const &v) const
Definition: SSplineNode.h:19
S3DSplineNode operator*(float const &s) const
Definition: SSplineNode.h:39
float GetLength() const
Definition: SSplineNode.h:75