MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ActorsEditor_AddEntitiesAtMouse

Function ActorsEditor_AddEntitiesAtMouse

Source/Editors/actors_editor.cpp:381–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381std::vector<Object*> ActorsEditor_AddEntitiesAtMouse(const Path& source, SceneGraph* scenegraph, const EntityDescriptionList& desc_list, LineSegment mouseray, bool in_new_prefab) {
382 if (desc_list.empty())
383 return std::vector<Object*>();
384
385 Collision c = scenegraph->lineCheckCollidable(mouseray.start, mouseray.end, NULL);
386
387 vec3 spawn_pos = mouseray.start + normalize(mouseray.end - mouseray.start) * 10.0f;
388 if (c.hit && c.hit_what != NULL) {
389 spawn_pos = c.hit_where;
390 }
391
392 return ActorsEditor_AddEntitiesAtPosition(source, scenegraph, desc_list, spawn_pos, in_new_prefab);
393}
394
395std::vector<Object*> ActorsEditor_AddEntitiesAtPosition(const Path& source, SceneGraph* scenegraph, const EntityDescriptionList& desc_list, vec3 spawn_pos, bool in_new_prefab, CommonObjectID hostid) {
396 Online* online = Online::Instance();

Callers 2

PasteMethod · 0.85
UpdateToolsMethod · 0.85

Calls 4

lineCheckCollidableMethod · 0.80
normalizeFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected