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

Add copysign operation and unit tests for it #371

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

atlv24
Copy link
Contributor

@atlv24 atlv24 commented Dec 28, 2022

Just mirror's Rust's existing f32/f64::copysign functionality but vectorized component-wise.

It turns out that this operation is exactly whats needed when computing the support point of a box given its extents and a direction. Example usage from a physics engine I'm working on that prompted me to make this PR:

fn support_point(&self, dir: Vec3A) -> Vec3A {
    self.extents.copysign(dir)
}

@bitshifter bitshifter merged commit 3b65de3 into bitshifter:main Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants