Terrain selection ring fix for scaled objects
by Thomas Huehn · in RTS Starter Kit · 04/11/2008 (9:45 am) · 2 replies
While using a really big object which was scaled down to "0.1 0.1 0.1" i noticed that the radius of the selection ring is quite big.
The function TerrainRender::addSelection (terrain/terrSelection.c) uses obj->getObjBox() which not use the scaling so the better solution is to use the obj->getWorldBox or calculate it using obj->getScale.
So the fix is locate the following in function TerrainRender::addSelection (terrain/terrSelection.c)
and replace it with:
The function TerrainRender::addSelection (terrain/terrSelection.c) uses obj->getObjBox() which not use the scaling so the better solution is to use the obj->getWorldBox or calculate it using obj->getScale.
So the fix is locate the following in function TerrainRender::addSelection (terrain/terrSelection.c)
Box3F box = obj->getObjBox();
and replace it with:
Box3F box = obj->getWorldBox();
About the author
Contact: torque [AT] ohmtal [DOT] com
#2
1) From within the mission editor, look for the property field "scale"
2) By using object.SetScale("0.1 0.1 0.1"); (you also have getScale() to retrieve the current object's scale).
06/28/2008 (4:07 pm)
@Charin, you can easily scale up or down an object by two ways:1) From within the mission editor, look for the property field "scale"
2) By using object.SetScale("0.1 0.1 0.1"); (you also have getScale() to retrieve the current object's scale).
Torque Owner Charin
thanks