Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • W waLBerla
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 41
    • Issues 41
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • waLBerla
  • waLBerla
  • Merge requests
  • !499

Add Vector3::getNormalizedIfNotZero() and correct Vector3::getNormalizedOrZero()

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Christoph Schwarzmeier requested to merge add-vector3-getNormalizedIfNotZero into master Nov 18, 2021
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 13

The name of the function getNormalizedOrZero() in src/core/math/Vector3.h is somewhat misleading. One might naively expect that the returned Vector3 is either normalized or exactly zero. However, if its length is found to be too small, the function actually returns the original Vector3, the components of which must not be exactly zero.

This merge request renames the above function and all its occurrences to getNormalizedIfNotZero(). It additionally adds the function getNormalizedOrZero() that actually returns a zero-Vector3 when the original vector's length is too small.

Edited Nov 18, 2021 by Christoph Schwarzmeier
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: add-vector3-getNormalizedIfNotZero