Jump to content

[SOLVED] IG Child Entity


photo

Recommended Posts

I'm trying to attach an entity as child and then move the child in relation to the parent, but while it attaches it remains fixed in its orientation to the parent despite telling it to rotate.

AppSystemLogic::Init(){

......    

ig_manager->getEntity(1)->setType(171); //add rotordisk to the world (works fine)
   ig_manager->getEntity(1)->setParent(ig_manager->getEntity(0)); //attach the rotor to the ownship position (works fine)

......

}

AppSystemLogic::update(){

    ig_manager->getEntity(1)->setRotationEuler(vec3(Math::sin(time)*30.0f, Math::sin(time)*30.0f, 0.0f)); //change the rotation of the rotor in relation to the parent entity coordinates
vec3 rotorRotation = ig_manager->getEntity(1)->getRotationEuler(); //return the updated rotations

Log::message("the rotor disk rotation is (%f) (%f) (%f)\n", rotorRotation.x,rotorRotation.y,rotorRotation.z);//print to the console

}

 

The entity attaches fine but remains fixed in orientation to the parent instead of changing relative to the parent when I use the setRotationEuler method.  The console messages show that it should be rotating.

Video of the behavior here (the attached entity is the spinning rotor disk visible at the very top of the screen).

 

Edited by Walters.Robert
Link to comment

Hello!
Yes, this is a bug.
Please, add one line to manually control the transformation of the entity.

AppSystemLogic::Init()
{
ig_manager->getEntity(1)->setType(171); //add rotordisk to the world (works fine)
ig_manager->getEntity(1)->setParent(ig_manager->getEntity(0)); //attach the rotor to the ownship position (works fine)

ig_manager->getEntity(1)->setInterpolation(0); //THIS
}

 

One question: why are helicopter blades a separate entity, but not a articulated part? Is this your host specificity or is there a practical reason?

Link to comment
7 hours ago, cash-metall said:

One question: why are helicopter blades a separate entity, but not a articulated part? Is this your host specificity or is there a practical reason?

This is due to HOST limitations on our end.  It only sends the celestial time of day packets and entity packets.  

Link to comment
  • silent changed the title to [SOLVED] IG Child Entity
×
×
  • Create New...