You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
This commit is contained in:
@@ -29,11 +29,11 @@
|
||||
#ifndef TRIANGLE_MESH_H
|
||||
#define TRIANGLE_MESH_H
|
||||
|
||||
#include "reference.h"
|
||||
#include "face3.h"
|
||||
#include "reference.h"
|
||||
class TriangleMesh : public Reference {
|
||||
|
||||
GDCLASS( TriangleMesh, Reference);
|
||||
GDCLASS(TriangleMesh, Reference);
|
||||
|
||||
struct Triangle {
|
||||
|
||||
@@ -56,7 +56,7 @@ class TriangleMesh : public Reference {
|
||||
|
||||
struct BVHCmpX {
|
||||
|
||||
bool operator()(const BVH* p_left, const BVH* p_right) const {
|
||||
bool operator()(const BVH *p_left, const BVH *p_right) const {
|
||||
|
||||
return p_left->center.x < p_right->center.x;
|
||||
}
|
||||
@@ -64,35 +64,33 @@ class TriangleMesh : public Reference {
|
||||
|
||||
struct BVHCmpY {
|
||||
|
||||
bool operator()(const BVH* p_left, const BVH* p_right) const {
|
||||
bool operator()(const BVH *p_left, const BVH *p_right) const {
|
||||
|
||||
return p_left->center.y < p_right->center.y;
|
||||
}
|
||||
};
|
||||
struct BVHCmpZ {
|
||||
|
||||
bool operator()(const BVH* p_left, const BVH* p_right) const {
|
||||
bool operator()(const BVH *p_left, const BVH *p_right) const {
|
||||
|
||||
return p_left->center.z < p_right->center.z;
|
||||
}
|
||||
};
|
||||
|
||||
int _create_bvh(BVH*p_bvh,BVH** p_bb,int p_from,int p_size,int p_depth,int&max_depth,int&max_alloc);
|
||||
int _create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &max_depth, int &max_alloc);
|
||||
|
||||
PoolVector<BVH> bvh;
|
||||
int max_depth;
|
||||
bool valid;
|
||||
|
||||
public:
|
||||
|
||||
bool is_valid() const;
|
||||
bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_point, Vector3 &r_normal) const;
|
||||
bool intersect_ray(const Vector3& p_begin,const Vector3& p_dir,Vector3 &r_point, Vector3 &r_normal) const;
|
||||
Vector3 get_area_normal(const Rect3& p_aabb) const;
|
||||
bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const;
|
||||
bool intersect_ray(const Vector3 &p_begin, const Vector3 &p_dir, Vector3 &r_point, Vector3 &r_normal) const;
|
||||
Vector3 get_area_normal(const Rect3 &p_aabb) const;
|
||||
PoolVector<Face3> get_faces() const;
|
||||
|
||||
|
||||
void create(const PoolVector<Vector3>& p_faces);
|
||||
void create(const PoolVector<Vector3> &p_faces);
|
||||
TriangleMesh();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user