Changeset 4972 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/test_gun.cc
- Timestamp:
- Aug 7, 2005, 10:32:23 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4966 r4972 39 39 using namespace std; 40 40 41 CREATE_FACTORY(TestGun); 41 42 42 43 /** … … 48 49 : Weapon(weaponManager) 49 50 { 50 this->setClassID(CL_TEST_GUN, "TestGun");51 52 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);53 51 this->leftRight = leftRight; 54 52 … … 63 61 animation2->setInfinity(ANIM_INF_CONSTANT); 64 62 animation3->setInfinity(ANIM_INF_CONSTANT); 63 65 64 if( this->leftRight == W_LEFT) 66 67 68 69 70 71 72 73 74 75 76 77 78 65 { 66 this->setEmissionPoint(1.0, 0.0, -0.35); 67 68 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 69 animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 70 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 71 72 animation2->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 73 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 74 75 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 76 animation3->addKeyFrame(Vector(0.0, 0.0, -1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 77 } 79 78 else if( this->leftRight == W_RIGHT) 80 { 81 this->setEmissionPoint(1.0, 0.0, 0.5); 82 83 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 84 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 85 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 86 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 87 88 animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 89 animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 90 91 animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 92 animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 93 } 94 /* 95 this->fireSound = (SoundBuffer*)ResourceManager::getInstance()->load("sound/shot1.wav", WAV); 96 this->weaponSource = new SoundSource(this->fireSound, this); 97 this->weaponSource->setRolloffFactor(.1);*/ 98 Projectile* p = new TestBullet(); 99 100 // ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p); 101 //ObjectManager::getInstance()->debug(); 79 { 80 this->setEmissionPoint(1.0, 0.0, 0.5); 81 82 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); 83 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 84 animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); 85 animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT); 86 87 animation2->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 88 animation2->addKeyFrame(Vector(.0, .0, .0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 89 90 animation3->addKeyFrame(Vector(.0, .0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 91 animation3->addKeyFrame(Vector(.0, .0, 1.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 92 } 93 } 94 95 96 TestGun::TestGun(const TiXmlElement* root) 97 { 98 this->init(); 99 this->loadParams(root); 100 } 101 102 /** 103 * standard deconstructor 104 */ 105 TestGun::~TestGun () 106 { 107 // model will be deleted from WorldEntity-destructor 108 } 109 110 111 void TestGun::init() 112 { 113 this->setClassID(CL_TEST_GUN, "TestGun"); 114 115 this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN); 102 116 103 117 this->setStateDuration(WS_SHOOTING, .4); … … 117 131 118 132 119 /** 120 * standard deconstructor 121 */ 122 TestGun::~TestGun () 123 { 124 // model will be deleted from WorldEntity-destructor 133 void TestGun::loadParams(const TiXmlElement* root) 134 { 135 136 125 137 } 126 138
Note: See TracChangeset
for help on using the changeset viewer.