_absolute_pos(SGVec3d::zeros()),
_relative_pos(SGVec3d::zeros()),
_direction(SGVec3d::zeros()),
- _velocity(SGVec3d::zeros()),
+ _velocity(SGVec3f::zeros()),
_orientation(SGQuatd::zeros()),
_orivec(SGVec3f::zeros()),
_base_pos(SGGeod::fromDeg(0,0)),
_absolute_pos(SGVec3d::zeros()),
_relative_pos(SGVec3d::zeros()),
_direction(SGVec3d::zeros()),
- _velocity(SGVec3d::zeros()),
+ _velocity(SGVec3f::zeros()),
_orientation(SGQuatd::zeros()),
_orivec(SGVec3f::zeros()),
_base_pos(SGGeod::fromDeg(0,0)),
_absolute_pos(SGVec3d::zeros()),
_relative_pos(SGVec3d::zeros()),
_direction(SGVec3d::zeros()),
- _velocity(SGVec3d::zeros()),
+ _velocity(SGVec3f::zeros()),
_orientation(SGQuatd::zeros()),
_orivec(SGVec3f::zeros()),
_base_pos(SGGeod::fromDeg(0,0)),
_absolute_pos(SGVec3d::zeros()),
_relative_pos(SGVec3d::zeros()),
_direction(SGVec3d::zeros()),
- _velocity(SGVec3d::zeros()),
+ _velocity(SGVec3f::zeros()),
_orientation(SGQuatd::zeros()),
_orivec(SGVec3f::zeros()),
_base_pos(SGGeod::fromDeg(0,0)),
// simulation runs into the OpenGL camera system with x-right, y-up, z-back.
SGQuatd q(-0.5, -0.5, 0.5, 0.5);
- // The cartesian position of the base sound coordinate
+ // The cartesian position of the sounds base location
SGVec3d position = SGVec3d::fromGeod(_base_pos);
_absolute_pos = position;
+#if 0
if ( _relative_pos[0] || _relative_pos[1] || _relative_pos[2] ) {
_absolute_pos += (sc2body*q).backTransform(_relative_pos);
}
+#endif
if ( _direction[0] || _direction[1] || _direction[2] ) {
- _orivec = toVec3f((sc2body*q).backTransform(toVec3d(_direction)));
+ _orivec = toVec3f( (sc2body*q).backTransform(_direction) );
}
}
* @param dir Sound emission direction
*/
inline void set_direction( const SGVec3f& dir ) {
- _direction = dir; _changed = true;
+ _direction = toVec3d(dir); _changed = true;
}
/**
* @return Orientaton vector
*/
SGVec3f& get_orientation() { return _orivec; }
- SGVec3f& get_direction() { return _direction; }
/**
* Get the inner angle of the audio cone.
// Position of the source sound.
SGVec3d _absolute_pos; // absolute position
SGVec3d _relative_pos; // position relative to the base position
- SGVec3f _direction; // orientation offset
+ SGVec3d _direction; // orientation offset
SGVec3f _velocity; // Velocity of the source sound.
// The position and orientation of this sound
// simulation runs into the OpenGL camera system with x-right, y-up, z-back.
SGQuatd q(-0.5, -0.5, 0.5, 0.5);
- _absolute_pos = position + (lc2body*q).backTransform( _position_offs );
+ _absolute_pos = position;
+#if 0
+ if (_position_offs[0] || _position_offs[1] || _position_offs[2] ) {
+ _absolute_pos += (lc2body*q).backTransform( _position_offs );
+ }
+#endif
/**
* Description: ORIENTATION is a pair of 3-tuples representing the
* behavior is undefined.
* This is in the same coordinate system as OpenGL; y=up, z=back, x=right.
*/
- SGQuatd lViewOrientation = lc2body*_orient_offs*q;
- SGVec3d sgv_up = lViewOrientation.rotate(SGVec3d::e2());
+ SGQuatd lViewOrientation = hlOr*_orient_offs*q;
+ SGVec3d sgv_up = -lViewOrientation.rotate(SGVec3d::e2());
SGVec3d sgv_at = lViewOrientation.rotate(SGVec3d::e3());
_at_up_vec[0] = sgv_at[0];
_at_up_vec[1] = sgv_at[1];