mirror of https://github.com/godotengine/godot
VehicleBody: Cosmetic fixes to previous commit
This commit is contained in:
parent
97da9f14ab
commit
da24bc8f3f
|
|
@ -41505,16 +41505,13 @@ This method controls whether the position between two cached points is interpola
|
||||||
<return type="Vector3">
|
<return type="Vector3">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
Returns the vehicle body speed or velocity in a 3D vector, to get the speed in scalar value
|
Returns the VehicleBody's velocity vector. To get the absolute speed in scalar value, get the length of the return vector in pixels/second. Example:
|
||||||
get the length of the return vector, the scalar value is in Godot units/seconds, if you
|
[codeblock]
|
||||||
assume 1.0 is a meter, then it is in meters/sec
|
# vehicle is an instance of VehicleBody
|
||||||
Example:
|
var speed = vehicle.get_linear_velocity().length()
|
||||||
# vehicle is an instance of VehicleBody, 1.0 asumed as 1 meter:
|
[/codeblock]
|
||||||
var speed_ms = vehicle.get_linear_velocity().length()
|
|
||||||
# Lets convert it to Km/h:
|
|
||||||
var speed_kms = speed_ms * 3.6
|
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
<constants>
|
<constants>
|
||||||
</constants>
|
</constants>
|
||||||
|
|
|
||||||
|
|
@ -992,7 +992,7 @@ float VehicleBody::get_steering() const{
|
||||||
|
|
||||||
Vector3 VehicleBody::get_linear_velocity()
|
Vector3 VehicleBody::get_linear_velocity()
|
||||||
{
|
{
|
||||||
return linear_velocity;
|
return linear_velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VehicleBody::_bind_methods(){
|
void VehicleBody::_bind_methods(){
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ public:
|
||||||
|
|
||||||
void set_steering(float p_steering);
|
void set_steering(float p_steering);
|
||||||
float get_steering() const;
|
float get_steering() const;
|
||||||
|
|
||||||
Vector3 get_linear_velocity();
|
Vector3 get_linear_velocity();
|
||||||
|
|
||||||
VehicleBody();
|
VehicleBody();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue