1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Bring that Whole New World to the Old Continent too

Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -29,34 +29,31 @@
#include "box_shape.h"
#include "servers/physics_server.h"
Vector<Vector3> BoxShape::_gen_debug_mesh_lines() {
Vector<Vector3> lines;
AABB aabb;
aabb.pos=-get_extents();
aabb.size=aabb.pos*-2;
aabb.pos = -get_extents();
aabb.size = aabb.pos * -2;
for(int i=0;i<12;i++) {
Vector3 a,b;
aabb.get_edge(i,a,b);
for (int i = 0; i < 12; i++) {
Vector3 a, b;
aabb.get_edge(i, a, b);
lines.push_back(a);
lines.push_back(b);
}
return lines;
}
void BoxShape::_update_shape() {
PhysicsServer::get_singleton()->shape_set_data(get_shape(),extents);
PhysicsServer::get_singleton()->shape_set_data(get_shape(), extents);
}
void BoxShape::set_extents(const Vector3& p_extents) {
void BoxShape::set_extents(const Vector3 &p_extents) {
extents=p_extents;
extents = p_extents;
_update_shape();
notify_change_to_owners();
_change_notify("extents");
@@ -67,17 +64,16 @@ Vector3 BoxShape::get_extents() const {
return extents;
}
void BoxShape::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_extents","extents"),&BoxShape::set_extents);
ObjectTypeDB::bind_method(_MD("get_extents"),&BoxShape::get_extents);
ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"), _SCS("set_extents"), _SCS("get_extents") );
ObjectTypeDB::bind_method(_MD("set_extents", "extents"), &BoxShape::set_extents);
ObjectTypeDB::bind_method(_MD("get_extents"), &BoxShape::get_extents);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "extents"), _SCS("set_extents"), _SCS("get_extents"));
}
BoxShape::BoxShape() : Shape( PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_BOX)) {
BoxShape::BoxShape()
: Shape(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_BOX)) {
set_extents(Vector3(1,1,1));
set_extents(Vector3(1, 1, 1));
}