TMesh to TEntity?
BlitzMax Forums/MiniB3D Module/TMesh to TEntity?
| ||
How do you turn a TMesh to a TEntity? I'm trying to do a CameraPick on a mesh I created |
| ||
You should be able to cast a tMesh to a tEntity like this. Local MyMesh:tMesh = LoadMesh("cheese.b3d") Local MyEnt:tEntity = tEntity(MyMesh) |
| ||
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 coveredLocal 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. |