What I do is get the bounding radius of a node and use that size to determine how large to make the redicule.
Two things are happening:
1. With distance objects, sometimes the size of the ring is the same size as if I were right next to the object (i.e. the ring should be smaller because of the distance and its not).
2. Some objects, the ring is so small I can't see it, even when I am next to the object (i.e. the ring should be bigger and its not).
Code: Select all
Node = TargetObj->Node;
mTargetRadius = TargetObj->Entity->getBoundingRadius(); // need to get the 2d coordinates for the target
get2DScreenCoordinates(Node->getWorldPosition(), TargetPosX, TargetPosY);
// Set the position of the target reticule frame
if (mTargetRadius < 50) mTargetRadius = 50; // so its visible
if (mTargetRadius > 300) mTargetRadius = 300; // so its visible
mHudTarget->setDimensions(mTargetRadius, mTargetRadius);
TargetBoxPosX = TargetPosX - (mHudTarget->getWidth() * 0.5);
TargetBoxPosY = TargetPosY - (mHudTarget->getHeight() * 0.5);
mHudTarget->setPosition(TargetBoxPosX, TargetBoxPosY);
mTargetRadius = MySpaceShip->DistanceFrom(Node->getWorldPosition());
GuiHudTargetDistanceVelocityText->setCaption("D:" + StringConverter::toString(mTargetRadius));
mHudTarget->show();
