the wrong name also mislead me: rotate velocity to the proper quat

This commit is contained in:
ehofman
2009-11-19 23:01:49 +01:00
committed by Tim Moore
parent 01c62932bd
commit afb18ca75b
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -324,11 +324,12 @@ void SGSampleGroup::set_volume( float vol )
void SGSampleGroup::update_pos_and_orientation() { void SGSampleGroup::update_pos_and_orientation() {
SGVec3d position = SGVec3d::fromGeod(_base_pos) - _smgr->get_position(); SGVec3d position = SGVec3d::fromGeod(_base_pos) - _smgr->get_position();
SGQuatd ec2body= SGQuatd::fromLonLat(_base_pos) * _orientation; SGQuatd hlOr = SGQuatd::fromLonLat(_base_pos);
SGQuatd ec2body = hlOr*_orientation;
SGVec3f velocity = SGVec3f::zeros(); SGVec3f velocity = SGVec3f::zeros();
if ( _velocity[0] || _velocity[1] || _velocity[2] ) { if ( _velocity[0] || _velocity[1] || _velocity[2] ) {
velocity = toVec3f( ec2body.backTransform(_velocity*SG_FEET_TO_METER) ); velocity = toVec3f( hlOr.backTransform(_velocity*SG_FEET_TO_METER) );
} }
sample_map_iterator sample_current = _samples.begin(); sample_map_iterator sample_current = _samples.begin();
+1
View File
@@ -323,6 +323,7 @@ SGSampleGroup *SGSoundMgr::find( const string &refname, bool create ) {
// sample group was not found. // sample group was not found.
if (create) { if (create) {
SGSampleGroup* sgrp = new SGSampleGroup(this, refname); SGSampleGroup* sgrp = new SGSampleGroup(this, refname);
add( sgrp, refname );
return sgrp; return sgrp;
} }
else else