mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
An experiment - instead of hard limit function use modulo wrap-around for zone placement. Should be more logical and give zones more space.
This commit is contained in:
parent
7f1ddc4a98
commit
fba1e86091
@ -354,7 +354,12 @@ float3 CRmgTemplateZone::getCenter() const
|
||||
void CRmgTemplateZone::setCenter(const float3 &f)
|
||||
{
|
||||
//limit boundaries to (0,1) square
|
||||
center = float3 (std::min(std::max(f.x, 0.f), 1.f), std::min(std::max(f.y, 0.f), 1.f), f.z);
|
||||
//center = float3 (std::min(std::max(f.x, 0.f), 1.f), std::min(std::max(f.y, 0.f), 1.f), f.z);
|
||||
|
||||
//alternate solution - wrap zone around unitary square. If it doesn't fit on one side, will come out on the opposite side
|
||||
center = f;
|
||||
center.x = std::fmod(center.x, 1);
|
||||
center.y = std::fmod(center.y, 1);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user