VS Addition allows storage interfaces to connect between the world and a ship, nicely snapping the ship into place (there is that issue with orientation, but whatever), and stickers can effectively grab a ship, holding it in place. All those things allow for some nice docking setups, but I noticed that neither of those can move a docked ship around - if you move interfaces or stickers via a gantry or something, docked ship just ignores them and stays where it was. I can imagine something like this might be possible with some Interactive magic, but is that the only option?
Reply chain from #42
serverShip.transformProvider = object : ServerShipTransformProvider {
@NoOptimize
override fun provideNextTransformAndVelocity(
prevShipTransform: ShipTransform,
shipTransform: ShipTransform
): ServerShipTransformProvider.NextTransformAndVelocityData? {
if (entity is CarriageContraptionEntity && isTrainDerailed(entity)) {
return null
}
val prevPos = prevShipTransform.shipToWorld.transformPosition(transform.positionInShip, Vector3d())
val velocityAtContraptionPos: Vector3dc = transform.positionInWorld.sub(prevPos, Vector3d()).mul(20.0)
val rotDiff: Quaterniondc = transform.shipToWorldRotation.difference(prevShipTransform.shipToWorldRotation, Quaterniond()).normalize()
val omega: Vector3dc = Vector3d(rotDiff.x() * 2.0, rotDiff.y() * 2.0, rotDiff.z() * 2.0).apply { if (rotDiff.w() > 0.0) mul(-1.0) }.mul(20.0)
return ServerShipTransformProvider.NextTransformAndVelocityData(transform, velocityAtContraptionPos, omega)
}
}
This conversation is on Discord · Reply there