Road Mesh Tool - Possible Fix For No Collision

Discussion in 'Programming' started by ultranew_b, Dec 4, 2013.

  1. ultranew_b

    ultranew_b
    Expand Collapse

    Joined:
    Nov 12, 2013
    Messages:
    140
    Hey,

    AFter adding a road tool mesh to my level, I discovered there is no collision on it. After searching the forums here for a solution, I found nothing.

    Expanding my search i came across this thread on the GG forums.

    ...problem is, i'm not a coder. lol

    http://www.garagegames.com/community...wthread/130181


    If someone could implement this into the build, that would be awesome !


    :D
     
  2. JDMClark

    JDMClark
    Expand Collapse

    Joined:
    Aug 10, 2013
    Messages:
    1,347
    This looks interesting I hope a dev looks at this and sees a possibility. Would be perfect to use the road mesh tool instead of painting a rough surface with a road image.
     
  3. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    I have a map on the making full of road meshes... I stopped working on it because there is no support for them and I don't feel like remaking all the roads....
     
  4. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    This will not work since we do not use PhysX. We are aware of this problem and will fix it at some point - stay tuned :)
     
  5. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    wow nice!! :D
     
  6. ultranew_b

    ultranew_b
    Expand Collapse

    Joined:
    Nov 12, 2013
    Messages:
    140
    kk thanks.

    I was actually going to use the MeshRoad tool to make Guardrails.

    The link I posted also has code for the Bullet physics system as well as Physx.

    "I implemented collision on meshRoads a while back, I went the mPhysicsRep route though, allowing the use of PhysX or Bullet

    in meshRoad.cpp

    view plaincopy to clipboardprint?


    • MeshRoad::MeshRoad()
    • : mTextureLength( 5.0f ),
    • mBreakAngle( 3.0f ),
    • mPhysicsRep( NULL ), //added
    • mWidthSubdivisions( 0 )
    • {.........
    • void MeshRoad::eek:nRemove()
    • {
    • SAFE_DELETE( mPhysicsRep ); //added
    • ............
    • void MeshRoad::setTransform( const MatrixF &mat )
    • {
    • .........
    • .........
    • Parent::setTransform( mat );
    • if ( mPhysicsRep ) //added
    • mPhysicsRep->setTransform( mat ); //added
    • void MeshRoad::_generateSegments()
    • {
    • ........
    • ........
    • ........
    • if ( isClientObject() )
    • _generateVerts();
    • //DS PHYSICSREP ADDED
    • if ( PHYSICSMGR )
    • {
    • ConcretePolyList polylist;
    • if (buildPolyList(PLC_Collision, &polylist, getWorldBox(), getWorldSphere()))
    • {
    • polylist.triangulate();
    • PhysicsCollision *colShape = PHYSICSMGR->createCollision();
    • colShape->addTriangleMesh( polylist.mVertexList.address(),
    • polylist.mVertexList.size(),
    • polylist.mIndexList.address(),
    • polylist.mIndexList.size() / 3,
    • MatrixF::Identity );
    • PhysicsWorld *world = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );
    • mPhysicsRep = PHYSICSMGR->createBody();
    • mPhysicsRep->init( colShape, 0, 0, this, world );
    • }
    • }
    • //DS END ADDED
    • }


    and in meshRoad.h at the end

    view plaincopy to clipboardprint?


    • ........
    • ........
    • ........
    • Vector<MeshRoadConvex*> mDebugConvex;
    • PhysicsBody *mPhysicsRep; // added
    • };
    • #endif // _MESHROAD_H_


    Not sure if this is useful or not.

    :D
     
    #6 ultranew_b, Dec 5, 2013
    Last edited: Dec 5, 2013
  7. KennyWah

    KennyWah
    Expand Collapse

    Joined:
    Jan 16, 2013
    Messages:
    2,630

    I would like to know, but is there anyway for a user to implement this in game? because I would love to know.
    also I am sorry for digging up this old grave, but I have been looking around about this issue.
     
  8. BlackVenom

    BlackVenom
    Expand Collapse

    Joined:
    Dec 31, 2012
    Messages:
    128
    Can't wait for this fix. I'm too bald to pull any more hair out making smooth banked curves : P

    From the looks of it no. Unless you have the source code to beamng/torque.
     
  9. KennyWah

    KennyWah
    Expand Collapse

    Joined:
    Jan 16, 2013
    Messages:
    2,630
    sorry if that was a dumb question btw, i just don't know alot about code (i know some but not enough to script very much)
     
  10. BlackVenom

    BlackVenom
    Expand Collapse

    Joined:
    Dec 31, 2012
    Messages:
    128
    Nope, valid question. If only it were possible to do so. :D
     
  11. Braindead

    Braindead
    Expand Collapse

    Joined:
    Jan 22, 2014
    Messages:
    125
    I know I'm bumping an old thread here and replying to a very old message but as far as I'm aware the feature still isn't implemented, and it beats making a duplicate thread.
    Any update on mesh roads being officially implemented? Making smooth roads in game is incredibly hard and I'm not sure how to import 3d models into in-game roads. I'm sure this isn't exactly right around the corner but it would be cool to know how far up (or down) the list of priorities it is. :)
     
  12. JDMClark

    JDMClark
    Expand Collapse

    Joined:
    Aug 10, 2013
    Messages:
    1,347
    Honestly if your skilled at a sketchup you can easily make a mesh and port it. There is a tutorial for sketchup importing and it's very easy

    Sent through the stars by my Galaxy with a Note for you!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice