Changeset 11932
- Timestamp:
- May 3, 2018, 3:16:09 PM (7 years ago)
- Location:
- code/branches/ScriptableController_FS18
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw
r11928 r11932 33 33 34 34 35 <AAAAutonomousDrone id=" Dummy" position="0,0,0" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">35 <AAAAutonomousDrone id="dummy" position="0,0,0"> 36 36 <attached> 37 37 <Model scale="10" mesh="drone.mesh"/> 38 38 </attached> 39 <collisionShapes> 40 <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" /> 41 </collisionShapes> 39 42 </AAAAutonomousDrone> 40 43 -
code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua
r11928 r11932 1 1 2 rotate_factor = 0 3 station_loc = 200 4 station_speed = 0 2 id = "dummy" 5 3 6 id = "Dummy"7 8 function spawn_station(obj)9 orxPrint("Spawning station")10 setPosition("Station", 500, 0, 0)11 setOrientation("Station", 0, -1, 0, 0)12 end13 14 function rotate_faster(obj1, obj2, health, shield)15 orxPrint("Rotating station faster")16 17 rotate_factor = rotate_factor + 0.0218 setAngularVelocity("Station", rotate_factor, 0, 0)19 end20 4 21 5 … … 46 30 function move_dummy() 47 31 orxPrint("Moving dummy!") 48 moveControllableEntity(id, 1 00.0, 0.0, 0.0)32 moveControllableEntity(id, 1.0, 0.0, 0.0) 49 33 end 50 34 … … 56 40 57 41 58 function next_station_loc(obj1, obj2)59 orxPrint("Moving station")60 61 station_loc = station_loc + 50062 setPosition("Station", station_loc, 0, 0)63 64 station_speed = station_speed + 565 setVelocity("Station", -station_speed, 0, 0)66 67 registerAtNearObject(next_station_loc, "Player", "Station", 200)68 end69 42 70 43 44 move_dummy_after_timeout(5) 45 kill_dummy_after_timeout(10) 71 46 72 73 74 move_dummy_after_timeout(3)75 kill_dummy_after_timeout(6)76 47 77 48 orxPrint("Script started! OMG ROFL LOL WTF") -
code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
r11928 r11932 408 408 controllable_entity = orxonox_cast<ControllableEntity*>(entity); 409 409 410 orxout(user_warning) << "Accessed " << id << std::endl;411 412 410 controllable_entity->moveFrontBack(x); 413 411 controllable_entity->moveRightLeft(y); -
code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc
r11928 r11932 121 121 SUPER(AAAAutonomousDrone, tick, dt); 122 122 123 123 124 this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_); 124 125 this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_); 126 127 125 128 if (this->localLinearAcceleration_.z() > 0) 126 129 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_); 127 130 else 128 131 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_); 132 129 133 this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_); 130 134 this->localLinearAcceleration_.setValue(0, 0, 0);
Note: See TracChangeset
for help on using the changeset viewer.