MCPcopy Create free account
hub / github.com/CelestiaProject/Celestia / getVectorTarget

Function getVectorTarget

src/celengine/parseobject.cpp:1419–1437  ·  view source on GitHub ↗

Get the target object of a direction vector definition. Return an empty selection if it's missing or refers to an object that doesn't exist.

Source from the content-addressed store, hash-verified

1417// Get the target object of a direction vector definition. Return an
1418// empty selection if it's missing or refers to an object that doesn't exist.
1419static Selection
1420getVectorTarget(const Universe& universe, Hash* vectorData)
1421{
1422 string targetName;
1423 if (!vectorData->getString("Target", targetName))
1424 {
1425 clog << "Bad two-vector frame: no target specified for vector.\n";
1426 return Selection();
1427 }
1428
1429 Selection targetObject = universe.findPath(targetName, NULL, 0);
1430 if (targetObject.empty())
1431 {
1432 clog << "Bad two-vector frame: target object '" << targetName << "' of vector not found.\n";
1433 return Selection();
1434 }
1435
1436 return targetObject;
1437}
1438
1439
1440// Get the observer object of a direction vector definition. Return an

Callers 1

CreateFrameVectorFunction · 0.85

Calls 4

getStringMethod · 0.80
findPathMethod · 0.80
SelectionClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected