Changeset 9371 for code/branches/release2012
- Timestamp:
- Sep 6, 2012, 2:16:41 PM (12 years ago)
- Location:
- code/branches/release2012
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/release2012/data/levels/underAttack.oxw
r9370 r9371 46 46 <?lua end ?> 47 47 48 49 48 <!--- A SpaceBoundary moving along with the transporter, in order to filter out bots that are too far away from the transporter ----> 49 <MovableEntity 50 position="0,0,0" 51 velocity="-35,0,0" 52 > 53 <attached> 54 <SpaceBoundaries position="1,2,3" maxDistance="1600" warnDistance="300" showDistance="300" reactionMode="1" healthDecrease="5.0" /> 55 <BlinkingBillboard 56 position="0,0,0" 57 material="Flares/ringflare2" 58 colour="1.0, 0.5, 0.3" 59 phase="-180" 60 amplitude=0.1 61 frequency=0.5 62 quadratic=1 63 /> 64 </attached> 65 </MovableEntity> 50 66 51 67 … … 63 79 64 80 <attached> 65 <TeamSpawnPoint team=1 position=" 150,0,-50" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />66 <TeamSpawnPoint team=1 position=" 0,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />67 <TeamSpawnPoint team=1 position="- 50,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />81 <TeamSpawnPoint team=1 position="200,0,20" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /> 82 <TeamSpawnPoint team=1 position="50,0,100" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /> 83 <TeamSpawnPoint team=1 position="-200,0,20" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /> 68 84 <TeamSpawnPoint team=1 position="100,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /> 69 <TeamSpawnPoint team=1 position=" 50,0,-50" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />85 <TeamSpawnPoint team=1 position="400,0,20" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /> 70 86 <?lua for i = 1, 100, 1 do ?> 71 87 <TeamSpawnPoint 72 88 team=0 73 position="<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>"89 position="<?lua print((math.random() * 450 + 450) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 450 + 450) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 450 + 450) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>" 74 90 lookat="0,0,0" 75 91 spawnclass=SpaceShip -
code/branches/release2012/src/modules/objects/SpaceBoundaries.cc
r8858 r9371 117 117 this->billboards_[current].usedYet = true; 118 118 119 Vector3 directionVector = (this->get Position() - position).normalisedCopy(); // vector from the position of the billboard to the center of the sphere119 Vector3 directionVector = (this->getWorldPosition() - position).normalisedCopy(); // vector from the position of the billboard to the center of the sphere 120 120 this->billboards_[current].billy->setCommonDirection(directionVector); 121 121 … … 252 252 if(item != NULL) 253 253 { 254 Vector3 itemPosition = item->get Position();255 return (itemPosition.distance(this->get Position()));254 Vector3 itemPosition = item->getWorldPosition(); 255 return (itemPosition.distance(this->getWorldPosition())); 256 256 } else { 257 257 return -1; … … 267 267 { 268 268 269 Vector3 direction = item->get Position() - this->getPosition();269 Vector3 direction = item->getWorldPosition() - this->getWorldPosition(); 270 270 direction.normalise(); 271 271 272 Vector3 boundaryPosition = this->get Position() + direction * this->maxDistance_;272 Vector3 boundaryPosition = this->getWorldPosition() + direction * this->maxDistance_; 273 273 274 274 this->positionBillboard(boundaryPosition, alpha); … … 277 277 void SpaceBoundaries::conditionalBounceBack(Pawn *item, float currentDistance, float dt) 278 278 { 279 Vector3 normal = item->get Position() - this->getPosition();279 Vector3 normal = item->getWorldPosition() - this->getWorldPosition(); 280 280 normal.normalise(); 281 281 Vector3 velocity = item->getVelocity(); … … 300 300 acceleration = acceleration.reflect(*normal); 301 301 302 item->lookAt( *velocity + this->get Position() );302 item->lookAt( *velocity + this->getWorldPosition() ); 303 303 304 304 item->setAcceleration(acceleration * dampingFactor); 305 305 item->setVelocity(*velocity * dampingFactor); 306 306 307 item->setPosition( item->get Position() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary.307 item->setPosition( item->getWorldPosition() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary. 308 308 } 309 309
Note: See TracChangeset
for help on using the changeset viewer.