mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added ratio param
This commit is contained in:
@@ -10,5 +10,5 @@ namespace omath::primitives
|
|||||||
{
|
{
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
std::array<Vector3<float>, 8> CreateBox(const Vector3<float>& top, const Vector3<float>& bottom,
|
std::array<Vector3<float>, 8> CreateBox(const Vector3<float>& top, const Vector3<float>& bottom,
|
||||||
const Vector3<float>& dirForward, const Vector3<float>& dirRight);
|
const Vector3<float>& dirForward, const Vector3<float>& dirRight, float ratio = 4.f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ namespace omath::primitives
|
|||||||
|
|
||||||
std::array<Vector3<float>, 8> CreateBox(const Vector3<float>& top, const Vector3<float>& bottom,
|
std::array<Vector3<float>, 8> CreateBox(const Vector3<float>& top, const Vector3<float>& bottom,
|
||||||
const Vector3<float>& dirForward,
|
const Vector3<float>& dirForward,
|
||||||
const Vector3<float>& dirRight)
|
const Vector3<float>& dirRight,
|
||||||
|
const float ratio)
|
||||||
{
|
{
|
||||||
const auto height = top.DistTo(bottom);
|
const auto height = top.DistTo(bottom);
|
||||||
const auto sideSize = height / 6.f;
|
const auto sideSize = height / ratio;
|
||||||
|
|
||||||
std::array<Vector3<float>, 8> points;
|
std::array<Vector3<float>, 8> points;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user