mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix coding-stype
This commit is contained in:
parent
2012838899
commit
df3023db30
196 changed files with 2510 additions and 3945 deletions
|
@ -54,23 +54,21 @@ namespace sprout {
|
|||
unit_type val_;
|
||||
material_type mat_;
|
||||
private:
|
||||
SPROUT_CONSTEXPR bool is_x() const {
|
||||
SPROUT_CONSTEXPR bool
|
||||
is_x() const {
|
||||
return direction_value_ == aa_plane_direction::x;
|
||||
}
|
||||
SPROUT_CONSTEXPR bool is_y() const {
|
||||
SPROUT_CONSTEXPR bool
|
||||
is_y() const {
|
||||
return direction_value_ == aa_plane_direction::y;
|
||||
}
|
||||
SPROUT_CONSTEXPR bool is_z() const {
|
||||
SPROUT_CONSTEXPR bool
|
||||
is_z() const {
|
||||
return direction_value_ == aa_plane_direction::z;
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_5(
|
||||
int hit_side,
|
||||
bool does_intersect,
|
||||
unit_type distance,
|
||||
position_type const& point_of_intersection
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_5(int hit_side, bool does_intersect, unit_type distance, position_type const& point_of_intersection) const {
|
||||
return typename intersection<Ray>::type(
|
||||
does_intersect,
|
||||
distance,
|
||||
|
@ -97,13 +95,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_4(
|
||||
Ray const& ray,
|
||||
int hit_side,
|
||||
bool does_intersect,
|
||||
unit_type distance
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_4(Ray const& ray, int hit_side, bool does_intersect, unit_type distance) const {
|
||||
return intersect_5<Ray>(
|
||||
hit_side,
|
||||
does_intersect,
|
||||
|
@ -114,14 +107,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_3(
|
||||
Ray const& ray,
|
||||
unit_type pos_v,
|
||||
unit_type dir_v,
|
||||
int hit_side,
|
||||
bool does_intersect
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_3(Ray const& ray, unit_type pos_v, unit_type dir_v, int hit_side, bool does_intersect) const {
|
||||
return intersect_4(
|
||||
ray,
|
||||
hit_side,
|
||||
|
@ -132,13 +119,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_2(
|
||||
Ray const& ray,
|
||||
unit_type pos_v,
|
||||
unit_type dir_v,
|
||||
int hit_side
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_2(Ray const& ray, unit_type pos_v, unit_type dir_v, int hit_side) const {
|
||||
return intersect_3(
|
||||
ray,
|
||||
pos_v,
|
||||
|
@ -148,12 +130,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_1(
|
||||
Ray const& ray,
|
||||
unit_type pos_v,
|
||||
unit_type dir_v
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_1(Ray const& ray, unit_type pos_v, unit_type dir_v) const {
|
||||
return intersect_2(
|
||||
ray,
|
||||
pos_v,
|
||||
|
@ -162,17 +140,14 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
public:
|
||||
SPROUT_CONSTEXPR basic_aa_plane(
|
||||
aa_plane_direction::values direction_value,
|
||||
unit_type val,
|
||||
material_type const& mat
|
||||
)
|
||||
SPROUT_CONSTEXPR basic_aa_plane(aa_plane_direction::values direction_value, unit_type val, material_type const& mat)
|
||||
: direction_value_(direction_value)
|
||||
, val_(val)
|
||||
, mat_(mat)
|
||||
{}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect(Ray const& ray) const {
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect(Ray const& ray) const {
|
||||
return intersect_1(
|
||||
ray,
|
||||
(is_x() ? sprout::darkroom::coords::x(sprout::darkroom::rays::position(ray))
|
||||
|
@ -191,12 +166,7 @@ namespace sprout {
|
|||
//
|
||||
template<typename Material, typename Unit>
|
||||
inline SPROUT_CONSTEXPR sprout::darkroom::objects::basic_aa_plane<Material>
|
||||
make_aa_plane(
|
||||
sprout::darkroom::objects::aa_plane_direction::values dir_val,
|
||||
Unit const& val,
|
||||
Material const& mat
|
||||
)
|
||||
{
|
||||
make_aa_plane(sprout::darkroom::objects::aa_plane_direction::values dir_val, Unit const& val, Material const& mat) {
|
||||
return sprout::darkroom::objects::basic_aa_plane<Material>(dir_val, val, mat);
|
||||
}
|
||||
} // namespace objects
|
||||
|
|
|
@ -26,8 +26,7 @@ namespace sprout {
|
|||
struct intersect_list_impl {
|
||||
private:
|
||||
template<typename Objects, typename Ray, typename A, typename B>
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type
|
||||
::template intersection<Ray>::type
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type::template intersection<Ray>::type
|
||||
comp(A const& a, B const& b) const {
|
||||
return sprout::darkroom::intersects::does_intersect(a)
|
||||
&& sprout::darkroom::intersects::does_intersect(b)
|
||||
|
@ -41,8 +40,7 @@ namespace sprout {
|
|||
}
|
||||
public:
|
||||
template<typename Objects, typename Ray>
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type
|
||||
::template intersection<Ray>::type
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type ::template intersection<Ray>::type
|
||||
operator()(Objects const& objs, Ray const& ray) const {
|
||||
return comp<Objects, Ray>(
|
||||
sprout::darkroom::objects::intersect(sprout::darkroom::access::get<N>(objs), ray),
|
||||
|
@ -54,16 +52,14 @@ namespace sprout {
|
|||
struct intersect_list_impl<0> {
|
||||
public:
|
||||
template<typename Objects, typename Ray>
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type
|
||||
::template intersection<Ray>::type
|
||||
SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type::template intersection<Ray>::type
|
||||
operator()(Objects const& objs, Ray const& ray) const {
|
||||
return sprout::darkroom::objects::intersect(sprout::darkroom::access::get<0>(objs), ray);
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
template<typename Objects, typename Ray>
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type
|
||||
::template intersection<Ray>::type
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Objects>::type::template intersection<Ray>::type
|
||||
intersect_list(Objects const& objs, Ray const& ray) {
|
||||
return sprout::darkroom::objects::detail::intersect_list_impl<
|
||||
sprout::darkroom::access::size<Objects>::value - 1
|
||||
|
|
|
@ -45,7 +45,8 @@ namespace sprout {
|
|||
position_type normal_;
|
||||
private:
|
||||
template<typename Vector>
|
||||
SPROUT_CONSTEXPR bool within_test(Vector const& d0, Vector const& d1) {
|
||||
SPROUT_CONSTEXPR bool
|
||||
within_test(Vector const& d0, Vector const& d1) {
|
||||
return sprout::darkroom::coords::dot(
|
||||
sprout::darkroom::coords::cross(d0, d1),
|
||||
normal_
|
||||
|
@ -54,13 +55,8 @@ namespace sprout {
|
|||
;
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_5(
|
||||
Ray const& ray,
|
||||
int hit_side,
|
||||
bool does_intersect,
|
||||
unit_type distance
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_5(Ray const& ray, int hit_side, bool does_intersect, unit_type distance) const {
|
||||
return typename intersection<Ray>::type(
|
||||
does_intersect,
|
||||
distance,
|
||||
|
@ -73,13 +69,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_4(
|
||||
Ray const& ray,
|
||||
position_type const& v,
|
||||
int hit_side,
|
||||
bool does_intersect
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_4(Ray const& ray, position_type const& v, int hit_side, bool does_intersect) const {
|
||||
return intersect_5(
|
||||
ray,
|
||||
hit_side,
|
||||
|
@ -90,14 +81,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_3(
|
||||
Ray const& ray,
|
||||
position_type const& v,
|
||||
position_type const& p,
|
||||
int hit_side,
|
||||
bool exist_forward
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_3(Ray const& ray, position_type const& v, position_type const& p, int hit_side, bool exist_forward) const {
|
||||
return intersect_4(
|
||||
ray,
|
||||
v,
|
||||
|
@ -118,12 +103,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_2(
|
||||
Ray const& ray,
|
||||
unit_type const& t,
|
||||
int hit_side
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_2(Ray const& ray, unit_type const& t, int hit_side) const {
|
||||
return intersect_3(
|
||||
ray,
|
||||
sprout::darkroom::coords::scale(sprout::darkroom::rays::direction(ray), t),
|
||||
|
@ -138,12 +119,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_1(
|
||||
Ray const& ray,
|
||||
unit_type const& xpn,
|
||||
unit_type const& vn
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_1(Ray const& ray, unit_type const& xpn, unit_type const& vn) const {
|
||||
return intersect_2(
|
||||
ray,
|
||||
xpn / vn,
|
||||
|
@ -151,12 +128,7 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
public:
|
||||
SPROUT_CONSTEXPR basic_triangle(
|
||||
material_type const& mat,
|
||||
position_type const& v0,
|
||||
position_type const& v1,
|
||||
position_type const& v2
|
||||
)
|
||||
SPROUT_CONSTEXPR basic_triangle(material_type const& mat, position_type const& v0, position_type const& v1, position_type const& v2)
|
||||
: mat_(mat)
|
||||
, vertices_{{v0, v1, v2}}
|
||||
, normal_(
|
||||
|
@ -169,7 +141,8 @@ namespace sprout {
|
|||
)
|
||||
{}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect(Ray const& ray) const {
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect(Ray const& ray) const {
|
||||
return intersect_1(
|
||||
ray,
|
||||
sprout::darkroom::coords::dot(
|
||||
|
@ -188,13 +161,7 @@ namespace sprout {
|
|||
//
|
||||
template<typename Material, typename Vertex>
|
||||
inline SPROUT_CONSTEXPR sprout::darkroom::objects::basic_triangle<Material, Vertex>
|
||||
make_triangle(
|
||||
Material const& mat,
|
||||
Vertex const& v0,
|
||||
Vertex const& v1,
|
||||
Vertex const& v2
|
||||
)
|
||||
{
|
||||
make_triangle(Material const& mat, Vertex const& v0, Vertex const& v1, Vertex const& v2) {
|
||||
return sprout::darkroom::objects::basic_triangle<Material, Vertex>(mat, v0, v1, v2);
|
||||
}
|
||||
} // namespace objects
|
||||
|
|
|
@ -60,14 +60,8 @@ namespace sprout {
|
|||
material_type mat_;
|
||||
private:
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR zwo_type zweitens_2(
|
||||
Ray const& ray,
|
||||
unit_type const& i1,
|
||||
unit_type const& i2,
|
||||
int hit_side,
|
||||
bool does_intersect
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR zwo_type
|
||||
zweitens_2(Ray const& ray, unit_type const& i1, unit_type const& i2, int hit_side, bool does_intersect) const {
|
||||
return zwo_type(
|
||||
hit_side,
|
||||
does_intersect,
|
||||
|
@ -77,12 +71,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR zwo_type zweitens_1(
|
||||
Ray const& ray,
|
||||
unit_type const& i1,
|
||||
unit_type const& i2
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR zwo_type
|
||||
zweitens_1(Ray const& ray, unit_type const& i1, unit_type const& i2) const {
|
||||
return zweitens_2(
|
||||
ray,
|
||||
i1,
|
||||
|
@ -95,24 +85,16 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR zwo_type zweitens(
|
||||
Ray const& ray,
|
||||
bool neg,
|
||||
unit_type const& b,
|
||||
unit_type const& det
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR zwo_type
|
||||
zweitens(Ray const& ray, bool neg, unit_type const& b, unit_type const& det) const {
|
||||
return neg
|
||||
? zweitens_1(ray, b - det, b + det)
|
||||
: zwo_type(0, false, -1)
|
||||
;
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR drei_type drittens_1(
|
||||
Ray const& ray,
|
||||
typename sprout::darkroom::access::unit<Ray>::type point_of_intersection
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR drei_type
|
||||
drittens_1(Ray const& ray, typename sprout::darkroom::access::unit<Ray>::type point_of_intersection) const {
|
||||
return drei_type(
|
||||
point_of_intersection,
|
||||
sprout::darkroom::coords::normalize(
|
||||
|
@ -121,12 +103,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR drei_type drittens(
|
||||
Ray const& ray,
|
||||
bool neg,
|
||||
unit_type const& distance
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR drei_type
|
||||
drittens(Ray const& ray, bool neg, unit_type const& distance) const {
|
||||
return neg
|
||||
? drittens_1(ray, sprout::darkroom::rays::point_of_intersection(ray, distance))
|
||||
: drei_type(
|
||||
|
@ -136,13 +114,8 @@ namespace sprout {
|
|||
;
|
||||
}
|
||||
template<typename Ray, typename Vec>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_6(
|
||||
Ray const& ray,
|
||||
zwo_type const& zwo,
|
||||
drei_type const& drei,
|
||||
Vec const& normal
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_6(Ray const& ray, zwo_type const& zwo, drei_type const& drei, Vec const& normal) const {
|
||||
return typename intersection<Ray>::type(
|
||||
sprout::tuples::get<zw::does_intersect>(zwo),
|
||||
sprout::tuples::get<zw::distance>(zwo),
|
||||
|
@ -168,12 +141,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_5(
|
||||
Ray const& ray,
|
||||
zwo_type const& zwo,
|
||||
drei_type const& drei
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_5(Ray const& ray, zwo_type const& zwo, drei_type const& drei) const {
|
||||
return intersect_6(
|
||||
ray,
|
||||
zwo,
|
||||
|
@ -182,11 +151,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_4(
|
||||
Ray const& ray,
|
||||
zwo_type const& zwo
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_4(Ray const& ray, zwo_type const& zwo) const {
|
||||
return intersect_5(
|
||||
ray,
|
||||
zwo,
|
||||
|
@ -198,12 +164,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_3(
|
||||
Ray const& ray,
|
||||
unit_type const& b,
|
||||
unit_type const& det_sq
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_3(Ray const& ray, unit_type const& b, unit_type const& det_sq) const {
|
||||
return intersect_4(
|
||||
ray,
|
||||
zweitens(
|
||||
|
@ -215,12 +177,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_2(
|
||||
Ray const& ray,
|
||||
position_type const& v,
|
||||
unit_type const& b
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_2(Ray const& ray, position_type const& v, unit_type const& b) const {
|
||||
return intersect_3(
|
||||
ray,
|
||||
b,
|
||||
|
@ -228,11 +186,8 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect_1(
|
||||
Ray const& ray,
|
||||
position_type const& v
|
||||
) const
|
||||
{
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect_1(Ray const& ray, position_type const& v) const {
|
||||
return intersect_2(
|
||||
ray,
|
||||
v,
|
||||
|
@ -240,17 +195,14 @@ namespace sprout {
|
|||
);
|
||||
}
|
||||
public:
|
||||
SPROUT_CONSTEXPR basic_sphere(
|
||||
position_type const& pos,
|
||||
radius_type rad,
|
||||
material_type const& mat
|
||||
)
|
||||
SPROUT_CONSTEXPR basic_sphere(position_type const& pos, radius_type rad, material_type const& mat)
|
||||
: pos_(pos)
|
||||
, rad_(rad)
|
||||
, mat_(mat)
|
||||
{}
|
||||
template<typename Ray>
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type intersect(Ray const& ray) const {
|
||||
SPROUT_CONSTEXPR typename intersection<Ray>::type
|
||||
intersect(Ray const& ray) const {
|
||||
return intersect_1(
|
||||
ray,
|
||||
sprout::darkroom::coords::sub(sprout::darkroom::rays::position(ray), pos_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue