Changeset 3888 in orxonox.OLD for orxonox/trunk/src/world_entities
- Timestamp:
- Apr 19, 2005, 1:16:16 AM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/test_gun.cc
r3886 r3888 47 47 this->leftRight = leftRight; 48 48 49 if( this->leftRight == 0)50 this->projOffset = new Vector(1.0, 0.0, -0.35);51 else if( this->leftRight == 1)52 this->projOffset = new Vector(1.0, 0.0, 0.5);53 54 55 //this->dummy1 = new WorldEntity(); // a world entity that is not drawed: use this for the weapon56 49 this->objectComponent1 = new PNode(); 57 50 this->animation1 = new Animation3D(this->objectComponent1); 58 59 51 parent->addChild(this->objectComponent1, PNODE_ALL); 60 52 … … 63 55 if( this->leftRight == W_LEFT) 64 56 { 57 this->projectileOffset = Vector(1.0, 0.0, -0.35); 58 65 59 this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR); 66 60 this->animation1->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR); … … 69 63 else if( this->leftRight == W_RIGHT) 70 64 { 65 this->projectileOffset = Vector(1.0, 0.0, 0.5); 66 71 67 this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR); 72 68 this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_LINEAR); … … 119 115 return; 120 116 } 117 121 118 Projectile* pj = new TestBullet(this); 122 123 pj->setAbsCoor(this->getAbsCoor() + *this->projOffset); 119 pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset); 124 120 pj->setAbsDir(this->getAbsDir()); 125 126 121 pj->setFlightDirection(this->getAbsDir()); 127 122 pj->setSpeed(this->getSpeed()); 128 129 123 this->worldEntities->add(pj); 130 124 this->localTime = 0; -
orxonox/trunk/src/world_entities/test_gun.h
r3886 r3888 51 51 virtual void draw(void); 52 52 53 private: 54 Animation3D* animation; 55 Vector* projOffset; 56 int leftRight; // this will become an enum 53 54 57 55 58 56 }; -
orxonox/trunk/src/world_entities/weapon.cc
r3881 r3888 52 52 /* 53 53 i dont have to delete the weapons itself, because they are 54 worldentities and therefore in the entities list of the world 54 worldentities and therefore in the entities list of the world. 55 world will clean them up for me 55 56 */ 56 57 for(int i = 0; i < W_MAX_CONFIGS; ++i) … … 207 208 WorldInterface* wi = WorldInterface::getInstance(); 208 209 this->worldEntities = wi->getEntityList(); 210 211 this->objectComponent1 = NULL; 212 this->objectComponent2 = NULL; 213 this->objectComponent3 = NULL; 214 215 this->animation1 = NULL; 216 this->animation2 = NULL; 217 this->animation3 = NULL; 209 218 } 210 219 … … 216 225 { 217 226 // model will be deleted from WorldEntity-destructor 227 //this->worldEntities = NULL; 228 229 /* dont delete objectComponentsX here, they will be killed when the pnodes are cleaned out */ 230 231 /* all animations are deleted via the animation player*/ 218 232 } 219 233 -
orxonox/trunk/src/world_entities/weapon.h
r3886 r3888 172 172 Animation3D* animation3; 173 173 174 Vector *projectileOffset;174 Vector projectileOffset; 175 175 int leftRight; // this will become an enum 176 176
Note: See TracChangeset
for help on using the changeset viewer.