jK wrote:That's why there is a `drawRadius`
This is the first time i hear about it too.
It doesn't seem it can be set in Lua:
Code: Select all
/rts/Lua (git)-[develop] % grep -rni drawRadius
LuaUnsyncedRead.cpp:754: float testRadius = WORLDOBJECT_DEFAULT_DRAWRADIUS;
LuaUnsyncedRead.cpp:846: if (!camera->InView(unit->midPos, testRadius + (unit->drawRadius * !fixedRadius)))
LuaUnsyncedRead.cpp:881: float testRadius = WORLDOBJECT_DEFAULT_DRAWRADIUS;
LuaUnsyncedRead.cpp:947: if (!camera->InView(f.midPos, testRadius + (f.drawRadius * !fixedRadius)))
LuaUnsyncedRead.cpp:1003: if (!camera->InView(pro->pos, pro->drawRadius))
But it does seem it exists, and this is how the value is obtained for different types:
Code: Select all
Rendering/Models/3DOParser.cpp:149: model->drawRadius = float3::max(float3::fabs(model->maxs), float3::fabs(model->mins)).Length();
Rendering/Models/AssParser.cpp:713: model->drawRadius = model->radius;
Rendering/Models/S3OParser.cpp:48: model->drawRadius = float3::max(float3::fabs(model->maxs), float3::fabs(model->mins)).Length();
All projectiles also seem to have it and it's obtained from a combination of the weapon size/collision size/collision radius depending on the weapon.
Would it be OK if I made a Lua interface to set this and untangled it from the existing Lua interface used to set the collision radius?
Anarchid wrote:
If there's a drawRadius, i would prefer the cludgeRadius to not exist at all.
I
think I heard jk say once that cludgeRadius is there to optimize collision calculations, and it was used before making any collision checks based on colvols. In a sense one would ignore collisions on all objects that haven't passed the radius check.
However, it doesn't seem like it does that at all -> In Gravitas and I think Area17 too with AoE weapons it would often override colvols in calculating collision checks, basically invalidating them.
So I could be wrong, and that's why this thread was opened to clarify things.
Anyway, I would agree with you. If cludgeRadius must exist for optimization, it should be invisible to the user and just be max(colvol dimensions).
PS: I also don't think we should need to set any collision settings for prefab models by default. It seems to me like we're doing premature optimization there.