Research:Rendering
Jump to navigation
Jump to search
Spell effect VFX
Parameters: entity, sourceScale
sourceScale is normally 1.0, except:
Physical projectile hits use 0.5
Area spell effects use 2 * spell area radius
if entity is an NPC:
offset_z = 0
vfxScale = entity.scale * entity.height
else:
# entity.bounds are from the "Bounding Box" named node.
box_dimensions = entity.bounds.box.max - entity.bounds.box.min
scaleFactor_xy = max(box_dimensions.x, box_dimensions.y) / 64.0
scaleFactor_z = box_dimensions.z / 128.0
scaleFactor = entity.scale * max(factor_xy, factor_z)
offset_z = 0
if box_dimensions.z >= 128.0:
if box_dimensions.z < (box_dimensions.x + box_dimensions.y):
offset_z = 128.0 - box_dimensions.z
else:
offset_z = box_dimensions.z - 128.0
if entity is a flying actor:
offset_z = offset_z * 0.05
offset_z = offset_z * scaleFactor
vfxScale = scaleFactor
vfxScale = max(1.0, sourceScale * finalScale)
Attaches visual effect at entity centre + (0, 0, offset_z), scale vfxScale.
This is preliminary research, please verify it matches standard Morrowind.