summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2020-10-02 09:39:49 +0100
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2020-10-02 10:30:08 +0100
commit5278e07095663b711f8b2c3c64df7d7f28e83599 (patch)
tree8a18c4f1d60f1d50d4c1a39569669f4c52b11c35 /modules
parent19f72beebbf1d233eb2dd345ed70a5ac143e2353 (diff)
Check entire basis column for zero size when unscaling Bullet basis.
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/bullet_types_converter.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/bullet/bullet_types_converter.cpp b/modules/bullet/bullet_types_converter.cpp
index 7ecad9b78a..09b90fe09e 100644
--- a/modules/bullet/bullet_types_converter.cpp
+++ b/modules/bullet/bullet_types_converter.cpp
@@ -101,9 +101,9 @@ void UNSCALE_BT_BASIS(btTransform &scaledBasis) {
btVector3 column2 = basis.getColumn(2);
// Check for zero scaling.
- if (btFuzzyZero(column0[0])) {
- if (btFuzzyZero(column1[1])) {
- if (btFuzzyZero(column2[2])) {
+ if (column0.fuzzyZero()) {
+ if (column1.fuzzyZero()) {
+ if (column2.fuzzyZero()) {
// All dimensions are fuzzy zero. Create a default basis.
column0 = btVector3(1, 0, 0);
column1 = btVector3(0, 1, 0);
@@ -115,7 +115,7 @@ void UNSCALE_BT_BASIS(btTransform &scaledBasis) {
column0 = column1.cross(column2);
}
} else { // Column 1 scale not fuzzy zero.
- if (btFuzzyZero(column2[2])) {
+ if (column2.fuzzyZero()) {
// Create two vectors othogonal to column 1.
// Ensure that a default basis is created if column 1 = <0, 1, 0>
column0 = btVector3(column1[1], -column1[0], 0);
@@ -126,8 +126,8 @@ void UNSCALE_BT_BASIS(btTransform &scaledBasis) {
}
}
} else { // Column 0 scale not fuzzy zero.
- if (btFuzzyZero(column1[1])) {
- if (btFuzzyZero(column2[2])) {
+ if (column1.fuzzyZero()) {
+ if (column2.fuzzyZero()) {
// Create two vectors orthogonal to column 0.
// Ensure that a default basis is created if column 0 = <1, 0, 0>
column2 = btVector3(-column0[2], 0, column0[0]);
@@ -137,7 +137,7 @@ void UNSCALE_BT_BASIS(btTransform &scaledBasis) {
column1 = column2.cross(column0);
}
} else { // Column 0 and column 1 scales not fuzzy zero.
- if (btFuzzyZero(column2[2])) {
+ if (column2.fuzzyZero()) {
// Create column 2 orthogonal to column 0 and column 1.
column2 = column0.cross(column1);
}