prozeßhindernde Einrede im ColliderUtil vor Intermodalverkehr

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • "Construction not possible" says it all.

    Tracks on streets is not possible in the game.



    I've asked the developers to take care of the "Colliderutil".... case of throw me a nasty exception.

    Attempt at taking care of the Halfextends to be able to bypass the cyllindrical blockade on this one.



    Collider

    The collider is used whenever the potential collision between models is considered. It's possible to use the mesh data for collision calculation as well as define the collision boundaries by script.


    Collider from Mesh

    When the mesh data should be used for collision calculation, the type “MESH” is needed:

    Code
      collider = {
        params = { },
        transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, },
        type = "MESH",  },


    Collider from script

    When the boundaries should be set by script, the type “BOX”, “CYLINDER” or “POINT_CLOUD” is needed:

    Code
      collider = {
        params = {
          halfExtents = { 1.5, 1.5, 1.5, },
        },
        transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, },
        type = "BOX",  },

    The size of the volume is specified by 2 times the halfExtents properties for the “BOX” and “CYLINDER” type. It can be offsetted relative to the model origin with the transf parameter. The “POINT_CLOUD” uses a list of points that is provided in the points parameter. Each point has three values for the position on all three axis relative to the construction origin. The transf parameter is ignored.



    In /scripts/Colliderutil


    function colliderutil.createBox(center, halfExtents)

    local result = { }


    result.type = "BOX"


    if center ~= nil then result.transf = transf.transl(vec3.new(center[1], center[2], center[3])) end


    if halfExtents ~= nil then

    result.params = { }

    result.params.halfExtents = halfExtents

    end


    return result

    end


    function colliderutil.createCylinder(direction, center, halfExtents)

    local result = { }


    result.type = "CYLINDER"


    result.transf = { .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, 1.0 }


    local idx = { 1, 2, 3 }

    local invIdx = { 1, 2, 3 }

    if direction ~= nil then

    if direction == "X" then

    idx = { 3, 1, 2 }

    invIdx = { 2, 3, 1 }

    end

    if direction == "Y" then

    idx = { 1, 3, 2 }

    invIdx = { 1, 3, 2 }

    end

    end


    for i = 1, 3 do result.transf[(idx[i] - 1) * 4 + i] = 1.0 end


    if center ~= nil then

    result.transf[13] = center[1]

    result.transf[14] = center[2]

    result.transf[15] = center[3]

    end


    if halfExtents ~= nil then

    result.params = { }

    result.params.halfExtents = { halfExtents[invIdx[1]], halfExtents[invIdx[2]], halfExtents[invIdx[3]] }

    end


    return result

    end