Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10733 in orxonox.OLD for branches/presentation


Ignore:
Timestamp:
Jun 20, 2007, 2:41:51 PM (17 years ago)
Author:
nicolasc
Message:

AbsDir fix, quite a hack

Location:
branches/presentation/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/weapons/disruptor.cc

    r10728 r10733  
    125125
    126126
    127   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.0333, ANIM_LINEAR, ANIM_NULL);
     127  this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
    128128  this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
    129   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     129//   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
    130130
    131131  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
  • branches/presentation/src/world_entities/weapons/nadion_laser.cc

    r10728 r10733  
    142142  pj->setParent(PNode::getNullParent());
    143143
    144   Vector tmp = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
     144  Vector dir = (this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor()).getNormalized();
     145  // HACK direction AbsDir calulation
     146  Vector up = dir.cross(VECTOR_RAND(1));
    145147
    146   pj->setVelocity(this->getParent()->getVelocity() + (tmp.getNormalized())*160);
     148  //force a resoable up vector
     149  while (up.len() < .0001)
     150    up = dir.cross(VECTOR_RAND(1));
     151
     152  pj->setVelocity(this->getParent()->getVelocity() + (dir)*160);
    147153
    148154  pj->setAbsCoor(this->getEmissionPoint());
    149155//   pj->setAbsDir(Quaternion(this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor(), Vector(0,0,0)));
    150156//   pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0))));
    151 
     157  pj->setAbsDir(Quaternion(dir, up.getNormalized()));
     158 
    152159  pj->setAbsDir(this->getAbsDir());
    153160  pj->activate();
Note: See TracChangeset for help on using the changeset viewer.