summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/vehicle_body.cpp18
-rw-r--r--scene/3d/vehicle_body.h5
-rw-r--r--scene/gui/box_container.cpp1
-rw-r--r--scene/gui/color_picker.cpp2
4 files changed, 25 insertions, 1 deletions
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 38e1ba1cd5..8d927e529e 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -214,6 +214,18 @@ float VehicleWheel::get_friction_slip() const {
return m_frictionSlip;
}
+void VehicleWheel::set_roll_influence(float p_value) {
+ m_rollInfluence = p_value;
+}
+
+float VehicleWheel::get_roll_influence() const {
+ return m_rollInfluence;
+}
+
+bool VehicleWheel::is_in_contact() const {
+ return m_raycastInfo.m_isInContact;
+}
+
void VehicleWheel::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_radius", "length"), &VehicleWheel::set_radius);
@@ -246,9 +258,15 @@ void VehicleWheel::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_friction_slip", "length"), &VehicleWheel::set_friction_slip);
ClassDB::bind_method(D_METHOD("get_friction_slip"), &VehicleWheel::get_friction_slip);
+ ClassDB::bind_method(D_METHOD("is_in_contact"), &VehicleWheel::is_in_contact);
+
+ ClassDB::bind_method(D_METHOD("set_roll_influence", "roll_influence"), &VehicleWheel::set_roll_influence);
+ ClassDB::bind_method(D_METHOD("get_roll_influence"), &VehicleWheel::get_roll_influence);
+
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_traction"), "set_use_as_traction", "is_used_as_traction");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_steering"), "set_use_as_steering", "is_used_as_steering");
ADD_GROUP("Wheel", "wheel_");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_roll_influence"), "set_roll_influence", "get_roll_influence");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_radius"), "set_radius", "get_radius");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_rest_length"), "set_suspension_rest_length", "get_suspension_rest_length");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wheel_friction_slip"), "set_friction_slip", "get_friction_slip");
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index cdb2ebc0be..7ed9bce730 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -126,6 +126,11 @@ public:
void set_use_as_steering(bool p_enabled);
bool is_used_as_steering() const;
+ bool is_in_contact() const;
+
+ void set_roll_influence(float p_value);
+ float get_roll_influence() const;
+
VehicleWheel();
};
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index e7f4a274d5..16b2cfa083 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -308,6 +308,7 @@ MarginContainer *VBoxContainer::add_margin_child(const String &p_label, Control
l->set_text(p_label);
add_child(l);
MarginContainer *mc = memnew(MarginContainer);
+ mc->add_constant_override("margin_left", 0);
mc->add_child(p_control);
add_child(mc);
if (p_expand)
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 67d440ca67..662ce63946 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -361,7 +361,7 @@ void ColorPicker::_w_input(const Ref<InputEvent> &ev) {
if (!changing_color)
return;
- float y = CLAMP((float)bev->get_pos().y, 0, 256);
+ float y = CLAMP((float)mev->get_pos().y, 0, 256);
h = 1.0 - y / 256.0;
color.set_hsv(h, s, v, color.a);
last_hsv = color;