Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11932


Ignore:
Timestamp:
May 3, 2018, 3:16:09 PM (7 years ago)
Author:
adamc
Message:

Fixed killing and moving of entities & commit issue

Location:
code/branches/ScriptableController_FS18
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_FS18/data/levels/BBBScriptableControllerTest.oxw

    r11928 r11932  
    3333
    3434
    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">
    3636    <attached>
    3737      <Model scale="10" mesh="drone.mesh"/>
    3838    </attached>
     39    <collisionShapes>
     40      <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" />
     41    </collisionShapes>
    3942  </AAAAutonomousDrone>
    4043   
  • code/branches/ScriptableController_FS18/data/levels/scripts/BBBScriptableControllerTest.lua

    r11928 r11932  
    11
    2 rotate_factor = 0
    3 station_loc = 200
    4 station_speed = 0
     2id = "dummy"
    53
    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 end
    13 
    14 function rotate_faster(obj1, obj2, health, shield)
    15         orxPrint("Rotating station faster")
    16 
    17         rotate_factor = rotate_factor + 0.02
    18         setAngularVelocity("Station", rotate_factor, 0, 0)
    19 end
    204
    215
     
    4630function move_dummy()
    4731        orxPrint("Moving dummy!")
    48         moveControllableEntity(id, 100.0, 0.0, 0.0)
     32        moveControllableEntity(id, 1.0, 0.0, 0.0)
    4933end
    5034
     
    5640
    5741
    58 function next_station_loc(obj1, obj2)
    59         orxPrint("Moving station")
    60 
    61         station_loc = station_loc + 500
    62         setPosition("Station", station_loc, 0, 0)
    63 
    64         station_speed = station_speed + 5
    65         setVelocity("Station", -station_speed, 0, 0)
    66 
    67         registerAtNearObject(next_station_loc, "Player", "Station", 200)
    68 end
    6942
    7043
     44move_dummy_after_timeout(5)
     45kill_dummy_after_timeout(10)
    7146
    72 
    73 
    74 move_dummy_after_timeout(3)
    75 kill_dummy_after_timeout(6)
    7647
    7748orxPrint("Script started! OMG ROFL LOL WTF")
  • code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc

    r11928 r11932  
    408408            controllable_entity = orxonox_cast<ControllableEntity*>(entity);
    409409
    410             orxout(user_warning) << "Accessed " << id << std::endl;
    411 
    412410            controllable_entity->moveFrontBack(x);
    413411            controllable_entity->moveRightLeft(y);
  • code/branches/ScriptableController_FS18/src/orxonox/worldentities/pawns/AAAAutonomousDrone.cc

    r11928 r11932  
    121121        SUPER(AAAAutonomousDrone, tick, dt);
    122122
     123
    123124        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
    124125        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
     126
     127
    125128        if (this->localLinearAcceleration_.z() > 0)
    126129            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
    127130        else
    128131            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
     132
    129133        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
    130134        this->localLinearAcceleration_.setValue(0, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.