[Orxonox-commit 7315] r11932 - in code/branches/ScriptableController_FS18: data/levels data/levels/scripts src/orxonox/scriptablecontroller src/orxonox/worldentities/pawns
adamc at orxonox.net
adamc at orxonox.net
Thu May 3 15:16:09 CEST 2018
Author: adamc
Date: 2018-05-03 15:16:09 +0200 (Thu, 03 May 2018)
New Revision: 11932
Modified:
code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw
code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua
code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc
Log:
Fixed killing and moving of entities & commit issue
Modified: code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw
===================================================================
--- code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw 2018-05-03 12:57:35 UTC (rev 11931)
+++ code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw 2018-05-03 13:16:09 UTC (rev 11932)
@@ -32,10 +32,13 @@
<SpawnPoint team=0 position="100,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
- <AAAAutonomousDrone id="Dummy" position="0,0,0" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
+ <AAAAutonomousDrone id="dummy" position="0,0,0">
<attached>
<Model scale="10" mesh="drone.mesh"/>
</attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" />
+ </collisionShapes>
</AAAAutonomousDrone>
Modified: code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua
===================================================================
--- code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua 2018-05-03 12:57:35 UTC (rev 11931)
+++ code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua 2018-05-03 13:16:09 UTC (rev 11932)
@@ -1,24 +1,8 @@
-rotate_factor = 0
-station_loc = 200
-station_speed = 0
+id = "dummy"
-id = "Dummy"
-function spawn_station(obj)
- orxPrint("Spawning station")
- setPosition("Station", 500, 0, 0)
- setOrientation("Station", 0, -1, 0, 0)
-end
-function rotate_faster(obj1, obj2, health, shield)
- orxPrint("Rotating station faster")
-
- rotate_factor = rotate_factor + 0.02
- setAngularVelocity("Station", rotate_factor, 0, 0)
-end
-
-
function kill_player()
orxPrint("Killing player")
killPawn("Player")
@@ -45,7 +29,7 @@
function move_dummy()
orxPrint("Moving dummy!")
- moveControllableEntity(id, 100.0, 0.0, 0.0)
+ moveControllableEntity(id, 1.0, 0.0, 0.0)
end
function move_dummy_after_timeout(seconds)
@@ -55,25 +39,12 @@
end
-function next_station_loc(obj1, obj2)
- orxPrint("Moving station")
- station_loc = station_loc + 500
- setPosition("Station", station_loc, 0, 0)
- station_speed = station_speed + 5
- setVelocity("Station", -station_speed, 0, 0)
+move_dummy_after_timeout(5)
+kill_dummy_after_timeout(10)
- registerAtNearObject(next_station_loc, "Player", "Station", 200)
-end
-
-
-
-
-move_dummy_after_timeout(3)
-kill_dummy_after_timeout(6)
-
orxPrint("Script started! OMG ROFL LOL WTF")
mytestfunction(3.0, 4.0)
Modified: code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc 2018-05-03 12:57:35 UTC (rev 11931)
+++ code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc 2018-05-03 13:16:09 UTC (rev 11932)
@@ -407,8 +407,6 @@
{
controllable_entity = orxonox_cast<ControllableEntity*>(entity);
- orxout(user_warning) << "Accessed " << id << std::endl;
-
controllable_entity->moveFrontBack(x);
controllable_entity->moveRightLeft(y);
controllable_entity->moveUpDown(z);
Modified: code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc 2018-05-03 12:57:35 UTC (rev 11931)
+++ code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc 2018-05-03 13:16:09 UTC (rev 11932)
@@ -120,12 +120,16 @@
{
SUPER(AAAAutonomousDrone, tick, dt);
+
this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
+
+
if (this->localLinearAcceleration_.z() > 0)
this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
else
this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+
this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
this->localLinearAcceleration_.setValue(0, 0, 0);
More information about the Orxonox-commit
mailing list