Skip to content

Commit

Permalink
Changed: StickerConstraintManager was missing values from the confi…
Browse files Browse the repository at this point in the history
…g & changed default values.
  • Loading branch information
xiewuzhiying committed Nov 14, 2024
1 parent 03e622d commit 3c15177
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ object VSAdditionConfig {

class CREATE {
@JsonSchema(description = "Compliance of sticker's constraints")
var stickerCompliance : Double = 1e-128
var stickerCompliance : Double = 1e-10

@JsonSchema(description = "Max Force of sticker's constraints")
var stickerMaxForce : Double = 1e300
var stickerMaxForce : Double = 1e10

@JsonSchema(description = "Enable encased fan to work between ships")
var encasedFanMixin : Boolean = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.xiewuzhiying.vs_addition.compats.create.content.contraptions.chassis.sticker

import io.github.xiewuzhiying.vs_addition.VSAdditionConfig
import io.github.xiewuzhiying.vs_addition.context.constraint.ConstraintGroup
import io.github.xiewuzhiying.vs_addition.context.constraint.ConstraintManager
import io.github.xiewuzhiying.vs_addition.networking.create.sticker.StickerSoundPacketS2CPacket
Expand Down Expand Up @@ -66,13 +67,16 @@ open class StickerConstraintManager(val level: ServerLevel, val ship: ServerShip
}
}

val attachmentConstraint = VSAttachmentConstraint(bodyId!!, otherId, 1e-10, localPos0, localPos1, 1e10, 0.0)
val compliance = VSAdditionConfig.SERVER.create.stickerCompliance
val maxForce = VSAdditionConfig.SERVER.create.stickerMaxForce

val attachmentConstraint = VSAttachmentConstraint(bodyId!!, otherId, compliance, localPos0, localPos1, maxForce, 0.0)

val fixOrientationConstraint = VSFixedOrientationConstraint(
bodyId!!, otherId, 1e-10,
bodyId!!, otherId, compliance,
(ship?.transform?.shipToWorldRotation ?: Quaterniond()).invert(Quaterniond()),
(otherShip?.transform?.shipToWorldRotation ?: Quaterniond()).invert(Quaterniond()),
1e10
maxForce,
)

this.addConstraintGroup(StickerConstraintGroup(this.createConstraint(attachmentConstraint) ?: return@transformFromWorldToNearbyLoadedShipsAndWorld, this.createConstraint(fixOrientationConstraint) ?: return@transformFromWorldToNearbyLoadedShipsAndWorld, pos.toBlockPos))
Expand Down

0 comments on commit 3c15177

Please sign in to comment.