mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-02-11 10:03:59 +00:00
Merge pull request #54 from kariya-mitsuru/darkroom.sphere
[darkroom.objects.sphere] Reduce function call.
This commit is contained in:
commit
d3c5feff2c
1 changed files with 4 additions and 13 deletions
|
@ -66,26 +66,17 @@ namespace sprout {
|
||||||
radius_type rad_;
|
radius_type rad_;
|
||||||
material_type mat_;
|
material_type mat_;
|
||||||
private:
|
private:
|
||||||
SPROUT_STATIC_CONSTEXPR zwo_type
|
|
||||||
zweitens_2(unit_type const& i1, unit_type const& i2, int hit_side, bool does_intersect) {
|
|
||||||
return zwo_type(
|
|
||||||
hit_side,
|
|
||||||
does_intersect,
|
|
||||||
hit_side < 0 ? i2
|
|
||||||
: hit_side > 0 ? i1
|
|
||||||
: -1
|
|
||||||
);
|
|
||||||
}
|
|
||||||
SPROUT_STATIC_CONSTEXPR zwo_type
|
SPROUT_STATIC_CONSTEXPR zwo_type
|
||||||
zweitens_1(unit_type const& i1, unit_type const& i2) {
|
zweitens_1(unit_type const& i1, unit_type const& i2) {
|
||||||
return zweitens_2(
|
return zwo_type(
|
||||||
i1,
|
|
||||||
i2,
|
|
||||||
i2 > 0
|
i2 > 0
|
||||||
? i1 < 0 ? -1 : 1
|
? i1 < 0 ? -1 : 1
|
||||||
: 0
|
: 0
|
||||||
,
|
,
|
||||||
|
i2 > 0,
|
||||||
i2 > 0
|
i2 > 0
|
||||||
|
? i1 < 0 ? i2 : i1
|
||||||
|
: -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
SPROUT_STATIC_CONSTEXPR zwo_type
|
SPROUT_STATIC_CONSTEXPR zwo_type
|
||||||
|
|
Loading…
Add table
Reference in a new issue