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

Function getVectorObserver

src/celengine/parseobject.cpp:1442–1461  ·  view source on GitHub ↗

Get the observer 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

1440// Get the observer object of a direction vector definition. Return an
1441// empty selection if it's missing or refers to an object that doesn't exist.
1442static Selection
1443getVectorObserver(const Universe& universe, Hash* vectorData)
1444{
1445 string obsName;
1446 if (!vectorData->getString("Observer", obsName))
1447 {
1448 // Omission of observer is permitted; it will default to the
1449 // frame center.
1450 return Selection();
1451 }
1452
1453 Selection obsObject = universe.findPath(obsName, NULL, 0);
1454 if (obsObject.empty())
1455 {
1456 clog << "Bad two-vector frame: observer object '" << obsObject.getName() << "' of vector not found.\n";
1457 return Selection();
1458 }
1459
1460 return obsObject;
1461}
1462
1463
1464static FrameVector*

Callers 1

CreateFrameVectorFunction · 0.85

Calls 5

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

Tested by

no test coverage detected