summaryrefslogtreecommitdiff
path: root/scene/resources/physics_material.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/physics_material.h')
-rw-r--r--scene/resources/physics_material.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/scene/resources/physics_material.h b/scene/resources/physics_material.h
index a6cb8c288e..dfe48d94cf 100644
--- a/scene/resources/physics_material.h
+++ b/scene/resources/physics_material.h
@@ -39,30 +39,34 @@ class PhysicsMaterial : public Resource {
OBJ_SAVE_TYPE(PhysicsMaterial);
RES_BASE_EXTENSION("PhyMat");
- real_t bounce;
- PhysicsServer::CombineMode bounce_combine_mode;
real_t friction;
- PhysicsServer::CombineMode friction_combine_mode;
+ bool rough;
+ real_t bounce;
+ bool absorbent;
protected:
- bool _set(const StringName &p_name, const Variant &p_value);
- bool _get(const StringName &p_name, Variant &r_ret) const;
- void _get_property_list(List<PropertyInfo> *p_list) const;
-
static void _bind_methods();
public:
+ void set_friction(real_t p_val);
+ _FORCE_INLINE_ real_t get_friction() const { return friction; }
+
+ void set_rough(bool p_val);
+ _FORCE_INLINE_ bool is_rough() const { return rough; }
+
+ _FORCE_INLINE_ real_t computed_friction() const {
+ return rough ? -friction : friction;
+ }
+
void set_bounce(real_t p_val);
_FORCE_INLINE_ real_t get_bounce() const { return bounce; }
- void set_bounce_combine_mode(PhysicsServer::CombineMode p_val);
- _FORCE_INLINE_ PhysicsServer::CombineMode get_bounce_combine_mode() const { return bounce_combine_mode; }
-
- void set_friction(real_t p_val);
- _FORCE_INLINE_ real_t get_friction() const { return friction; }
+ void set_absorbent(bool p_val);
+ _FORCE_INLINE_ bool is_absorbent() const { return absorbent; }
- void set_friction_combine_mode(PhysicsServer::CombineMode p_val);
- _FORCE_INLINE_ PhysicsServer::CombineMode get_friction_combine_mode() const { return friction_combine_mode; }
+ _FORCE_INLINE_ real_t computed_bounce() const {
+ return absorbent ? -bounce : bounce;
+ }
PhysicsMaterial();
};