Game Development Reference
In-Depth Information
tion and magnitude of the wind. If the rigid body were not moving, it would still feel
this wind. We could omit this value for a flight game that doesn't need to complicate
the players' task by adding wind. It will become very useful when we come to model
our sailing simulator in the next section, however.
This implementation uses a single tensor only. To implement control surfaces we
need to extend this in one of the ways we looked at earlier. I will choose the more
accurate approach, with three tensors to represent the characteristics of the surface at
the extremes of its operation:
Excerpt from include/cyclone/fgen.h
/**
* A force generator with a control aerodynamic surface. This
* requires three inertia tensors, for the two extremes and the 'resting'
* position of the control surface.
* The latter tensor is the one inherited from the base class;
* the two extremes are defined in this class.
*/
class AeroControl : public Aero
{
/**
* The aerodynamic tensor for the surface, when the control is at
* its maximum value.
*/
Matrix3 maxTensor;
/**
* The aerodynamic tensor for the surface, when the control is at
* its minimum value.
*/
Matrix3 minTensor;
/**
* The current position of the control for this surface. This
* should range between -1 (in which case the minTensor value is
* used) through 0 (where the base-class tensor value is used)
* to +1 (where the maxTensor value is used).
*/
real controlSetting;
private:
/**
* Calculates the final aerodynamic tensor for the current
* control setting.
*/
Search Nedrilad ::




Custom Search