Lance R. Marrou (marrou++at++vsl.ist.ucf.edu)
Thu, 3 Nov 1994 13:24:19 -0500 (EST)
I am attempting to optimize the modification of DCSes for movable parts.
Here is what I currently have:
pre-set or compute the position and translation matrix for each movable
part:
PFSET_VEC3(overhead_pt, 0.00f, 4.73f, 1.85f);
PFMAKE_TRANS_MAT(omat1,-overhead_pt[PF_X],-overhead_pt[PF_Y],
-overhead_pt[PF_Z]);
PFMAKE_TRANS_MAT(omat2,overhead_pt[PF_X],overhead_pt[PF_Y],
overhead_pt[PF_Z]);
// other movable parts...
then, while simulating, update the respective DCSes:
if (msg.articulatedParts[i].parameterType ==
BRIDGE_OVERHEAD_COMPONENT + ELEVATION)
{
if (overhead &&
!(data.articulatedParts[i].parameterValue1 >=
msg.articulatedParts[i].parameterValue1 - .05 &&
data.articulatedParts[i].parameterValue1 <=
msg.articulatedParts[i].parameterValue1 + .05))
{
data.articulatedParts[i].parameterValue1 =
msg.articulatedParts[i].parameterValue1;
pfMakeEulerMat(mat2, 0.0f, data.articulatedParts[i].parameterValue1, 0.0f);
pfMultMat(mat1,omat1,mat2);
pfMultMat(mat1,mat1,omat2);
pfDCSMat(overhead,mat1);
}
}
// other movable parts...
As you might be able to tell, these are DIS articulated parts on part of an
AVLB. The second part of the if only updates the DCS on a threshold differnce
greater than or equal to 5/100 of a degree. I pulled this out of the
Performer PFALMOSTEQUAL_VEC3 (or something like that). IT works great, but
I want to also optimizee the matrix calculations. 2 mults and that Euler
matrix generation can be painful. IS there another way to do this? If you
can't see what is happening, I need to translate the DCS to the origin by
the overhead_pt before applying the rotation ,and then translate it back.
Thanks for any input! By the way, the above big if statement increases
performance on an Extreme by 2-5 Hz. Of course, this only works well if
you dead reckon incoming vehicles properly.
_______________________________________________________
IST __ E-mail: marrou++at++vsl.ist.ucf.edu
Visual / / ______ /\____ ______ ______
Systems / / / _ / / __ // ____// ____/
Lab / /__ / /_/ / / / / // /___ / __/_ R. Marrou
________/____//____/\\/_/ /_//_____//_____/____________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:38 PDT