Jump to content

Relationship between player_cigi and ientity_control


photo

Recommended Posts

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 :

Untitled16.png.f17a1a5b91afb110668afc5345536d12.png 

 

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.

Untitled17.png.7816138de81ca1d636245dce843ecf0e.png

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. 

Untitled18.png.af7d3f4f4cb8353b1a9fbd5a25134931.png

Link to comment

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
×
×
  • Create New...