summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-05-21 22:34:55 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-05-21 22:34:55 -0300
commiteacb8f04c4697b8123afeec03088eebb3c4b20bd (patch)
tree8070f7807ec5d6a375df7184b151abbee8790608 /scene/3d
parenta75f8963380a1f6ae8501f21a1d3f3bef8a89d91 (diff)
parent4c4d79e3c98182faf348f41f98d1cc3e5d843e69 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/vehicle_body.cpp8
-rw-r--r--scene/3d/vehicle_body.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index ba30c118f0..e35ba11e84 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -936,7 +936,7 @@ void VehicleBody::_direct_state_changed(Object *p_state) {
wheel.m_deltaRotation *= real_t(0.99);//damping of rotation when not in contact
}
-
+ linear_velocity = s->get_linear_velocity();
}
void VehicleBody::set_mass(real_t p_mass) {
@@ -990,6 +990,10 @@ float VehicleBody::get_steering() const{
return m_steeringValue;
}
+Vector3 VehicleBody::get_linear_velocity()
+{
+ return linear_velocity;
+}
void VehicleBody::_bind_methods(){
@@ -1008,6 +1012,8 @@ void VehicleBody::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering);
ObjectTypeDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering);
+ ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity);
+
ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed);
ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force"));
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index 285cca142d..b6ad88f15e 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -178,6 +178,7 @@ public:
void set_steering(float p_steering);
float get_steering() const;
+ Vector3 get_linear_velocity();
VehicleBody();
};