mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -32,13 +32,11 @@
|
||||
#include "servers/physics_server.h"
|
||||
|
||||
Vector<Vector3> SphereShape::get_debug_mesh_lines() {
|
||||
|
||||
float r = get_radius();
|
||||
|
||||
Vector<Vector3> points;
|
||||
|
||||
for (int i = 0; i <= 360; i++) {
|
||||
|
||||
float ra = Math::deg2rad((float)i);
|
||||
float rb = Math::deg2rad((float)i + 1);
|
||||
Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * r;
|
||||
@@ -56,13 +54,11 @@ Vector<Vector3> SphereShape::get_debug_mesh_lines() {
|
||||
}
|
||||
|
||||
void SphereShape::_update_shape() {
|
||||
|
||||
PhysicsServer::get_singleton()->shape_set_data(get_shape(), radius);
|
||||
Shape::_update_shape();
|
||||
}
|
||||
|
||||
void SphereShape::set_radius(float p_radius) {
|
||||
|
||||
radius = p_radius;
|
||||
_update_shape();
|
||||
notify_change_to_owners();
|
||||
@@ -70,12 +66,10 @@ void SphereShape::set_radius(float p_radius) {
|
||||
}
|
||||
|
||||
float SphereShape::get_radius() const {
|
||||
|
||||
return radius;
|
||||
}
|
||||
|
||||
void SphereShape::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_radius", "radius"), &SphereShape::set_radius);
|
||||
ClassDB::bind_method(D_METHOD("get_radius"), &SphereShape::get_radius);
|
||||
|
||||
@@ -84,6 +78,5 @@ void SphereShape::_bind_methods() {
|
||||
|
||||
SphereShape::SphereShape() :
|
||||
Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_SPHERE)) {
|
||||
|
||||
set_radius(1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user