Skip to content

Commit

Permalink
Add Ray3.Normalized
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed Nov 13, 2024
1 parent f311882 commit 3f701f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- Updated System.Text.Json dependency (CVE-2024-43485)
- Added angle conversion utilities for ranges
- Added Ray3.Transformed overloads
- Added Ray3.Normalized

### 5.3.5
- [Base] added IsEmpty/IsEmptyOrNull overloads for Array/ICollection with efficient implementation
Expand Down
10 changes: 10 additions & 0 deletions src/Aardvark.Base/Geometry/Types/Ray/Ray3_auto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public Ray3f(V3f origin, V3f direction)
/// </summary>
public readonly Ray3f Reversed => new Ray3f(Origin, -Direction);

/// <summary>
/// Returns the ray with its directional normalized.
/// </summary>
public readonly Ray3f Normalized => new(Origin, Direction.Normalized);

#endregion

#region Ray Arithmetics
Expand Down Expand Up @@ -1833,6 +1838,11 @@ public Ray3d(V3d origin, V3d direction)
/// </summary>
public readonly Ray3d Reversed => new Ray3d(Origin, -Direction);

/// <summary>
/// Returns the ray with its directional normalized.
/// </summary>
public readonly Ray3d Normalized => new(Origin, Direction.Normalized);

#endregion

#region Ray Arithmetics
Expand Down
5 changes: 5 additions & 0 deletions src/Aardvark.Base/Geometry/Types/Ray/Ray3_template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public __ray3t__(__v3t__ origin, __v3t__ direction)
/// </summary>
public readonly __ray3t__ Reversed => new __ray3t__(Origin, -Direction);

/// <summary>
/// Returns the ray with its directional normalized.
/// </summary>
public readonly __ray3t__ Normalized => new(Origin, Direction.Normalized);

#endregion

#region Ray Arithmetics
Expand Down

0 comments on commit 3f701f3

Please sign in to comment.