Changeset 10074 for code/branches/pickupsFS14/src/modules/jump/JumpItem.cc
- Timestamp:
- May 22, 2014, 3:05:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/src/modules/jump/JumpItem.cc
r10050 r10074 56 56 RegisterObject(JumpItem); 57 57 58 this->figure_ = 0; 59 setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 60 this->setPosition(Vector3(0,0,0)); 61 this->setVelocity(Vector3(0,0,0)); 62 this->setAcceleration(Vector3(0,0,0)); 58 attachedToFigure_ = false; 59 60 figure_ = 0; 61 height_ = 0.0; 62 width_ = 0.0; 63 setPosition(Vector3(0,0,0)); 64 setVelocity(Vector3(0,0,0)); 65 setAcceleration(Vector3(0,0,0)); 63 66 } 64 67 … … 69 72 JumpItem::~JumpItem() 70 73 { 71 /*if (this->isInitialized())72 {73 if (this->bDeleteBats_)74 delete this->figure_;75 74 76 delete[] this->batID_;77 }*/78 75 } 79 76 … … 82 79 { 83 80 SUPER(JumpItem, XMLPort, xmlelement, mode); 81 82 XMLPortParam(JumpItem, "height", setHeight, getHeight, xmlelement, mode); 83 XMLPortParam(JumpItem, "width", setWidth, getWidth, xmlelement, mode); 84 84 } 85 85 … … 94 94 { 95 95 SUPER(JumpItem, tick, dt); 96 97 // Get the current position, velocity and acceleration of the enemy. 98 Vector3 position = getPosition(); 96 // Get the current position, velocity and acceleration of the item. 97 Vector3 position = getWorldPosition(); 99 98 Vector3 velocity = getVelocity(); 100 99 … … 109 108 } 110 109 111 // Set the position, velocity and acceleration of the enemy, if they have changed.110 // Set the position, velocity and acceleration of the item, if they have changed. 112 111 if (velocity != getVelocity()) 112 { 113 113 setVelocity(velocity); 114 if (position != getPosition()) 115 setPosition(position); 116 117 114 } 118 115 } 119 116 … … 125 122 upperBoundary_ = newUpperBoundary; 126 123 127 this->setVelocity(Vector3(newHSpeed,0,newVSpeed));124 setVelocity(Vector3(newHSpeed,0,newVSpeed)); 128 125 } 129 126
Note: See TracChangeset
for help on using the changeset viewer.