Why do we have LoadAnimMesh?

BlitzMax Forums/MiniB3D Module/Why do we have LoadAnimMesh?

Picklesworth(Posted 2007) [#1]
It looks to me that LoadB3D just figures out on its own that a mesh is animated, so why is there a LoadAnimMesh function? Is this just for historical reasons?

I also find kind of weird the extra stuff in LoadMesh, below where it gets the mesh from LoadAnimMesh.
Local mesh:TMesh=TMesh(ent).CollapseAnimMesh()
		ent.FreeEntity()
		
		mesh.class:String="Mesh"
		
		mesh.AddParent(parent_ent:TEntity)
		mesh.EntityListAdd(entity_list)

		' update matrix
		If mesh.parent<>Null
			mesh.mat.Overwrite(mesh.parent.mat)
			mesh.UpdateMat()
		Else
			mesh.UpdateMat(True)
		EndIf
		
		Return mesh
Does this have something magical to do with loading a still mesh that cannot happen with an animated mesh? Why does mesh.AddParent(parent_ent:TEntity) happen when that is already dealt with in the mesh loader? (Can we make things easier for the loader and just do it in LoadMesh?)

ent.FreeEntity()
Wha?

Just a tad confused :)


simonh(Posted 2007) [#2]
LoadAnimMesh loads a mesh and keeps the entity hierarchy intact, it's not just for animated meshes.

ent.FreeEntity frees the original anim mesh, which is replaced by a collapsed version (no hierarchy).


Picklesworth(Posted 2007) [#3]
Ah, that makes sense! Thank you, Simon :)