summaryrefslogtreecommitdiff
path: root/modules/bullet/rigid_body_bullet.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-07-23 07:37:03 -0300
committerGitHub <noreply@github.com>2018-07-23 07:37:03 -0300
commit1ad20dc2f13001d95e91cb2089571028f44db11a (patch)
tree86e45829815fd357454012b19c291887c67caa1a /modules/bullet/rigid_body_bullet.cpp
parent172f652dc0c31a9a70ad24e233e6d7abc3ee9c6d (diff)
parent5f66734d2d70951b273a078a3ee20e406cf0f84d (diff)
Merge pull request #12403 from AndreaCatania/phymat
Physics material
Diffstat (limited to 'modules/bullet/rigid_body_bullet.cpp')
-rw-r--r--modules/bullet/rigid_body_bullet.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 2fc96a77b5..19fad283af 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -257,6 +257,8 @@ RigidBodyBullet::RigidBodyBullet() :
angularDamp(0),
can_sleep(true),
omit_forces_integration(false),
+ restitution_combine_mode(PhysicsServer::COMBINE_MODE_INHERIT),
+ friction_combine_mode(PhysicsServer::COMBINE_MODE_INHERIT),
force_integration_callback(NULL),
isTransformChanged(false),
previousActiveState(true),
@@ -750,6 +752,22 @@ Vector3 RigidBodyBullet::get_angular_velocity() const {
return gVec;
}
+void RigidBodyBullet::set_combine_mode(const PhysicsServer::BodyParameter p_param, const PhysicsServer::CombineMode p_mode) {
+ if (p_param == PhysicsServer::BODY_PARAM_BOUNCE) {
+ restitution_combine_mode = p_mode;
+ } else {
+ friction_combine_mode = p_mode;
+ }
+}
+
+PhysicsServer::CombineMode RigidBodyBullet::get_combine_mode(PhysicsServer::BodyParameter p_param) const {
+ if (p_param == PhysicsServer::BODY_PARAM_BOUNCE) {
+ return restitution_combine_mode;
+ } else {
+ return friction_combine_mode;
+ }
+}
+
void RigidBodyBullet::set_transform__bullet(const btTransform &p_global_transform) {
if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
// The kinematic use MotionState class