Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5062 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Aug 17, 2005, 1:02:01 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: animation3D-update, so now one should be able to let the setPos/setDir away, but it does not really work

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/animation/animation.h

    r5039 r5062  
    3333typedef enum ANIM_FUNCTION
    3434{
    35   ANIM_CONSTANT,
    36   ANIM_LINEAR,
    37   ANIM_SINE,
    38   ANIM_COSINE,
    39   ANIM_EXP,
    40   ANIM_NEG_EXP,
    41   ANIM_QUADRATIC,
    42   ANIM_RANDOM,
    43   ANIM_NULL
     35  ANIM_NULL         = 0,
     36  ANIM_CONSTANT     = 1,
     37  ANIM_LINEAR       = 2,
     38  ANIM_SINE         = 3,
     39  ANIM_COSINE       = 4,
     40  ANIM_EXP          = 5,
     41  ANIM_NEG_EXP      = 6,
     42  ANIM_QUADRATIC    = 7,
     43  ANIM_RANDOM       = 8,
    4444};
    4545
  • orxonox/trunk/src/util/animation/animation3d.cc

    r4998 r5062  
    4444  this->nextKeyFrame = tmpKeyFrame;
    4545
    46   this->animFuncMov = &Animation3D::mLinear;
    47   this->animFuncRot = &Animation3D::rLinear;
     46  this->animFuncMov = NULL;//&Animation3D::mLinear;
     47  this->animFuncRot = NULL;//&Animation3D::rLinear;
    4848
    4949}
     
    9595    duration = 1.0;
    9696  // if the Rotation-Animation-function is set ANIM_NULL, animFuncRot will match animFuncRot
    97   if (animFuncMov == ANIM_NULL)
    98     animFuncMov = ANIM_DEFAULT_FUNCTION;
    99   if (animFuncRot == ANIM_NULL)
    100     animFuncRot = animFuncMov;
     97//  if (animFuncMov == ANIM_NULL)
     98//    animFuncMov = ANIM_DEFAULT_FUNCTION;
     99//  if (animFuncRot == ANIM_NULL)
     100//    animFuncRot = animFuncMov;
    101101
    102102  KeyFrame3D* tmpKeyFrame;
     
    126126  this->keyFrameCount++;
    127127}
    128 
    129 
    130128
    131129/**
     
    158156        }
    159157      /* now animate it */
    160       (this->*animFuncMov)(this->localTime);
    161       (this->*animFuncRot)(this->localTime);
     158      if (likely(this->animFuncMov != NULL))
     159        (this->*animFuncMov)(this->localTime);
     160      if (likely(this->animFuncRot != NULL))
     161        (this->*animFuncRot)(this->localTime);
    162162    }
    163163}
     
    211211      break;
    212212    default:
     213      this->animFuncMov = NULL;
    213214      break;
    214215    }
     
    353354  switch (animFuncRot)
    354355    {
    355     default:
    356356    case ANIM_CONSTANT:
    357357      this->animFuncRot = &Animation3D::rConstant;
     
    380380      break;
    381381
     382    default:
     383      this->animFuncRot = NULL;
    382384    }
    383385}
     
    448450void Animation3D::rExp(float timePassed) const
    449451{
    450   PRINTF(0)("exp rotation function not implemented\n");
     452  PRINTF(2)("exp rotation function not implemented\n");
    451453}
    452454
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r5053 r5062  
    7171    this->setEmissionPoint(1.0, 0.0, -0.35);
    7272
    73     animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    74     animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    75     animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);
    76 
    77     animation2->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    78     animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    79 
    80     animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    81     animation3->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     73    animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     74    animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     75    animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     76
     77    animation2->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     78    animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     79
     80    animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     81    animation3->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    8282  }
    8383  else if( this->leftRight == W_RIGHT)
     
    8686
    8787    this->objectComponent1->setRelCoor(Vector(0,0,0.35));
    88     animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    89     animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    90     animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);
    91 
    92     animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    93     animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    94 
    95     animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    96     animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     88    animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     89    animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     90    animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     91
     92    animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     93    animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     94
     95    animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     96    animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    9797  }
    9898}
Note: See TracChangeset for help on using the changeset viewer.