leezer3 / OpenBVE

OpenBVE- A free train simulator
http://www.openbve-project.net
275 stars 52 forks source link

Coupler Miscellany #852

Open JunmoreHeavyBox opened 1 year ago

JunmoreHeavyBox commented 1 year ago

Initial title Splitting the coupler in half

Example

<Car>
    <Coupler>
        <Front />
        <Rear />
    </Coupler>
</Car>

or

<Coupler />
<Car />
<Coupler />

For the Car.xml file

I want to restrict the marshalling of vehicle combinations to the Train.xml file without disturbing other files.

JunmoreHeavyBox commented 1 year ago

I'm going to put this Issue on hold. This is an Issue that was opened at an inopportune time and I'm not sure it was ever mentioned or on the list.

Perhaps this will be mentioned in the Issue and PR on vehicle coupling and separation.

JunmoreHeavyBox commented 1 year ago

Ah I almost forgot about it. After putting up the waiting sign, I've been thinking about changing the theme and reuse the issue.

JunmoreHeavyBox commented 11 months ago

@leezer3 Give me an opinion.

leezer3 commented 11 months ago

No real plans to do anything with this at the minute I'm afraid- Adding anchor points would need code writing to handle distortion and a bunch of other stuff into the bargain.

If you want to start building complex couplers in this manner, you're probably better off using a dummy car.

JunmoreHeavyBox commented 1 month ago

It's been too long, I didn't even plan on making new pictures. Old Pictures... FCOPit1 5 Classic Coupler The object attached to the bogie point line. FCOPit1 2 Anchor point objects The object attached to the car peg point line.

JunmoreHeavyBox commented 1 week ago

The current idea is to set points on the car frame and connect the points of adjacent cars to obtain the angle of the coupler rotation object. It can be analogized as two billboards variable that looks at each other on two different cars.

<Points>
    <FrontPosition>0,0,Length/2-CpF</FrontPosition>
    <RearPosition>0,0,-Length/2-CpR</RearPosition>
</Points>
[Object]
States = CouplerOpen.b3d,CouplerClose.b3d
StateFunction = FrontCoupler
Position = 0,0,Length/2-CpF
RotateYFunction = Pi+FrontPointY[0]
; My front pivot point is connected to the rear pivot point of the prev car
[Object]
States = CouplerOpen.b3d,CoupleClose.b3d
StateFunction = RearCoupler
Position = 0,0,-Length/2-CpR
RotateYFunction = RearPointY[0]
; My rear pivot point is connected to the front pivot point of the next car

I don't care distortion of this. This can be the compression motion of a semi-permanent drawbar buffer.

JunmoreHeavyBox commented 1 week ago

Further idea

<Points>
  <Front>
    <Position>0,0,Length/2-CpF</Position>
    <Object>CouplerHeadFront.animated</Object>
    <Deformable>False</Deformable>
  </Front>
  <Rear>
    <Position>0,0,-Length/2-CpR</Position>
    <Object>CouplerHeadRear.animated</Object>
    <Deformable>False</Deformable>
  </Rear>
</Points>
[Object]
Position = 0,0,Length/2-CpF
States = CouplerRod.b3d
RotateYFunction = Pi+FrontPointY[0]
[Object]
Position = 0,0,-Length/2-CpR
States = CouplerRod.b3d
RotateYFunction = RearPointY[0]
; When there are no cars in front and rear, the pivot point has no angle.
[Object]
Position = 0,0,Length/2+(CouplerLength[CarNumber-1]/2)
States = CouplerHeadOpen.b3d
StateFunction = FrontCoupler
RotateYFunction = Pi
[Object]
Position = 0,0,Length/2+(CouplerLength[CarNumber]/2)
States = CouplerHeadOpen.b3d
StateFunction = RearCoupler
; CouplerHeadFront File
[Object]
Position = 0,0,CpF+(CouplerLength[CarNumber-1]/2)
States = Null,CouplerHeadClose.b3d
StateFunction = FrontCoupler
RotateYFunction = Pi

; CouplerHeadRear File
[Object]
Position = 0,0,CpR+(CouplerLength[CarNumber]/2)
States = Null,CouplerHeadClose.b3d
StateFunction = RearCoupler

I don't know how to describe it anymore...