GE Lua Documentation

Press F to search!

vehicleSetPositionRotation

Definition


-- @/lua/ge/ge_utils.lua:456

function vehicleSetPositionRotation(id, px, py, pz, rx, ry, rz, rw)
  local bo = getObjectByID(id)
  if bo then
    bo:setPositionRotation(px, py, pz, rx, ry, rz, rw)
  else
    log('E', "vehicleSetPositionRotation", 'vehicle not found: ' .. tostring(id))
  end
end

Callers

@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/loop/getLoopVehiclePosition.lua
      local correctedRot = quat(rot) * quat(0,0,-1,0)
      vehicleSetPositionRotation(self.pinIn.vehId.value, pos[1], pos[2], pos[3], rot[1], rot[2], rot[3], rot[4])
    else
      if newPos and vehRot then
        vehicleSetPositionRotation(self.pinIn.vehId.value, newPos.x, newPos.y, newPos.z, vehRot.x, vehRot.y, vehRot.z, vehRot.w)
      else
@/lua/vehicle/recovery.lua
      end
      obj:queueGameEngineLua("vehicleSetPositionRotation("..obj:getId()..","..recPoint.pos.x..","..recPoint.pos.y..","..recPoint.pos.z..","..rot.x..","..rot.y..","..rot.z..","..rot.w..")")
    end
@/lua/vehicle/ai.lua
        "getObjectByID(" .. objectId .. "):resetBrokenFlexMesh();" ..
        "vehicleSetPositionRotation(" .. objectId .. "," .. pos.x .. "," .. pos.y .. "," .. pos.z .. "," .. rot.x .. "," .. rot.y .. "," .. rot.z .. "," .. rot.w .. ")"
      )
@/lua/ge/extensions/flowgraph/nodes/vehicle/moveTo.lua
    else
      vehicleSetPositionRotation(veh:getId(), pos[1], pos[2], pos[3], rot[1], rot[2], rot[3], rot[4])
      -- Vehicle is repaired, trigger reset hook for DNF penalty
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
    scenario.startingTransforms['scenario_player0'].rot = rot
    vehicleSetPositionRotation(scenario.vehicleNameToId['scenario_player0'], pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)
  else
    local id = scenetree.findObject("thePlayer"):getID()
    vehicleSetPositionRotation(id, pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)
  end
@/lua/ge/extensions/core/dynamicProps.lua
  local spawnPos = locationInfo.originPos + self.spawnOffset
  vehicleSetPositionRotation(propId, spawnPos.x, spawnPos.y, spawnPos.z, itemRot.x, itemRot.y, itemRot.z, itemRot.w)
  locationInfo.switched = true
@/lua/vehicle/scriptai.lua
      local rot = quatFromDir(dir:cross(up):cross(up), up)
      obj:queueGameEngineLua("getObjectByID(" .. obj:getId() .. "):autoplace(false);vehicleSetPositionRotation(" .. obj:getId() .. "," .. pos.x .. "," .. pos.y .. "," .. pos.z .. "," .. rot.x .. "," .. rot.y .. "," .. rot.z .. "," .. rot.w .. ")")
    end
@/lua/ge/extensions/flowgraph/modules/prefabModule.lua
      if veh then
        vehicleSetPositionRotation(vid, val.pos.x, val.pos.y, val.pos.z,  val.rot.x, val.rot.y, val.rot.z, val.rot.w)
        veh:requestReset(RESET_PHYSICS)
@/lua/ge/extensions/util/procTrack.lua
    scenario.startingTransforms['scenario_player0'].rot = rot
    vehicleSetPositionRotation(scenario.vehicleNameToId['scenario_player0'], pos.x, pos.y, pos.z,  rot.x, rot.y, rot.z, rot.w)
  end