You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +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:
@@ -28,25 +28,23 @@
|
||||
/*************************************************************************/
|
||||
#include "shape.h"
|
||||
|
||||
#include "servers/physics_server.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "os/os.h"
|
||||
#include "scene/main/scene_main_loop.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "servers/physics_server.h"
|
||||
|
||||
|
||||
void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xform) {
|
||||
void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform &p_xform) {
|
||||
|
||||
Vector<Vector3> toadd = _gen_debug_mesh_lines();
|
||||
|
||||
if (toadd.size()) {
|
||||
|
||||
int base=array.size();
|
||||
array.resize(base+toadd.size());
|
||||
int base = array.size();
|
||||
array.resize(base + toadd.size());
|
||||
DVector<Vector3>::Write w = array.write();
|
||||
for(int i=0;i<toadd.size();i++) {
|
||||
w[i+base]=p_xform.xform(toadd[i]);
|
||||
for (int i = 0; i < toadd.size(); i++) {
|
||||
w[i + base] = p_xform.xform(toadd[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,46 +63,39 @@ Ref<Mesh> Shape::get_debug_mesh() {
|
||||
array.resize(lines.size());
|
||||
{
|
||||
|
||||
DVector<Vector3>::Write w=array.write();
|
||||
for(int i=0;i<lines.size();i++) {
|
||||
w[i]=lines[i];
|
||||
DVector<Vector3>::Write w = array.write();
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
w[i] = lines[i];
|
||||
}
|
||||
}
|
||||
|
||||
Array arr;
|
||||
arr.resize(Mesh::ARRAY_MAX);
|
||||
arr[Mesh::ARRAY_VERTEX]=array;
|
||||
arr[Mesh::ARRAY_VERTEX] = array;
|
||||
|
||||
SceneTree *st=OS::get_singleton()->get_main_loop()->cast_to<SceneTree>();
|
||||
SceneTree *st = OS::get_singleton()->get_main_loop()->cast_to<SceneTree>();
|
||||
|
||||
debug_mesh_cache->add_surface(Mesh::PRIMITIVE_LINES,arr);
|
||||
debug_mesh_cache->add_surface(Mesh::PRIMITIVE_LINES, arr);
|
||||
|
||||
if (st) {
|
||||
debug_mesh_cache->surface_set_material(0,st->get_debug_collision_material());
|
||||
debug_mesh_cache->surface_set_material(0, st->get_debug_collision_material());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return debug_mesh_cache;
|
||||
|
||||
}
|
||||
|
||||
Shape::Shape() {
|
||||
|
||||
ERR_PRINT("Constructor must not be called!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Shape::Shape(RID p_shape) {
|
||||
|
||||
shape=p_shape;
|
||||
shape = p_shape;
|
||||
}
|
||||
|
||||
Shape::~Shape() {
|
||||
|
||||
PhysicsServer::get_singleton()->free(shape);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user