Panda3D
|
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...
#include "dtoolbase.h"
Go to the source code of this file.
Macros | |
#define | IS_NEARLY_EQUAL(value1, value2) (IS_THRESHOLD_EQUAL(value1, value2, get_nearly_zero_value(value1))) |
#define | IS_NEARLY_ZERO(value) (IS_THRESHOLD_ZERO(value, get_nearly_zero_value(value))) |
#define | IS_THRESHOLD_COMPEQ(value1, value2, threshold) (cfloor(value1 / threshold + 0.5f) == cfloor(value2 / threshold + 0.5f)) |
#define | IS_THRESHOLD_EQUAL(value1, value2, threshold) (IS_THRESHOLD_ZERO((value1) - (value2), threshold)) |
#define | IS_THRESHOLD_ZERO(value, threshold) ((value) < (threshold) && (value) > -(threshold)) |
#define | MAYBE_ZERO(value) (IS_NEARLY_ZERO(value) ? 0 : (value)) |
#define | NEARLY_ZERO(FLOATTYPE) (get_nearly_zero_value((FLOATTYPE)0)) |
Functions | |
constexpr double | get_nearly_zero_value (double) |
constexpr float | get_nearly_zero_value (float) |
constexpr int | get_nearly_zero_value (int) |
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
Definition in file nearly_zero.h.
#define IS_NEARLY_EQUAL | ( | value1, | |
value2 ) (IS_THRESHOLD_EQUAL(value1, value2, get_nearly_zero_value(value1))) |
Definition at line 73 of file nearly_zero.h.
#define IS_NEARLY_ZERO | ( | value | ) | (IS_THRESHOLD_ZERO(value, get_nearly_zero_value(value))) |
Definition at line 68 of file nearly_zero.h.
#define IS_THRESHOLD_COMPEQ | ( | value1, | |
value2, | |||
threshold ) (cfloor(value1 / threshold + 0.5f) == cfloor(value2 / threshold + 0.5f)) |
Definition at line 59 of file nearly_zero.h.
#define IS_THRESHOLD_EQUAL | ( | value1, | |
value2, | |||
threshold ) (IS_THRESHOLD_ZERO((value1) - (value2), threshold)) |
Definition at line 52 of file nearly_zero.h.
#define IS_THRESHOLD_ZERO | ( | value, | |
threshold ) ((value) < (threshold) && (value) > -(threshold)) |
Definition at line 47 of file nearly_zero.h.
#define MAYBE_ZERO | ( | value | ) | (IS_NEARLY_ZERO(value) ? 0 : (value)) |
Definition at line 79 of file nearly_zero.h.
#define NEARLY_ZERO | ( | FLOATTYPE | ) | (get_nearly_zero_value((FLOATTYPE)0)) |
Definition at line 65 of file nearly_zero.h.
|
constexpr |
Definition at line 28 of file nearly_zero.h.
|
constexpr |
Definition at line 33 of file nearly_zero.h.
|
constexpr |
Definition at line 38 of file nearly_zero.h.