getObjBox() which not use the scaling so "> Terrain selection ring fix for scaled objects | RTS Starter Kit | Forums | Community | GarageGames.com

Game Development Community

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)

Box3F box = obj->getObjBox();

and replace it with:

Box3F box = obj->getWorldBox();

#1
06/28/2008 (6:08 am)
Where did u scaled down to 0.1 0.1 0.1 please show root
thanks
#2
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).