burakdogancay Posted October 1, 2019 Share Posted October 1, 2019 (edited) I would like to inform you that the below code is able to move the object on y and x direction but although I specify that it should move on the z-axis, it doesn't move on the z-axis. Could you please tell me what is the reason and how should i solve it without changing the method.Also could you please give information about other methods of object movement. Unigine::Math::Vec3 movexaxis = node->getWorldDirection(Unigine::Math::AXIS_X); //it moves on x axis as expected Unigine::Math::Vec3 movezaxis = node->getWorldDirection(Unigine::Math::AXIS_Z); //but it does not work, the object does not move on z axis int objectspeed = 30; node->setWorldPosition(node->getWorldPosition()+movezaxis*objectspeed*Unigine::Game::get()->getIFps());//this is main function that should move on z axis but it does not work Edited October 1, 2019 by burakdogancay Link to comment
burakdogancay Posted October 1, 2019 Author Share Posted October 1, 2019 I will be very glad if you inform me about it Link to comment
alexander Posted October 1, 2019 Share Posted October 1, 2019 Hi burakdogancay, I don't see any problems with your code. What type is the "node"? ObjectMeshStatic, PlayerActor, ObjectDummy? Is it physical (BodyRigid, Shapes)? movezaxis is equal to zero? Look at it in debugger or send it to the engine's console: Log::message("Movezaxis: %.3f, %.3f, %.3f\n", movezaxis.x, movezaxis.y, movezaxis.z); Best regards, Alexander Link to comment
burakdogancay Posted October 1, 2019 Author Share Posted October 1, 2019 It returns this one Movezaxis: 0.000, -0.000, 1.000 Movezaxis: 0.000, -0.000, 1.000 But it does not move on this Z axis HELICOPTER MOVEMENT 110.09 -674.877 20.8054 //20 is z axis pos HELICOPTER MOVEMENT 110.09 -675.005 20.7984 Link to comment
burakdogancay Posted October 2, 2019 Author Share Posted October 2, 2019 It is Nodedummy and there are Objectmeshstatic elements inside.what do you think the problem might be Link to comment
Recommended Posts