getDriverDataById
Definition
-- @/lua/ge/extensions/core/camera.lua:433
local function getDriverDataById(vehId)
local camNodeID, rightHandDrive, rightHandDoor = nil, false, false
local vdata = getVehicleData()[vehId]
if not vdata then return camNodeID, rightHandDrive, rightHandDoor end
if not vdata.cameras then return camNodeID, rightHandDrive, rightHandDoor end
local cam = vdata.cameras["onboard.driver"]
if not cam then return camNodeID, rightHandDrive, rightHandDoor end
camNodeID, rightHandDrive, rightHandDoor = cam.camNodeID, cam.rightHandCamera or false, cam.rightHandDoor or false -- convert nil to false
return camNodeID, rightHandDrive, rightHandDoor
end
Callers
@/lua/ge/extensions/tech/utils.lua
local vid = be:getPlayerVehicleID(0)
local driverNodePos = veh:getNodePosition(core_camera.getDriverDataById(vid))
local args = {}
@/lua/ge/extensions/gameplay/walk.lua
local camPos = core_camera.getPosition()
local driverNode = core_camera.getDriverDataById(unicycle:getId())
local driverPos = unicycle:getPosition() + unicycle:getNodePosition(driverNode or 0)
@/lua/ge/extensions/core/camera.lua
local function getDriverData(veh)
return getDriverDataById(veh and veh:getId())
end
@/lua/ge/extensions/core/cameraModes/crash.lua
local veh2 = scenetree.findObjectById(data.veh2Id)
local driverNode = core_camera.getDriverDataById(veh2:getId())
if driverNode then
-- go to driver cam first
local driverNode = core_camera.getDriverDataById(veh2:getId())
local driverPos = veh2:getPosition() + veh2:getNodePosition(driverNode or 0)
@/lua/ge/extensions/core/vehicle/mirror.lua
if not viewFrustum:isPointContained(absoluteMPos) then
local camPos = veh:getInitialNodePosition(core_camera.getDriverDataById(vid))
local rot = quatFromDir( (camPos-mpos) , vec3(0,0,1) )