diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/collision_object_bullet.cpp | 4 | ||||
-rw-r--r-- | modules/bullet/space_bullet.h | 1 | ||||
-rw-r--r-- | modules/mobile_vr/mobile_interface.cpp | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/modules/bullet/collision_object_bullet.cpp b/modules/bullet/collision_object_bullet.cpp index 5739568d91..769e2c943e 100644 --- a/modules/bullet/collision_object_bullet.cpp +++ b/modules/bullet/collision_object_bullet.cpp @@ -93,11 +93,15 @@ void CollisionObjectBullet::setupBulletCollisionObject(btCollisionObject *p_coll void CollisionObjectBullet::add_collision_exception(const CollisionObjectBullet *p_ignoreCollisionObject) { exceptions.insert(p_ignoreCollisionObject->get_self()); bt_collision_object->setIgnoreCollisionCheck(p_ignoreCollisionObject->bt_collision_object, true); + if (space) + space->get_broadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bt_collision_object->getBroadphaseHandle(), space->get_dispatcher()); } void CollisionObjectBullet::remove_collision_exception(const CollisionObjectBullet *p_ignoreCollisionObject) { exceptions.erase(p_ignoreCollisionObject->get_self()); bt_collision_object->setIgnoreCollisionCheck(p_ignoreCollisionObject->bt_collision_object, false); + if (space) + space->get_broadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bt_collision_object->getBroadphaseHandle(), space->get_dispatcher()); } bool CollisionObjectBullet::has_collision_exception(const CollisionObjectBullet *p_otherCollisionObject) const { diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index cbbfdac1d7..b36896650b 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -109,6 +109,7 @@ public: void flush_queries(); void step(real_t p_delta_time); + _FORCE_INLINE_ btBroadphaseInterface *get_broadphase() { return broadphase; } _FORCE_INLINE_ btCollisionDispatcher *get_dispatcher() { return dispatcher; } _FORCE_INLINE_ btSoftBodyWorldInfo *get_soft_body_world_info() { return soft_body_world_info; } _FORCE_INLINE_ bool is_using_soft_world() { return soft_body_world_info; } diff --git a/modules/mobile_vr/mobile_interface.cpp b/modules/mobile_vr/mobile_interface.cpp index eb87bb2cf0..93d5c22ef8 100644 --- a/modules/mobile_vr/mobile_interface.cpp +++ b/modules/mobile_vr/mobile_interface.cpp @@ -122,6 +122,7 @@ void MobileVRInterface::set_position_from_sensors() { Vector3 north(0.0, 0.0, 1.0); // North is Z positive // make copies of our inputs + bool has_grav = false; Vector3 acc = input->get_accelerometer(); Vector3 gyro = input->get_gyroscope(); Vector3 grav = input->get_gravity(); @@ -143,14 +144,17 @@ void MobileVRInterface::set_position_from_sensors() { // what a stable gravity vector is grav = acc; if (grav.length() > 0.1) { - has_gyro = true; + has_grav = true; }; } else { - has_gyro = true; + has_grav = true; }; bool has_magneto = magneto.length() > 0.1; - bool has_grav = grav.length() > 0.1; + if (gyro.length() > 0.1) { + /* this can return to 0.0 if the user doesn't move the phone, so once on, it's on */ + has_gyro = true; + }; #ifdef ANDROID_ENABLED ///@TODO needs testing, i don't have a gyro, potentially can be removed depending on what comes out of issue #8101 |