Jump to content

[Solved] Cannot access boundbox of created nodes in custom ConsoleCommand


photo

Recommended Posts

Hi,

i was using the Unigine::Console::addCommand with Unigine::MakeCallback, to populate our scene with test objects. 

Inside the callback, i do the following:

  Code:

  auto node = Unigine::World::loadNode("<path-to-our-node>.node");
    if (!node)
        return false;
    node->setWorldPosition(Unigine::Math::Vec3(position.x, position.y, position.z));
   auto boundBox = node->getWorldBoundBox(); 

the boundbox has now values like:

image.thumb.png.a5cf6cdd9fc54cccaebded8314913ec6.png

Callstack points to:

void Unigine::CustomApp::doUpdate()

 

Questions:

  1. I did not find any documented limitations - is there any?. It looks to me that loading a node is not supported at this point. Or the updating is not allowed.
  2. How can i achieve that an object is loaded and can be afterwards manipulated?

 

Thanks in advance,

Sascha

 

 

Link to comment

Hello Sascha,

What's inside this node? Anyway, try the following:

  • Change loadNode to loadNode(node, 0). This will exclude node from cache. Please, write back if this will work.
  • Update spatial tree with World::updateSpatial();
  • Check this case with 2.11 beta

If nothing helps please, build a test scene that we can debug on our side.

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
2 hours ago, morbid said:

Hello Sascha,

What's inside this node? Anyway, try the following:

  • Change loadNode to loadNode(node, 0). This will exclude node from cache. Please, write back if this will work.
  • Update spatial tree with World::updateSpatial();
  • Check this case with 2.11 beta

If nothing helps please, build a test scene that we can debug on our side.

Thanks.

Hello morbid,

thanks for the response. The node contains a ObjectMeshStatic. Unfortunately the proposals did not work. I will set up and upload a sample project.

Regards.

Edited by sascha.schneider
Update
Link to comment

sascha.schneider

You are calculating bound from the NodeDummy, not the ObjectMeshStatic because In your Flagge.node the first object is:

<node type="NodeDummy" id="587780787" name="Flagge">

Since 2.11 NodeDummy objects have no bounds. Please, check the devlog here (Bounds Calculation Changes section):

So you need either to:

  • Remove the root dummy object and calculate bounds of the ObjectMeshStatic directly. In that case results will be: added object with bbox max = 0.07 0.10 5.00
    OR
  • Use Local Hierarchical Bounds (slower): auto box = node->getHierarchyBoundBox(); In that case results will be: added object with bbox max = 0.40 2.82 5.00

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
1 hour ago, silent said:

sascha.schneider

You are calculating bound from the NodeDummy, not the ObjectMeshStatic because In your Flagge.node the first object is:


<node type="NodeDummy" id="587780787" name="Flagge">

Since 2.11 NodeDummy objects have no bounds. Please, check the devlog here (Bounds Calculation Changes section):

So you need either to:

  • Remove the root dummy object and calculate bounds of the ObjectMeshStatic directly. In that case results will be: added object with bbox max = 0.07 0.10 5.00
    OR
  • Use Local Hierarchical Bounds (slower): auto box = node->getHierarchyBoundBox(); In that case results will be: added object with bbox max = 0.40 2.82 5.00

Thanks!

Hello Silent,

Thank you, for that clarification. Will try to rearrange the data.

Regards,

Sascha

Link to comment
  • sascha.schneider changed the title to [Solved] Cannot access boundbox of created nodes in custom ConsoleCommand
×
×
  • Create New...