Implementing clang-format and applying it to all classes

This commit is contained in:
Bastiaan Olij
2018-11-24 09:09:41 +11:00
parent 0a6f5d052a
commit fc20fa3fce
49 changed files with 2923 additions and 3172 deletions

View File

@@ -17,40 +17,38 @@ public:
real_t get_area() const; /// get area
inline bool has_no_area() const {
return (size.x<=CMP_EPSILON || size.y<=CMP_EPSILON || size.z<=CMP_EPSILON);
return (size.x <= CMP_EPSILON || size.y <= CMP_EPSILON || size.z <= CMP_EPSILON);
}
inline bool has_no_surface() const {
return (size.x<=CMP_EPSILON && size.y<=CMP_EPSILON && size.z<=CMP_EPSILON);
return (size.x <= CMP_EPSILON && size.y <= CMP_EPSILON && size.z <= CMP_EPSILON);
}
inline const Vector3& get_position() const { return position; }
inline void set_position(const Vector3& p_position) { position=p_position; }
inline const Vector3& get_size() const { return size; }
inline void set_size(const Vector3& p_size) { size=p_size; }
inline const Vector3 &get_position() const { return position; }
inline void set_position(const Vector3 &p_position) { position = p_position; }
inline const Vector3 &get_size() const { return size; }
inline void set_size(const Vector3 &p_size) { size = p_size; }
bool operator==(const AABB &p_rval) const;
bool operator!=(const AABB &p_rval) const;
bool operator==(const AABB& p_rval) const;
bool operator!=(const AABB& p_rval) const;
bool intersects(const AABB &p_aabb) const; /// Both AABBs overlap
bool intersects_inclusive(const AABB &p_aabb) const; /// Both AABBs (or their faces) overlap
bool encloses(const AABB &p_aabb) const; /// p_aabb is completely inside this
bool intersects(const AABB& p_aabb) const; /// Both AABBs overlap
bool intersects_inclusive(const AABB& p_aabb) const; /// Both AABBs (or their faces) overlap
bool encloses(const AABB & p_aabb) const; /// p_aabb is completely inside this
AABB merge(const AABB& p_with) const;
void merge_with(const AABB& p_aabb); ///merge with another AABB
AABB intersection(const AABB& p_aabb) const; ///get box where two intersect, empty if no intersection occurs
bool intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector3* r_clip=nullptr,Vector3* r_normal=nullptr) const;
bool intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* r_clip=nullptr,Vector3* r_normal=nullptr) const;
bool smits_intersect_ray(const Vector3 &from,const Vector3& p_dir, real_t t0, real_t t1) const;
AABB merge(const AABB &p_with) const;
void merge_with(const AABB &p_aabb); ///merge with another AABB
AABB intersection(const AABB &p_aabb) const; ///get box where two intersect, empty if no intersection occurs
bool intersects_segment(const Vector3 &p_from, const Vector3 &p_to, Vector3 *r_clip = nullptr, Vector3 *r_normal = nullptr) const;
bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip = nullptr, Vector3 *r_normal = nullptr) const;
bool smits_intersect_ray(const Vector3 &from, const Vector3 &p_dir, real_t t0, real_t t1) const;
bool intersects_convex_shape(const Plane *p_plane, int p_plane_count) const;
bool intersects_plane(const Plane &p_plane) const;
bool has_point(const Vector3& p_point) const;
Vector3 get_support(const Vector3& p_normal) const;
bool has_point(const Vector3 &p_point) const;
Vector3 get_support(const Vector3 &p_normal) const;
Vector3 get_longest_axis() const;
int get_longest_axis_index() const;
@@ -63,21 +61,22 @@ public:
AABB grow(real_t p_by) const;
void grow_by(real_t p_amount);
void get_edge(int p_edge,Vector3& r_from,Vector3& r_to) const;
void get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const;
Vector3 get_endpoint(int p_point) const;
AABB expand(const Vector3& p_vector) const;
void project_range_in_plane(const Plane& p_plane,real_t &r_min,real_t& r_max) const;
void expand_to(const Vector3& p_vector); /** expand to contain a point if necesary */
AABB expand(const Vector3 &p_vector) const;
void project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const;
void expand_to(const Vector3 &p_vector); /** expand to contain a point if necesary */
operator String() const;
inline AABB() {}
inline AABB(const Vector3 &p_pos,const Vector3& p_size) { position=p_pos; size=p_size; }
inline AABB(const Vector3 &p_pos, const Vector3 &p_size) {
position = p_pos;
size = p_size;
}
};
}
} // namespace godot
#endif // RECT3_H