Jump to content

Turret head 360 rotation


Chelaru

Recommended Posts

Hello,


I want to make the head of the turret to rotate 360'.


The maxHeading = 90; is not doing anything.


 

void TurretShape::_setRotation(const Point3F& rot)
{
  _updateNodes(rot);

  mShapeInstance->animate();

  mRot = rot;
}

 

This is the function that should do something with the rotation. I think mShapeInstance->animate(); playes the animation. (The thing is that i loaded the models in blender and can't find the animation).


My problem is that i don't understand how to make the turret head rotate 360'.

Link to comment
Share on other sites

  • 1 month later...

My understanding is that it is not animated in Blender. The document says...


Shape File Nodes The shape file used for the TurretShape needs to have a number of defined nodes. The first node

is named ‘heading’. The heading node is special in that it is controlled by the TurretShape code. This means that it

should not be animated by the artist, nor should it have anything but the default transform applied to it. This doesn’t

stop the heading node’s parent or its children from being animated, however.


I am trying this too but have not managed to get it to move. This is the command: setTurretEulerRotation(...);

Link to comment
Share on other sites

Perhaps your right, I merely based my response on a test I did using 3d Max, which is what the GG artists used, not Blender. It seems to me that the rotation is controlled by the animation of the node but perhaps there is a way to do it in pure code. The documentation also talks about turrets controlled by player. In my attempt I tried everything. I could mount and dismount, I could fire the gun but all attempts to have the turret move with player mouse control failed. I hope there is a way.

Link to comment
Share on other sites

I have also tried everything. Even in the console window the setTurretEulerRotation command does nothing. The getTurretEulerRotation returns the turret position and if you do it after the set then it shows that the turret has moved but image still in same place.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...