dongju.jeong Posted November 12, 2018 Share Posted November 12, 2018 (edited) When I move the NodeReference object, the real reference object (getReference ()) changes too. When I move 2 on the x axis of NodeReference, both the NodeReference and getReference () objects have an x value of 2. However, a total of 2 moved, not 4 moved. In the Editor, if both the NodeReference and getReference () objects move the x axis by 2, the result is a 4 moved. I think I know something wrong, but please answer me. Why does it look like it moved 2 spaces instead of 4 on the screen? and What is the conversion method that does not affect real reference objects? And I get this error when I exit the program by just pressing x. An error occurs only when the real reference object of .node for make NodeReference has an property with a component system applied. What's wrong with the code? Edited November 12, 2018 by dongju.jeong Link to comment
morbid Posted November 12, 2018 Share Posted November 12, 2018 Hello, can't say what exactly goes wrong. Please, attach a sample project where we can see the issue. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
dongju.jeong Posted November 13, 2018 Author Share Posted November 13, 2018 (edited) here test project. please Initialize the common value of the reference object of the node reference in the editor. I tested and did not initialize. NodeRef.zip Edited November 13, 2018 by dongju.jeong Link to comment
fox Posted November 13, 2018 Share Posted November 13, 2018 Hi Dongju, As for node reference transforms, it's normal behavior (described here). Your code is ok, the error you get is due to a bug in the Component System, the fix will be available with the upcoming SDK release. We're sorry for the inconvenience caused! Thank you! Link to comment
dongju.jeong Posted November 14, 2018 Author Share Posted November 14, 2018 If the nodeReference in the world standard (0,0,0) moves by 2 distances on the x axis, the x value of the actual reference object is also set to 2. When I restart after using the world :: get () -> saveNode () function, the nodeReference will be in world standard (2,0,0) from scratch even if it is not moved. This causes an unwanted position shift, in addition to the direct modification of the actual reference object. After add fuction "World :: get () -> saveNode (node_ref-> getNodeName (), node_ref-> getReference ())" on the attached project; , you can see that the material_ball of the nodeReference moves sideways each time you rerun. Is there a way that the actual reference object (getReference () Node) will not be affected about modifications to the NodeReference Node? Link to comment
thomalex Posted November 16, 2018 Share Posted November 16, 2018 Hi, Dongju, As Fox said earlier, it is expected behaviour, since the actual reference object keeps the transformation matrix of the NodeReference object. That is why on World::get()->saveNode(...) the reference object changes its position in your sample. As a brief solution, you can reset the position of the reference object before the saving and move the node again. node_ref->getReference()->setWorldPosition(Vec3::ZERO); World::get()->saveNode(node_ref->getNodeName(), node_ref->getReference()); node_ref->setPosition(Vec3(2, 0, 0)); We will consider improving this approach and the saveNode method in further releases. Sorry for the inconvenience. Thanks! Link to comment
Recommended Posts