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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue