Jump to content

Wheels on moving parts (make collision move)


bdbssb

Recommended Posts

If you have ever added a wheel to a part that folds then you have probably ran in to the issue of the wheel moving but the wheel collision not?  If you figured it out great, if not here ya go.

The issue is the wheel has to be called out in the moving tool area.  I am going to copy some lines in from a plow that thumper was having issues with.  I helped him via a dm in discord.

So the key here is to know the part that is moving in the animation and the wheels that are in that part.  If you are using cylinder parts or not it will matter as well.  In the example the first 2 parts have cylinder parts (parts that move with a reference).  The last part is just a moving part with the wheels inside it.  It matters because the lines are closed off differently.  As a guide I used the krone forager to figure out how move the collisions.  They are invisible wheels.  The forage heads will pivot, they don't lock like a harvester header.

 

So here is the animation lines I looked at.

    <animations>
        <animation name="folding">

            <part node="leftWing" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 114.4"/>
            <part node="rightWing" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 -114.4"/>
            <part node="leftArm" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 -114.4"/>
            <part node="rightArm" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 114.4"/> 

            <part node="leftSupport" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 114.4"/>
            <part node="rightSupport" endTime="15" startTime="0" startRot="0 0 0" endRot="0 0 -114.4"/>     
            
        </animation>
        

        <animation name="lowerAnimation">
            <part node="bottomSupport" startTime="0" endTime="2.5" endRot="-20 0 0" startRot="0 0 0"/>
            <part node="topSupport" startTime="0" endTime="2.5" endRot="-20 0 0" startRot="0 0 0"/>
            <part node="swivel" startTime="0" endTime="2.5" endRot="20 0 0" startRot="0 0 0"/>        
            <part node="assistCylinder" startTime="0" endTime="2.5" endRot="-16.5 0 0" startRot="0 0 0"/>        
            <part node="assistRam" startTime="0" endTime="2.5" endTrans="0 0 -0.978" startTrans="0 0 -0.894"/>
        </animation>
    </animations>

 

The leftWing and rightWing are where the first and second set of wheels are.

The second set are in the swivel.

 

    <cylindered>
        <movingTools>
            <movingTool node="leftWing" playSound="true" wheelIndices="1">
                <dependentPart node="leftCylinder"/>
            </movingTool>
            <movingTool node="rightWing" playSound="true" wheelIndices="2">
                <dependentPart node="rightCylinder"/>
            </movingTool>
            <movingTool node="swivel"  wheelIndices="7 8 9 10"/>
        </movingTools>
        <movingParts>
            <movingPart node="leftCylinder" referencePoint="leftJointHyd" referenceFrame="0" isActiveDirty="true">
                <translatingPart node="leftRam"/>
            </movingPart>
            <movingPart node="rightCylinder" referencePoint="rightJointHyd" referenceFrame="0" isActiveDirty="true">
                <translatingPart node="rightRam"/>
            </movingPart>  
        </movingParts>
        <sounds>
            <hydraulic template="DEFAULT_HYDRAULIC_SOUND"/>
        </sounds>
    </cylindered>

 

As you can see the leftWing and rightWing have cylinder parts, the swivel does not.  That is why they are closed off differently.  The swivel line would not normally be there but it had to be added to call out the wheel indices.  As you can see all that had to be done was to add the wheelIndices comand in so that the game engine knows that there are wheels inside the moving part.  When indexing indices you start with 1.  So simply wheel 1 is in the leftWing, wheel 2 is in the rightWing, and wheels 7 8 9 10 are in the swivel.  I know this would probably be better explained in a video however I wanted to add it here quick to help those that may have had an issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now