AcquireTargetData

Acquire precise target data

Usage: Used in 1 task(s)

Lua Implementation

-- Acquire Target Data
function execute(params)
    local target = params.target

    if target and target:isValid() then
        local targetData = {
            location = target:getLocation3D(),
            velocity = target:getVelocity3D(),
            heading = target:getHeading(),
            type = target:getEntityType(),
            timestamp = vrf.getSimulationTime()
        }

        this:setStateProperty("TargetData", targetData)
        return true
    end
    return false
end