| 44 | } |
| 45 | |
| 46 | void Streamer::StreamerSegment::TransformVertices(float vel, float expRate) |
| 47 | { |
| 48 | // Apply expansion/contraction. |
| 49 | if (expRate != 0.0f) |
| 50 | { |
| 51 | float distSqr = Vector3::DistanceSquared(Vertices[0], Vertices[1]); |
| 52 | if (expRate < 0.0f && distSqr <= SQUARE(abs(expRate))) |
| 53 | { |
| 54 | auto center = (Vertices[0] + Vertices[1]) / 2; |
| 55 | Vertices[0] = |
| 56 | Vertices[1] = center; |
| 57 | } |
| 58 | else |
| 59 | { |
| 60 | |
| 61 | auto dir = Orientation.ToDirection(); |
| 62 | Vertices[0] = Geometry::TranslatePoint(Vertices[0], -dir, expRate); |
| 63 | Vertices[1] = Geometry::TranslatePoint(Vertices[1], dir, expRate); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // Apply directional velocity. |
| 68 | if (vel != 0.0f) |
| 69 | { |
| 70 | auto dir = Orientation.GetAxis(); |
| 71 | Vertices[0] = Geometry::TranslatePoint(Vertices[0], dir, vel); |
| 72 | Vertices[1] = Geometry::TranslatePoint(Vertices[1], dir, vel); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | Streamer::Streamer(StreamerFeatherMode featherMode, BlendMode blendMode) |
| 77 | { |
nothing calls this directly
no test coverage detected