1
0
Fork 0
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:
bolero-MURAKAMI 2012-10-06 00:58:56 +09:00
parent 2012838899
commit df3023db30
196 changed files with 2510 additions and 3945 deletions

View file

@ -26,7 +26,8 @@ namespace sprout {
: col_(col)
{}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type operator()(Intersection const& inter, Objects const&) const {
SPROUT_CONSTEXPR color_type
operator()(Intersection const& inter, Objects const&) const {
return sprout::darkroom::colors::filter(
col_,
sprout::darkroom::materials::color(sprout::darkroom::intersects::material(inter))

View file

@ -23,18 +23,21 @@ namespace sprout {
lights_type lights_;
private:
template<typename Color>
SPROUT_CONSTEXPR color_type shade_2(Color const& col) const {
SPROUT_CONSTEXPR color_type
shade_2(Color const& col) const {
return col;
}
template<typename Color1, typename Color2, typename... Tail>
SPROUT_CONSTEXPR color_type shade_2(Color1 const& col1, Color2 const& col2, Tail const&... tail) const {
SPROUT_CONSTEXPR color_type
shade_2(Color1 const& col1, Color2 const& col2, Tail const&... tail) const {
return shade_2(
sprout::darkroom::colors::add(col1, col2),
tail...
);
}
template<typename Intersection, typename Objects, sprout::index_t... Indexes>
SPROUT_CONSTEXPR color_type shade_1(
SPROUT_CONSTEXPR color_type
shade_1(
Intersection const& inter, Objects const& objs,
sprout::index_tuple<Indexes...>
) const
@ -46,7 +49,8 @@ namespace sprout {
: lights_(lights...)
{}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type operator()(Intersection const& inter, Objects const& objs) const {
SPROUT_CONSTEXPR color_type
operator()(Intersection const& inter, Objects const& objs) const {
return shade_1(inter, objs, sprout::index_range<0, sizeof...(Lights)>::make());
}
};

View file

@ -32,11 +32,8 @@ namespace sprout {
color_type col_;
private:
template<typename Intersection>
SPROUT_CONSTEXPR color_type shade_2(
Intersection const& inter,
unit_type const& intensity
) const
{
SPROUT_CONSTEXPR color_type
shade_2(Intersection const& inter, unit_type const& intensity) const {
return sprout::darkroom::colors::mul(
sprout::darkroom::colors::filter(
col_,
@ -46,11 +43,8 @@ namespace sprout {
);
}
template<typename Intersection, typename LightRayIntersection>
SPROUT_CONSTEXPR color_type shade_1(
Intersection const& inter,
LightRayIntersection const& light_ray_inter
) const
{
SPROUT_CONSTEXPR color_type
shade_1(Intersection const& inter, LightRayIntersection const& light_ray_inter) const {
return shade_2(
inter,
!sprout::darkroom::intersects::does_intersect(light_ray_inter)
@ -67,15 +61,13 @@ namespace sprout {
);
}
public:
SPROUT_CONSTEXPR basic_parallel_light(
position_type const& dir,
color_type const& col
)
SPROUT_CONSTEXPR basic_parallel_light(position_type const& dir, color_type const& col)
: dir_(sprout::darkroom::coords::normalize(dir))
, col_(col)
{}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type operator()(Intersection const& inter, Objects const& objs) const {
SPROUT_CONSTEXPR color_type
operator()(Intersection const& inter, Objects const& objs) const {
return shade_1(
inter,
sprout::darkroom::objects::intersect_list(

View file

@ -32,11 +32,8 @@ namespace sprout {
color_type col_;
private:
template<typename Intersection>
SPROUT_CONSTEXPR color_type shade_4(
Intersection const& inter,
unit_type const& intensity
) const
{
SPROUT_CONSTEXPR color_type
shade_4(Intersection const& inter, unit_type const& intensity) const {
return sprout::darkroom::colors::mul(
sprout::darkroom::colors::filter(
col_,
@ -46,10 +43,9 @@ namespace sprout {
);
}
template<typename Intersection, typename LightRayIntersection>
SPROUT_CONSTEXPR color_type shade_3(
Intersection const& inter,
position_type const& diff,
position_type const& direction,
SPROUT_CONSTEXPR color_type
shade_3(
Intersection const& inter, position_type const& diff, position_type const& direction,
LightRayIntersection const& light_ray_inter
) const
{
@ -72,13 +68,8 @@ namespace sprout {
);
}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type shade_2(
Intersection const& inter,
Objects const& objs,
position_type const& diff,
position_type const& direction
) const
{
SPROUT_CONSTEXPR color_type
shade_2(Intersection const& inter, Objects const& objs, position_type const& diff, position_type const& direction) const {
return shade_3(
inter,
diff,
@ -99,12 +90,8 @@ namespace sprout {
);
}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type shade_1(
Intersection const& inter,
Objects const& objs,
position_type const& diff
) const
{
SPROUT_CONSTEXPR color_type
shade_1(Intersection const& inter, Objects const& objs, position_type const& diff) const {
return shade_2(
inter,
objs,
@ -113,15 +100,13 @@ namespace sprout {
);
}
public:
SPROUT_CONSTEXPR basic_point_light(
position_type const& pos,
color_type const& col
)
SPROUT_CONSTEXPR basic_point_light(position_type const& pos, color_type const& col)
: pos_(pos)
, col_(col)
{}
template<typename Intersection, typename Objects>
SPROUT_CONSTEXPR color_type operator()(Intersection const& inter, Objects const& objs) const {
SPROUT_CONSTEXPR color_type
operator()(Intersection const& inter, Objects const& objs) const {
return shade_1(
inter,
objs,