mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Calculate the bounding radius.
The calculated radius is a smidge (0.05) smaller than the original (invisibl.mdl), but I think that's due to the difference in source data: id used the original models, I'm using their output.
This commit is contained in:
parent
3b33d8dade
commit
07b5db64c6
1 changed files with 2 additions and 0 deletions
|
@ -136,6 +136,8 @@ def scale_verts(mdl):
|
|||
for f in mdl.frames:
|
||||
tf.add_frame(f, 0.0) # let the frame class do the dirty work for us
|
||||
size = Vector(tf.maxs) - Vector(tf.mins)
|
||||
rsqr = tuple(map(lambda a, b: max(abs(a), abs(b)) ** 2, tf.mins, tf.maxs))
|
||||
mdl.boundingradius = (rsqr[0] + rsqr[1] + rsqr[2]) ** 0.5
|
||||
mdl.scale_origin = tf.mins
|
||||
mdl.scale = tuple(map(lambda x: x / 255.0, size))
|
||||
for f in mdl.frames:
|
||||
|
|
Loading…
Reference in a new issue