de-Roo.Lukas Posted February 6, 2018 Share Posted February 6, 2018 Hi, I just studying the demo of CIGI is the rotation of player_cigi(game player) is the same as the entity? The cigi protocol sent the entity eulrer degrees information : when I try to use vec3 eulrer = decomposeRotationXYZ(mat3(player_cigi->getWorldRotation())); to find out whether the player_cigi and entity has the same eulrer degrees, I found that they are not the same. Why? and if I want to convert a eulrer to quaternion , I need to use quat ( ICigiEntityControl*control->getRotation()) is it right? but I found that the result is not right, the value doesn't change after the transformation. Link to comment
alexander Posted February 6, 2018 Share Posted February 6, 2018 Hi de-Roo.Lukas, Quote is the rotation of player_cigi(game player) is the same as the entity? No. First, CIGI uses a Z->Y->X order rotations (also known as: yaw, pitch, roll). But, in our system, default order is X->Y->Z (and you tried to use decomposeRotationXYZ instead of decomposeRotationZYX). Second, the final rotation of the entity consists of two parts: inner rotation (what CIGI sent to IG) and outer rotation (rotation around normal/tangent/binormal vectors of the terrain in current point of the world). Even "flat" terrain rotate the object along two axes (the farther from the GeodeticPivot - the more influence). Quote and if I want to convert a eulrer to quaternion , I need to use quat ( ICigiEntityControl*control->getRotation()) is it right? Do you have access to the source of the CIGI plugin? It is located at: <UNIGINE_SDK>/sdks/<your_version_of_SDK>/source/plugins/Network/CigiClient/architecture/ Look at the Entity.cpp (void Cigi::Entity::setTransform method) and CigiMath.h/cpp file (all methods) for details. Best regards, Alexander Link to comment
Recommended Posts