Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gf] make vec*.h use GfSqrt instead of sqrt #2060

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pxr/base/gf/vec.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ class {{ VEC }}
{% if IS_FLOATING_POINT(SCL) %}
/// Length
{{ SCL }} GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ class GfVec2d

/// Length
double GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec2f.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ class GfVec2f

/// Length
float GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec2h.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ class GfVec2h

/// Length
GfHalf GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ class GfVec3d

/// Length
double GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec3f.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ class GfVec3f

/// Length
float GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec3h.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ class GfVec3h

/// Length
GfHalf GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec4d.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ class GfVec4d

/// Length
double GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec4f.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ class GfVec4f

/// Length
float GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down
3 changes: 1 addition & 2 deletions pxr/base/gf/vec4h.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ class GfVec4h

/// Length
GfHalf GetLength() const {
// TODO should use GfSqrt.
return sqrt(GetLengthSq());
return GfSqrt(GetLengthSq());
}

/// Normalizes the vector in place to unit length, returning the
Expand Down