TMesh to TEntity?

BlitzMax Forums/MiniB3D Module/TMesh to TEntity?

BLaBZ(Posted 2010) [#1]
How do you turn a TMesh to a TEntity?

I'm trying to do a CameraPick on a mesh I created


Difference(Posted 2010) [#2]
You should be able to cast a tMesh to a tEntity like this.

Local MyMesh:tMesh = LoadMesh("cheese.b3d")
Local MyEnt:tEntity = tEntity(MyMesh)


ima747(Posted 2010) [#3]
TMesh is a subclass of TEntity so you shouldn't have to do any type casting... but if you do for some reason I can't see peter's example should have you covered
Local variableName:TargetType = TargetType(StartingVariableOfCompatibleType)


this is very handy for TLists specifically, as they only store objects but almost everything is a subclass of an object. So you can typecast the object you get from a call like myList.First() into an entity or whatever you know is stored in there.