Game Development Community

Moving a Collision Mesh

by Josh Saulter · in Torque Game Engine · 07/15/2007 (10:40 am) · 2 replies

I have a number of objects that I reposition to match the terrain height as follows:

%xypos = getWord(%obj.position, 0) SPC getWord(%obj.position, 1);
%obj.position = setWord(%obj.position, 2, getTerrainHeight(%xypos));

This moves the objects to the correct positions, but their collision meshes remain at the original coordinates.

Is there a way to automatically translate the collision mesh along with the object and, if not, how would I go about translating the collision meshes? My searching efforts haven't produced any answers, but if someone could point me to the correct documentation or a tutorial, I'd appreciate it. Thanks in advance.

Josh

#1
07/15/2007 (11:46 am)
You need to use setTransform instead of simply changing the raw position values like that.
#2
07/15/2007 (12:17 pm)
Brilliant. That's just what I needed. Thanks!