MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getEntity

Method getEntity

plugins/script/interfaces/EntityInterface.cpp:79–89  ·  view source on GitHub ↗

"Cast" service for Python, returns a ScriptEntityNode. The returned node is non-NULL if the cast succeeded

Source from the content-addressed store, hash-verified

77// "Cast" service for Python, returns a ScriptEntityNode.
78// The returned node is non-NULL if the cast succeeded
79ScriptEntityNode ScriptEntityNode::getEntity(const ScriptSceneNode& node) {
80 // Try to cast the node onto a brush
81 IEntityNodePtr entityNode = std::dynamic_pointer_cast<IEntityNode>(
82 static_cast<scene::INodePtr>(node)
83 );
84
85 // Construct a entityNode (contained node is NULL if not an entity)
86 return ScriptEntityNode(entityNode != NULL
87 ? node
88 : ScriptSceneNode(scene::INodePtr()));
89}
90
91// Creates a new entity for the given entityclass
92ScriptSceneNode EntityInterface::createEntity(const ScriptEntityClass& eclass)

Callers 15

_onModelButtonMethod · 0.45
analyseSelectionMethod · 0.45
callbackAddModelMethod · 0.45
callbackAddParticleMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
performModelNodeTestFunction · 0.45

Calls 2

ScriptEntityNodeClass · 0.85
ScriptSceneNodeClass · 0.85

Tested by 3

preMethod · 0.36
preMethod · 0.36