entity handle

Blitz3D Forums/Blitz3D Beginners Area/entity handle

mindstorms(Posted 2006) [#1]
Is there a way to specify an entity handle's location on an entity like imagehandle() does? I can't find anything in the code archives.


Dreamora(Posted 2006) [#2]
No. The handle is always at 0,0,0 of the object.
But you can create a pivot and set this to be your objects parent and then use the pivot -> same as sethandle to the pivot :-)


mindstorms(Posted 2006) [#3]
That's a good trick. I will try it.


jfk EO-11110(Posted 2006) [#4]
you can also use fitmesh. for the width, height and depth parameter you'll use Meshwidth() etc., xyz may be used to set it's logical center. (where you need to subtract the half width etc.)


Ross C(Posted 2006) [#5]
Or PositionMesh. Moves the mesh from it's 0,0,0 position. Actually moves the vertices.

If you want to centre a mesh, so it's centre is at 0,0,0 entity position, then:

FitMesh  Mesh,  MeshWidth(Mesh)/-2 , MeshHeight(Mesh)/-2, MeshDepth(Mesh)/-2, MeshWidth(Mesh), MeshHeight(Mesh), MeshDepth(Mesh)