> However I got some problems about the placement of the new object. Where
> are defined the coordinates into the virtual world? I've found that every
> new object inherit the coordinates of the airplane when it's created
> (_user_lat_node->getDoubleValue(), _user_lon_node->getDoubleValue() ... are
> stored into the IC struct), but they are defined with lat, lon and alt.
> Will they be converted into another class?
> Additionally there's another problem. When the particle system is created
> it needs a 3D vector defining x, y and z. How this could be connected with
> the data obtained from the airplane and, this could involve a relocation of
> the whole object?

The original function SubmodelSystem::transform() uses very simplistic (i.e. 
wrong) calculations to determine the submodel's initial conditions.  This is 
because I didn't have the mathematics handy to do a proper transformation of 

Vivian has been working on the matrix math required, and it may take some time 
to get it working well.

The problem is this.  The submodel's position is defined in body coordinates 
(x_offset, y_offset, z_offset).  The submodel's initial velocity vector 
(relative to the airplane) is defined by (yaw_offset, pitch_offset, speed), 
also in body coordinates.   

At the time of release the airplane's position (lat, lon, alt) is known and 
its orientation (pitch, roll, yaw) is known, both in world coordinates.  A 
rotation matrix must be used to then find the submodel's initial position in 
world coordinates (lat, lon, alt).  

The velocity vector is trickier.  The airplane's velocity vector must be found 
first.  Then the submodel's initial velocity vector must be transformed to 
world coordinates.  Then the vectors need to be summed to get the submodel's 
initial condition.

David Culp

Flightgear-devel mailing list

Reply via email to