mirror of
https://github.com/PorktoberRevolution/ReStocked
synced 2024-09-01 17:34:42 +00:00
Merge branch 'develop'
This commit is contained in:
commit
7a7f8695d0
@ -1 +1 @@
|
||||
Subproject commit f357fa8e99937d7ef61aa8c63e8f198ea2c7a269
|
||||
Subproject commit e0d84f6229971bab4b1557380a1f3b9c39e2ac46
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -79,6 +79,9 @@ Localization
|
||||
#LOC_Restock_variant-telescope_shielded = Shielded
|
||||
#LOC_Restock_variant-telescope_bare = Bare
|
||||
|
||||
#LOC_Restock_variant-wheel_broken = Broken
|
||||
#LOC_Restock_variant-wheel_bare = Bare
|
||||
|
||||
#LOC_Restock_variant-surface_metal = Metal
|
||||
#LOC_Restock_variant-surface_basic = Basic
|
||||
#LOC_Restock_variant-surface_truss = Truss
|
||||
|
@ -0,0 +1,257 @@
|
||||
// Patches applying art changes to wheels
|
||||
// Contents:
|
||||
// - Rovemax Model S2 (roverWheel2)
|
||||
// - Rovemax Model M1 (roverWHeel1)
|
||||
// - TR-2L Ruggedized Wheel (wheelMed)
|
||||
|
||||
// RoveMax Model S2
|
||||
@PART[roverWheel2]:HAS[~RestockIgnore[*]]:FOR[ReStock]
|
||||
{
|
||||
@author = Andrew Cassidy
|
||||
|
||||
!MODEL {}
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-1
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSuspension] {
|
||||
@suspensionTransformName = SuspensionPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSteering] {
|
||||
@steeringTransformName = SteeringPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelDamage] {
|
||||
@damagedTransformName = WheelBusted
|
||||
@undamagedTransformName = Wheel
|
||||
}
|
||||
|
||||
!MODULE[FXModuleLookAtConstraint] {}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Suspension1
|
||||
targetName = Suspension2
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Suspension2
|
||||
targetName = Suspension1
|
||||
}
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModulePartVariants
|
||||
useMultipleDragCubes = false
|
||||
baseVariant = Bare
|
||||
VARIANT
|
||||
{
|
||||
name = Bare
|
||||
displayName = #LOC_Restock_variant-probe-bare
|
||||
primaryColor = #999999
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = false
|
||||
SteeringPivot_gold = false
|
||||
body_silver = false
|
||||
SteeringPivot_silver = false
|
||||
}
|
||||
}
|
||||
VARIANT
|
||||
{
|
||||
name = Gold
|
||||
displayName = #LOC_Restock_variant-probe-gold
|
||||
themeName = Gold
|
||||
primaryColor = #fccb0a
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = true
|
||||
SteeringPivot_gold = true
|
||||
body_silver = false
|
||||
SteeringPivot_silver = false
|
||||
}
|
||||
}
|
||||
VARIANT
|
||||
{
|
||||
name = Silver
|
||||
displayName = #LOC_Restock_variant-probe-silver
|
||||
themeName = Silver
|
||||
primaryColor = #cecece
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = false
|
||||
SteeringPivot_gold = false
|
||||
body_silver = true
|
||||
SteeringPivot_silver = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RoveMax Model M1
|
||||
@PART[roverWheel1]:HAS[~RestockIgnore[*]]:FOR[ReStock]
|
||||
{
|
||||
@author = Andrew Cassidy
|
||||
|
||||
!mesh = DELETE
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-2
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSuspension] {
|
||||
@suspensionTransformName = SuspensionPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSteering] {
|
||||
@steeringTransformName = SteeringPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelDamage] {
|
||||
@damagedTransformName = WheelBusted
|
||||
@undamagedTransformName = Wheel
|
||||
}
|
||||
|
||||
!MODULE[FXModuleLookAtConstraint]
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link1
|
||||
targetName = Link1Target
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link2
|
||||
targetName = Link2Target
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = LowerBracket
|
||||
targetName = Base
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPivotFollower
|
||||
targetName = SteeringPivot
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = WheelPivotFollower
|
||||
targetName = WheelPivot
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = ShockCylinder
|
||||
targetName = ShockPiston
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = ShockPiston
|
||||
targetName = ShockCylinder
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPiston1
|
||||
targetName = SteeringCylinder1
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringCylinder1
|
||||
targetName = SteeringPiston1
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPiston2
|
||||
targetName = SteeringCylinder2
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringCylinder2
|
||||
targetName = SteeringPiston2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TR-2L Ruggedized Vehicular Wheel
|
||||
@PART[wheelMed]:HAS[~RestockIgnore[*]]:FOR[ReStock]
|
||||
{
|
||||
@author = Andrew Cassidy
|
||||
|
||||
!MODEL {}
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-3
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSuspension] {
|
||||
@suspensionTransformName = SuspensionPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSteering] {
|
||||
@steeringTransformName = SteeringPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelDamage] {
|
||||
@damagedTransformName = WheelBusted
|
||||
@undamagedTransformName = Wheel
|
||||
}
|
||||
|
||||
!MODULE[FXModuleLookAtConstraint] {}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = DamperCylinder
|
||||
targetName = DamperPiston
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = DamperPiston
|
||||
targetName = DamperCylinder
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringCylinder1
|
||||
targetName = SteeringPiston1
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPiston1
|
||||
targetName = SteeringCylinder1
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
// Patches applying art changes to the Making History rover wheel
|
||||
// Contents:
|
||||
// - RoveMax M1-F Rover Wheel (roverWheelM1-F)
|
||||
|
||||
// RoveMax M1-F Rover Wheel
|
||||
@PART[roverWheelM1-F]:HAS[~RestockIgnore[*]]:FOR[ReStock]
|
||||
{
|
||||
@author = Andrew Cassidy
|
||||
|
||||
!MODEL {}
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-4
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSuspension] {
|
||||
@suspensionTransformName = SuspensionPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelSteering] {
|
||||
@steeringTransformName = SteeringPivot
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelDamage] {
|
||||
@damagedTransformName = WheelBusted
|
||||
@undamagedTransformName = Wheel
|
||||
}
|
||||
|
||||
@MODULE[ModuleWheelDeployment] {
|
||||
@animationTrfName = restock-wheel-4
|
||||
@animationStateName = restock-wheel-4-deploy
|
||||
|
||||
}
|
||||
|
||||
!MODULE[ModulePartVariants] {}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModulePartVariants
|
||||
baseVariant = Orange
|
||||
VARIANT
|
||||
{
|
||||
name = Orange
|
||||
displayName = #autoLOC_8007100 // Orange
|
||||
themeName = Orange
|
||||
primaryColor = #74402B
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = true
|
||||
Fender_grey = false
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Grey
|
||||
displayName = #autoLOC_8007119 // White
|
||||
themeName = White
|
||||
primaryColor = #ffffff
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = true
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Cernan
|
||||
displayName = #LOC_Restock_variant-wheel_broken // Broken
|
||||
themeName = Orange
|
||||
primaryColor = #74402B
|
||||
secondaryColor = #A0A0A0
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = false
|
||||
Fender_cernan = true
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Bare
|
||||
displayName = #LOC_Restock_variant-wheel_bare //Bare
|
||||
themeName = White
|
||||
primaryColor = #707070
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = false
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
!MODULE[FXModuleLookAtConstraint] {}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link1
|
||||
targetName = Link1Target
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link2
|
||||
targetName = Link2Target
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SuspensionPiston
|
||||
targetName = SuspensionPistonTarget
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SuspensionCylinder
|
||||
targetName = SuspensionCylinderTarget
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = LowerBracket
|
||||
targetName = UpperBracket
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPivotFollower
|
||||
targetName = SteeringPivot
|
||||
}
|
||||
|
||||
COPYPOSITIONCONSTRAINT
|
||||
{
|
||||
moversName = WheelMesh
|
||||
targetName = WheelPivotFollower
|
||||
}
|
||||
|
||||
COPYPOSITIONCONSTRAINT
|
||||
{
|
||||
moversName = WheelMeshBusted
|
||||
targetName = WheelPivotFollower
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
@ -135,6 +135,9 @@ Squad/Parts/Utility/launchClamp1/
|
||||
Squad/Parts/Utility/landingLegLT-1/
|
||||
Squad/Parts/Utility/landingLegLT-2/
|
||||
Squad/Parts/Utility/landingLegLT-5/
|
||||
Squad/Parts/Wheel/roverWheelM1/
|
||||
Squad/Parts/Wheel/roverWheelS2/
|
||||
Squad/Parts/Wheel/roverWheelTR-2L/
|
||||
Squad/Parts/Resources/RadialTank/
|
||||
Squad/Parts/Resources/SmallTank/
|
||||
Squad/Parts/Resources/LargeTank/
|
||||
|
@ -3,6 +3,12 @@ v1.1.0
|
||||
- New stock part replacements
|
||||
- Engines
|
||||
- T-1 Toroidal Aerospike "Dart" Liquid Fuel Engine (Nertea)
|
||||
- Wheels
|
||||
- Rovemax Model S2 (Andrew Cassidy)
|
||||
- Rovemax Model M1 (Andrew Cassidy)
|
||||
- TR-2L Ruggedized Wheel (Andrew Cassidy)
|
||||
- Bugfixes and tweaks
|
||||
- Fixed an issue where launch clamps girders would not render in older versions of OpenGL (#790)
|
||||
- New Making History part replacements
|
||||
- Aero
|
||||
- Protective Rocket Nose Cone Mk16A (Nertea): now has White and Orange variants
|
||||
@ -26,6 +32,8 @@ v1.1.0
|
||||
- T-25 Structural Tube (Nertea): now has White and Metal variants
|
||||
- T-37 Structural Tube (Nertea): now has White and Orange variants
|
||||
- T-50 Structural Tube (Nertea): now has White and Orange variants
|
||||
- Wheels
|
||||
- Rovemax Model M1-F (Andrew Cassidy)
|
||||
- Bugfixes and tweaks
|
||||
- RE-J10 "Wolfhound" Liquid Fuel Engine and RE-I2 "Skiff" Liquid Fuel Engine have had their manufacturer colours changed to Green-Grey/White (no gameplay effect) to match with the Saturn V parts and Mastodon better
|
||||
- Re-added missing stock smoke plumes to Skiff, Wolfhound, Kodiak
|
||||
@ -45,7 +53,6 @@ v1.0.2
|
||||
- Fixed 'tankbutt' localizations for Skiff showing 1.875m when they should be 2.5m (#766)
|
||||
- Fixed inflatable heatshield fairing (#765)
|
||||
|
||||
|
||||
v1.0.1
|
||||
-----
|
||||
- Fixed lack of bundled ModuleManager
|
||||
|
@ -503,5 +503,15 @@ Localization
|
||||
#LOC_RestockPlus_restock-oretank-375-1_title = Jumbo Holding Tank
|
||||
#LOC_RestockPlus_restock-oretank-375-1_description = A very large tank that can be used for storing raw materials. The manufacturer denies any claims that it has been re-purposed from a local farm
|
||||
#LOC_RestockPlus_restock-oretank-375-1_tags = black isru mine )mining (ore resource store restock
|
||||
|
||||
// GROUND
|
||||
// ==============
|
||||
#LOC_RestockPlus_restock-wheel-1-T_title = Rovemax Model S2-T
|
||||
#LOC_RestockPlus_restock-wheel-1-T_description = A modified rover wheel that is rotated 90°, ideal for tricycles or other unusually shaped vehicles.
|
||||
#LOC_RestockPlus_restock-wheel-1-T_tags = )car drive ground roll rover wheel tricycle restock
|
||||
|
||||
#LOC_RestockPlus_restock-wheel-4_title = Rovemax Model M0
|
||||
#LOC_RestockPlus_restock-wheel-4_description = A smaller version of the popular Rovemax wheel with an integrated folding function, allowing it to be stowed for transportation.
|
||||
#LOC_RestockPlus_restock-wheel-4_tags = )car drive ground roll rover wheel fold LRV restock
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,209 @@
|
||||
// ReStock+ 1.1.0
|
||||
// 90° rotated rover wheel
|
||||
PART
|
||||
{
|
||||
name = restock-wheel-1-T
|
||||
module = Part
|
||||
author = Andrew Cassidy
|
||||
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-1-T
|
||||
scale = 1.0, 1.0, 1.0
|
||||
}
|
||||
rescaleFactor = 1.0
|
||||
|
||||
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
|
||||
attachRules = 1,1,0,0,0
|
||||
node_attach = 0.0, 0.5248517, 0.3083052, 0.0, 0.0, -1.0, 1
|
||||
node_stack_bottom = 0.0, 0.5248517, 0.321335, 0.0, 0.0, 1.0, 1
|
||||
|
||||
TechRequired = spaceExploration
|
||||
entryCost = 3100
|
||||
cost = 300
|
||||
category = Ground
|
||||
subcategory = 0
|
||||
mass = 0.06
|
||||
|
||||
title = #LOC_RestockPlus_restock-wheel-1-T_title // Rovemax Model S2-T
|
||||
manufacturer = #autoLOC_501649 //#autoLOC_501649 = Kerbal Motion LLC
|
||||
description = #LOC_RestockPlus_restock-wheel-1-T_description
|
||||
// A modified rover wheel that is rotated 90°, ideal for tricycles or other unusually shaped vehicles
|
||||
|
||||
dragModelType = default
|
||||
maximum_drag = 0.3
|
||||
minimum_drag = 0.2
|
||||
angularDrag = 1
|
||||
crashTolerance = 20
|
||||
maxTemp = 1200
|
||||
bulkheadProfiles = srf
|
||||
tags = #LOC_RestockPlus_restock-wheel-1-T_tags // drive ground roll rover wheel tricycle restock
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelBase
|
||||
|
||||
wheelColliderTransformName = WheelCollider
|
||||
wheelTransformName = WheelPivot
|
||||
|
||||
wheelType = MOTORIZED
|
||||
|
||||
// setting this to true will override the radius and center parameters
|
||||
FitWheelColliderToMesh = False
|
||||
radius = 0.157
|
||||
center = 0,0,0
|
||||
mass = 0.040
|
||||
groundHeightOffset = 0
|
||||
|
||||
TooltipTitle = #autoLOC_502081 //#autoLOC_502081 = Rover Wheel
|
||||
TooltipPrimaryField = #autoLOC_6004045 //#autoLOC_6004045 = Motorized
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelSuspension
|
||||
baseModuleIndex = 0
|
||||
suspensionTransformName = SuspensionPivot
|
||||
maximumLoad = 8.0
|
||||
suspensionDistance = 0.195
|
||||
suspensionOffset = -0.05
|
||||
targetPosition = 0.2
|
||||
springRatio = 5
|
||||
damperRatio = 1.0
|
||||
useAutoBoost = true
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelSteering
|
||||
baseModuleIndex = 0
|
||||
|
||||
caliperTransformName = SteeringPivot
|
||||
|
||||
steeringResponse = 1.5
|
||||
steeringCurve
|
||||
{
|
||||
key = 0 40
|
||||
key = 5 27//15
|
||||
key = 10 9//6
|
||||
key = 30 3.0//1.5
|
||||
}
|
||||
}
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelMotor
|
||||
baseModuleIndex = 0
|
||||
|
||||
wheelSpeedMax = 11
|
||||
driveResponse = 2
|
||||
|
||||
torqueCurve
|
||||
{
|
||||
key = 0 0.17 0 0
|
||||
key = 2.5 0.1 0 0
|
||||
key = 12 0 0 0
|
||||
}
|
||||
RESOURCE
|
||||
{
|
||||
name = ElectricCharge
|
||||
rate = 1//5
|
||||
}
|
||||
idleDrain = 0.0//0.1//
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelBrakes
|
||||
baseModuleIndex = 0
|
||||
|
||||
maxBrakeTorque = 0.34
|
||||
brakeResponse = 1
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelDamage
|
||||
baseModuleIndex = 0
|
||||
|
||||
damagedTransformName = WheelBusted
|
||||
undamagedTransformName = Wheel
|
||||
|
||||
stressTolerance = 315
|
||||
impactTolerance = 65
|
||||
deflectionMagnitude = 1.0
|
||||
deflectionSharpness = 2.0
|
||||
slipMagnitude = 15
|
||||
slipSharpness = 2.0
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Suspension1
|
||||
targetName = Suspension2
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Suspension2
|
||||
targetName = Suspension1
|
||||
}
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModulePartVariants
|
||||
useMultipleDragCubes = false
|
||||
baseVariant = Bare
|
||||
VARIANT
|
||||
{
|
||||
name = Bare
|
||||
displayName = #LOC_Restock_variant-probe-bare
|
||||
primaryColor = #999999
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = false
|
||||
SteeringPivot_gold = false
|
||||
body_silver = false
|
||||
SteeringPivot_silver = false
|
||||
}
|
||||
}
|
||||
VARIANT
|
||||
{
|
||||
name = Gold
|
||||
displayName = #LOC_Restock_variant-probe-gold
|
||||
themeName = Gold
|
||||
primaryColor = #fccb0a
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = true
|
||||
SteeringPivot_gold = true
|
||||
body_silver = false
|
||||
SteeringPivot_silver = false
|
||||
}
|
||||
}
|
||||
VARIANT
|
||||
{
|
||||
name = Silver
|
||||
displayName = #LOC_Restock_variant-probe-silver
|
||||
themeName = Silver
|
||||
primaryColor = #cecece
|
||||
secondaryColor = #999999
|
||||
|
||||
GAMEOBJECTS
|
||||
{
|
||||
body_gold = false
|
||||
SteeringPivot_gold = false
|
||||
body_silver = true
|
||||
SteeringPivot_silver = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,288 @@
|
||||
// ReStock+ 1.1.0
|
||||
// Folding LRV wheel
|
||||
PART
|
||||
{
|
||||
name = restock-wheel-4
|
||||
module = Part
|
||||
author = Andrew Cassidy
|
||||
|
||||
MODEL
|
||||
{
|
||||
model = ReStock/Assets/Ground/restock-wheel-4
|
||||
scale = 1.0, 1.0, 1.0
|
||||
}
|
||||
rescaleFactor = 1.25 //sigh
|
||||
|
||||
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
|
||||
attachRules = 1,1,0,0,0
|
||||
node_attach = 0.36, 0.1207, 0.0, 1.0, 0.0, 0.0, 1
|
||||
node_stack_bottom = 0.3815, 0.1207, 0.0, 1.0, 0.0, 0.0, 1
|
||||
|
||||
TechRequired = fieldScience
|
||||
entryCost = 5000
|
||||
cost = 500
|
||||
category = Ground
|
||||
subcategory = 0
|
||||
mass = 0.04
|
||||
|
||||
title = #LOC_RestockPlus_restock-wheel-4_title // Rovemax Model M0
|
||||
manufacturer = #autoLOC_501649 //#autoLOC_501649 = Kerbal Motion LLC
|
||||
description = #LOC_RestockPlus_restock-wheel-4_description
|
||||
// A smaller version of the popular Rovemax wheel with an integrated folding function, allowing it to be stowed for transportation.
|
||||
|
||||
dragModelType = default
|
||||
maximum_drag = 0.3
|
||||
minimum_drag = 0.2
|
||||
angularDrag = 1
|
||||
crashTolerance = 30
|
||||
maxTemp = 1200
|
||||
bulkheadProfiles = srf
|
||||
tags = #LOC_RestockPlus_restock-wheel-4_tags // )car drive ground roll rover wheel fold LRV restock
|
||||
|
||||
/// Flag to disable this part if MH is installed
|
||||
MHReplacement = True
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelBase
|
||||
|
||||
wheelColliderTransformName = WheelCollider
|
||||
wheelTransformName = WheelPivot
|
||||
|
||||
wheelType = MOTORIZED
|
||||
|
||||
// setting this to true will override the radius and center parameters
|
||||
FitWheelColliderToMesh = False
|
||||
radius = 0.23
|
||||
center = 0,0,0
|
||||
mass = 0.040
|
||||
groundHeightOffset = 0
|
||||
|
||||
TooltipTitle = #autoLOC_502081 //#autoLOC_502081 = Rover Wheel
|
||||
TooltipPrimaryField = #autoLOC_6004045 //#autoLOC_6004045 = Motorized
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelSuspension
|
||||
baseModuleIndex = 0
|
||||
suspensionTransformName = SuspensionPivot
|
||||
suspensionDistance = 0.1
|
||||
targetPosition = 0.0
|
||||
springRatio = 12
|
||||
damperRatio = 1.0
|
||||
maximumLoad = 5.0
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelSteering
|
||||
baseModuleIndex = 0
|
||||
|
||||
caliperTransformName = SteeringPivot
|
||||
|
||||
steeringResponse = 2
|
||||
steeringCurve
|
||||
{
|
||||
key = 0 20
|
||||
key = 10 9
|
||||
key = 30 3.0
|
||||
}
|
||||
}
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelMotor
|
||||
baseModuleIndex = 0
|
||||
|
||||
maxRpm = 42
|
||||
driveResponse = 2
|
||||
|
||||
torqueCurve
|
||||
{
|
||||
key = 0 0.5 0 0
|
||||
key = 2 0.3 0
|
||||
key = 10 0.1 0 0
|
||||
key = 25 0 0 0
|
||||
}
|
||||
|
||||
RESOURCE
|
||||
{
|
||||
name = ElectricCharge
|
||||
rate = 1.0
|
||||
}
|
||||
idleDrain = 0.0
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelBrakes
|
||||
baseModuleIndex = 0
|
||||
|
||||
maxBrakeTorque = 0.5
|
||||
brakeResponse = 1
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelDamage
|
||||
baseModuleIndex = 0
|
||||
|
||||
damagedTransformName = WheelBusted
|
||||
undamagedTransformName = Wheel
|
||||
|
||||
stressTolerance = 250
|
||||
impactTolerance = 100
|
||||
deflectionMagnitude = 1.0
|
||||
deflectionSharpness = 2.0
|
||||
slipMagnitude = 15
|
||||
slipSharpness = 2.0
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleWheelDeployment
|
||||
baseModuleIndex = 0
|
||||
|
||||
animationTrfName = restock-wheel-4
|
||||
animationStateName = restock-wheel-4-deploy
|
||||
deployedPosition = 0
|
||||
deployTargetTransformName = deployTgt
|
||||
|
||||
TsubSys = 1.0
|
||||
useStandInCollider = False
|
||||
slaveModules = 8
|
||||
|
||||
fxDeploy = deploy
|
||||
fxRetract = retract
|
||||
fxDeployed = deployed
|
||||
fxRetracted = retracted
|
||||
}
|
||||
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModulePartVariants
|
||||
baseVariant = Orange
|
||||
VARIANT
|
||||
{
|
||||
name = Orange
|
||||
displayName = #autoLOC_8007100 // Orange
|
||||
themeName = Orange
|
||||
primaryColor = #74402B
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = true
|
||||
Fender_grey = false
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Grey
|
||||
displayName = #autoLOC_8007119 // White
|
||||
themeName = White
|
||||
primaryColor = #ffffff
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = true
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Cernan
|
||||
displayName = #LOC_Restock_variant-wheel_broken // Broken
|
||||
themeName = Orange
|
||||
primaryColor = #74402B
|
||||
secondaryColor = #A0A0A0
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = false
|
||||
Fender_cernan = true
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT
|
||||
{
|
||||
name = Bare
|
||||
displayName = #LOC_Restock_variant-wheel_bare //Bare
|
||||
themeName = White
|
||||
primaryColor = #707070
|
||||
secondaryColor = #707070
|
||||
GAMEOBJECTS
|
||||
{
|
||||
Fender_orange = false
|
||||
Fender_grey = false
|
||||
Fender_cernan = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleTestSubject
|
||||
environments = 15
|
||||
useStaging = False
|
||||
useEvent = True
|
||||
}
|
||||
|
||||
|
||||
MODULE
|
||||
{
|
||||
name = ModuleRestockConstraints
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link1
|
||||
targetName = Link1Target
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = Link2
|
||||
targetName = Link2Target
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SuspensionPiston
|
||||
targetName = SuspensionPistonTarget
|
||||
}
|
||||
|
||||
LOOKATCONSTRAINT
|
||||
{
|
||||
rotatorsName = SuspensionCylinder
|
||||
targetName = SuspensionCylinderTarget
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = LowerBracket
|
||||
targetName = UpperBracket
|
||||
}
|
||||
|
||||
COPYROTATIONCONSTRAINT
|
||||
{
|
||||
rotatorsName = SteeringPivotFollower
|
||||
targetName = SteeringPivot
|
||||
}
|
||||
|
||||
COPYPOSITIONCONSTRAINT
|
||||
{
|
||||
moversName = WheelMesh
|
||||
targetName = WheelPivotFollower
|
||||
}
|
||||
|
||||
COPYPOSITIONCONSTRAINT
|
||||
{
|
||||
moversName = WheelMeshBusted
|
||||
targetName = WheelPivotFollower
|
||||
}
|
||||
}
|
||||
}
|
@ -24,6 +24,9 @@ v1.1.0
|
||||
- T-25 Structural Tube (Nertea): now has White and Metal variants
|
||||
- T-37 Structural Tube (Nertea): now has White and Orange variants
|
||||
- T-50 Structural Tube (Nertea): now has White and Orange variants
|
||||
- New Wheel parts
|
||||
- Rovemax Model S2-T (Andrew Cassidy): 90° rotated rover wheel for building tricycles
|
||||
- Rovemax Model M0 (Andrew Cassidy): folding rover wheel. Disabled if Making History is installed
|
||||
- Fixes and improvements
|
||||
- Fixed shrouds on Caravel's variants (#796)
|
||||
- RE-137 'Schnauzer'Liquid Fuel Engine and RE-I2 "Caravel" Liquid Fuel Engine have had their manufacturer colours changed to Green-Grey/White (no gameplay effect) to match with the Saturn V parts and _____ better
|
||||
|
45
Source/Restock/Constraints/CopyPositionConstraint.cs
Normal file
45
Source/Restock/Constraints/CopyPositionConstraint.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Restock.Constraints
|
||||
{
|
||||
[System.Serializable]
|
||||
/**
|
||||
* Copies the position of the target object to the mover object.
|
||||
* If `IsLocal` is true, uses local position instead of global position.
|
||||
*/
|
||||
public class CopyPositionConstraint : IConstraint
|
||||
{
|
||||
private readonly string moversName;
|
||||
private readonly string targetName;
|
||||
|
||||
private readonly bool local = false;
|
||||
|
||||
// Cached components
|
||||
private readonly Transform mover;
|
||||
private readonly Transform target;
|
||||
|
||||
public CopyPositionConstraint(ConfigNode node, Part p)
|
||||
{
|
||||
node.TryGetValue("moversName", ref moversName);
|
||||
node.TryGetValue("targetName", ref targetName);
|
||||
node.TryGetValue("isLocal", ref local);
|
||||
|
||||
mover = p.FindModelTransform(moversName);
|
||||
target = p.FindModelTransform(targetName);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (mover == null || target == null) return;
|
||||
|
||||
if (local)
|
||||
{
|
||||
mover.localPosition = target.localPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
mover.position = target.position;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
45
Source/Restock/Constraints/CopyRotationConstraint.cs
Normal file
45
Source/Restock/Constraints/CopyRotationConstraint.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Restock.Constraints
|
||||
{
|
||||
[System.Serializable]
|
||||
/**
|
||||
* Copies the rotation of the target object to the rotator object.
|
||||
* If `IsLocal` is true, uses local rotation instead of global rotation.
|
||||
*/
|
||||
public class CopyRotationConstraint : IConstraint
|
||||
{
|
||||
private readonly string rotatorsName;
|
||||
private readonly string targetName;
|
||||
|
||||
private readonly bool local = false;
|
||||
|
||||
// Cached components
|
||||
private readonly Transform rotator;
|
||||
private readonly Transform target;
|
||||
|
||||
public CopyRotationConstraint(ConfigNode node, Part p)
|
||||
{
|
||||
node.TryGetValue("rotatorsName", ref rotatorsName);
|
||||
node.TryGetValue("targetName", ref targetName);
|
||||
node.TryGetValue("isLocal", ref local);
|
||||
|
||||
rotator = p.FindModelTransform(rotatorsName);
|
||||
target = p.FindModelTransform(targetName);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (rotator == null || target == null) return;
|
||||
|
||||
if (local)
|
||||
{
|
||||
rotator.localRotation = target.localRotation;
|
||||
}
|
||||
else
|
||||
{
|
||||
rotator.rotation = target.rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
Source/Restock/Constraints/IConstraint.cs
Normal file
10
Source/Restock/Constraints/IConstraint.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Restock.Constraints
|
||||
{
|
||||
public interface IConstraint
|
||||
{
|
||||
void Update();
|
||||
}
|
||||
}
|
36
Source/Restock/Constraints/LookAtConstraint.cs
Normal file
36
Source/Restock/Constraints/LookAtConstraint.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Restock.Constraints
|
||||
{
|
||||
[System.Serializable]
|
||||
/**
|
||||
* Points the rotator object at the target object
|
||||
*/
|
||||
public class LookAtConstraint : IConstraint
|
||||
{
|
||||
private readonly string rotatorsName;
|
||||
private readonly string targetName;
|
||||
|
||||
// Cached components
|
||||
private readonly Transform rotator;
|
||||
private readonly Transform target;
|
||||
|
||||
public LookAtConstraint(ConfigNode node, Part p)
|
||||
{
|
||||
node.TryGetValue("rotatorsName", ref rotatorsName);
|
||||
node.TryGetValue("targetName", ref targetName);
|
||||
|
||||
rotator = p.FindModelTransform(rotatorsName);
|
||||
target = p.FindModelTransform(targetName);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (rotator == null || target == null) return;
|
||||
|
||||
var lookPos = target.position - rotator.position;
|
||||
var rotation = Quaternion.LookRotation(lookPos, target.up);
|
||||
rotator.rotation = rotation;
|
||||
}
|
||||
}
|
||||
}
|
79
Source/Restock/ModuleRestockConstraints.cs
Normal file
79
Source/Restock/ModuleRestockConstraints.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Restock.Constraints;
|
||||
|
||||
namespace Restock
|
||||
{
|
||||
public class ModuleRestockConstraints : PartModule
|
||||
{
|
||||
public List<IConstraint> constraints;
|
||||
|
||||
public override void OnLoad(ConfigNode node)
|
||||
{
|
||||
base.OnLoad(node);
|
||||
|
||||
constraints = new List<IConstraint>();
|
||||
var cnodes = node.GetNodes();
|
||||
this.Log($"Loading {cnodes.Length} constraints");
|
||||
|
||||
foreach (var cnode in cnodes)
|
||||
{
|
||||
switch (cnode.name)
|
||||
{
|
||||
//LookAtConstraint
|
||||
case "CONSTRAINLOOKFX":
|
||||
case "LOOKATCONSTRAINT":
|
||||
constraints.Add(new LookAtConstraint(cnode, this.part));
|
||||
break;
|
||||
|
||||
//CopyPositionConstraint
|
||||
case "COPYPOSITIONCONSTRAINT":
|
||||
constraints.Add(new CopyPositionConstraint(cnode, this.part));
|
||||
break;
|
||||
|
||||
//CopyRotationConstraint
|
||||
case "COPYROTATIONCONSTRAINT":
|
||||
constraints.Add(new CopyRotationConstraint(cnode, this.part));
|
||||
break;
|
||||
|
||||
//Unknown
|
||||
default:
|
||||
this.LogError($"Unknown constraint type \"{cnode.name}\"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.Log($"Loaded {constraints.Count} constraints");
|
||||
}
|
||||
|
||||
public override void OnStart(StartState state)
|
||||
{
|
||||
if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor)
|
||||
{
|
||||
if (constraints == null || constraints.Count == 0)
|
||||
{
|
||||
ConfigNode cfg;
|
||||
foreach (UrlDir.UrlConfig pNode in GameDatabase.Instance.GetConfigs("PART"))
|
||||
{
|
||||
if (pNode.name.Replace("_", ".") == part.partInfo.name)
|
||||
{
|
||||
cfg = pNode.config;
|
||||
ConfigNode node = cfg.GetNodes("MODULE").Single(n => n.GetValue("name") == moduleName);
|
||||
OnLoad(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (constraints == null) return;
|
||||
|
||||
foreach (var constraint in constraints)
|
||||
{
|
||||
constraint.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Restock
|
||||
{
|
||||
public class ModuleRestockLaunchClamp : LaunchClamp
|
||||
{
|
||||
private Material _girderMaterial;
|
||||
private Matrix4x4[] _girderMatrices;
|
||||
private Mesh _girderMesh;
|
||||
|
||||
private int _girderSegments;
|
||||
[KSPField] public int maxSegments = 100;
|
||||
[KSPField] public Transform towerAnchor;
|
||||
[KSPField] public Transform towerGirder;
|
||||
@ -20,6 +16,28 @@ namespace Restock
|
||||
[KSPField] public string trf_towerGirder_name = "";
|
||||
[KSPField] public string trf_towerYoke_name = "";
|
||||
|
||||
[KSPField] public Mesh girderMesh;
|
||||
|
||||
private Material _girderMaterial;
|
||||
private Matrix4x4[] _girderMatrices;
|
||||
|
||||
//used by non-instanced fallback girder implementation
|
||||
[KSPField] public bool instancingEnabled = true;
|
||||
[KSPField] public Mesh girderSegmentMesh;
|
||||
|
||||
private List<Vector3> _girderVerts;
|
||||
private List<Vector2> _girderUVs;
|
||||
private List<Vector3> _girderNormals;
|
||||
private List<Vector4> _girderTangents;
|
||||
private List<Color32> _girderColors;
|
||||
private List<int> _girderTris;
|
||||
|
||||
private bool _girderHasTangents = false;
|
||||
private bool _girderHasColors = false;
|
||||
private int _girderVertCount;
|
||||
private int _girderTriCount;
|
||||
private int _girderSegments;
|
||||
|
||||
public override void OnLoad(ConfigNode node)
|
||||
{
|
||||
towerPivot = part.FindModelTransform(trf_towerPivot_name);
|
||||
@ -28,6 +46,15 @@ namespace Restock
|
||||
towerGirder = part.FindModelTransform(trf_towerGirder_name);
|
||||
towerStretch = part.FindModelTransform(trf_towerStretch_name);
|
||||
|
||||
if (!SystemInfo.supportsInstancing)
|
||||
{
|
||||
this.LogWarning("You are using a computer which does not support instancing, " +
|
||||
"falling back to a slower launch clamp implementation");
|
||||
instancingEnabled = false;
|
||||
girderMesh = towerGirder.GetComponent<MeshFilter>().mesh;
|
||||
girderSegmentMesh = Instantiate<Mesh>(girderMesh);
|
||||
}
|
||||
|
||||
base.OnLoad(node);
|
||||
}
|
||||
|
||||
@ -35,50 +62,135 @@ namespace Restock
|
||||
{
|
||||
base.OnStart(state);
|
||||
|
||||
var girderRenderer = towerGirder.GetComponent<MeshRenderer>();
|
||||
_girderMaterial = girderRenderer.material;
|
||||
_girderMesh = towerGirder.GetComponent<MeshFilter>().mesh;
|
||||
girderMesh = towerGirder.GetComponent<MeshFilter>().mesh;
|
||||
|
||||
girderRenderer.enabled = false; // we'll render manually from now on
|
||||
|
||||
_girderSegments = 0;
|
||||
_girderMatrices = new Matrix4x4[maxSegments];
|
||||
|
||||
_girderMaterial.enableInstancing = true;
|
||||
if (!_girderMaterial.enableInstancing)
|
||||
if (instancingEnabled)
|
||||
{
|
||||
this.LogError("Could not enable instancing! Aborting");
|
||||
_girderSegments = -1;
|
||||
var girderRenderer = towerGirder.GetComponent<MeshRenderer>();
|
||||
girderRenderer.enabled = false; // we'll render manually from now on
|
||||
|
||||
_girderMatrices = new Matrix4x4[maxSegments];
|
||||
|
||||
_girderMaterial = girderRenderer.material;
|
||||
_girderMaterial.enableInstancing = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Log("Instancing is disabled, setting up fallback");
|
||||
_girderVertCount = girderSegmentMesh.vertexCount;
|
||||
_girderTriCount = girderSegmentMesh.triangles.Length;
|
||||
|
||||
_girderVerts = new List<Vector3>(girderSegmentMesh.vertices);
|
||||
_girderUVs = new List<Vector2>(girderSegmentMesh.uv);
|
||||
_girderNormals = new List<Vector3>(girderSegmentMesh.normals);
|
||||
if (girderSegmentMesh.tangents.Length > 0)
|
||||
{
|
||||
_girderHasTangents = true;
|
||||
_girderTangents = new List<Vector4>(girderSegmentMesh.tangents);
|
||||
}
|
||||
|
||||
if (girderSegmentMesh.colors32.Length > 0)
|
||||
{
|
||||
_girderHasColors = true;
|
||||
_girderColors = new List<Color32>(girderSegmentMesh.colors32);
|
||||
}
|
||||
|
||||
_girderTris = new List<int>(girderSegmentMesh.triangles);
|
||||
_girderSegments = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void LateUpdate()
|
||||
{
|
||||
if (_girderSegments < 0) return;
|
||||
|
||||
var height = HighLogic.LoadedSceneIsEditor ? towerStretch.position.y : this.height;
|
||||
var initialHeight = this.initialHeight;
|
||||
|
||||
towerAnchor.position = towerStretch.position - towerStretch.up * height;
|
||||
|
||||
|
||||
var vec1 = Vector3.down;
|
||||
var vec2 = towerAnchor.localPosition - towerYoke.localPosition;
|
||||
towerYoke.localRotation = Quaternion.FromToRotation(vec1, vec2);
|
||||
|
||||
_girderSegments = Mathf.CeilToInt(height / this.initialHeight);
|
||||
_girderSegments = Math.Min(_girderSegments, maxSegments);
|
||||
_girderSegments = Math.Max(_girderSegments, 0);
|
||||
var girderSegments = Mathf.CeilToInt(height / initialHeight);
|
||||
girderSegments = Math.Min(girderSegments, maxSegments);
|
||||
girderSegments = Math.Max(girderSegments, 0);
|
||||
|
||||
if (instancingEnabled)
|
||||
{
|
||||
UpdateGirder(girderSegments);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateGirderFallback(girderSegments);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGirder(int girderSegments)
|
||||
{
|
||||
var matrix = towerGirder.localToWorldMatrix;
|
||||
var offset = Matrix4x4.Translate(towerGirder.TransformVector(Vector3.down * initialHeight));
|
||||
|
||||
for (var i = 0; i < _girderSegments; i++)
|
||||
for (var i = 0; i < girderSegments; i++)
|
||||
{
|
||||
_girderMatrices[i] = matrix;
|
||||
matrix = offset * matrix;
|
||||
}
|
||||
|
||||
Graphics.DrawMeshInstanced(_girderMesh, 0, _girderMaterial, _girderMatrices, _girderSegments, part.mpb);
|
||||
Graphics.DrawMeshInstanced(girderMesh, 0, _girderMaterial, _girderMatrices, girderSegments, part.mpb);
|
||||
}
|
||||
|
||||
private void UpdateGirderFallback(int newGirderSegments)
|
||||
{
|
||||
|
||||
if (newGirderSegments == _girderSegments) return;
|
||||
|
||||
if (newGirderSegments > _girderSegments)
|
||||
{
|
||||
for (int i = _girderSegments; i < newGirderSegments; i++)
|
||||
{
|
||||
var offset = Vector3.down * base.initialHeight * i;
|
||||
var indexOffset = _girderVertCount * i;
|
||||
for (int v = 0; v < _girderVertCount; v++)
|
||||
{
|
||||
_girderVerts.Add(girderSegmentMesh.vertices[v] + offset);
|
||||
}
|
||||
|
||||
_girderNormals.AddRange(girderSegmentMesh.normals);
|
||||
_girderUVs.AddRange(girderSegmentMesh.uv);
|
||||
|
||||
if (_girderHasTangents) _girderTangents.AddRange(girderSegmentMesh.tangents);
|
||||
if (_girderHasColors) _girderColors.AddRange(girderSegmentMesh.colors32);
|
||||
|
||||
for (int t = 0; t < _girderTriCount; t++)
|
||||
{
|
||||
_girderTris.Add(girderSegmentMesh.triangles[t] + indexOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (newGirderSegments < _girderSegments)
|
||||
{
|
||||
var startIndex = newGirderSegments * _girderVertCount;
|
||||
var count = (_girderSegments - newGirderSegments) * _girderVertCount;
|
||||
_girderVerts.RemoveRange(startIndex, count);
|
||||
_girderNormals.RemoveRange(startIndex, count);
|
||||
_girderUVs.RemoveRange(startIndex, count);
|
||||
if (_girderHasTangents) _girderTangents.RemoveRange(startIndex, count);
|
||||
if (_girderHasColors) _girderColors.RemoveRange(startIndex, count);
|
||||
|
||||
_girderTris.RemoveRange(newGirderSegments * _girderTriCount, (_girderSegments - newGirderSegments) * _girderTriCount);
|
||||
}
|
||||
|
||||
girderMesh.Clear();
|
||||
|
||||
girderMesh.SetVertices(_girderVerts);
|
||||
girderMesh.SetNormals(_girderNormals);
|
||||
girderMesh.SetUVs(0, _girderUVs);
|
||||
if (_girderHasTangents) girderMesh.SetTangents(_girderTangents);
|
||||
if (_girderHasColors) girderMesh.SetColors(_girderColors);
|
||||
girderMesh.SetTriangles(_girderTris, 0);
|
||||
|
||||
girderMesh.RecalculateBounds();
|
||||
_girderSegments = newGirderSegments;
|
||||
}
|
||||
}
|
||||
}
|
@ -44,6 +44,10 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Constraints\CopyPositionConstraint.cs" />
|
||||
<Compile Include="Constraints\CopyRotationConstraint.cs" />
|
||||
<Compile Include="Constraints\IConstraint.cs" />
|
||||
<Compile Include="Constraints\LookAtConstraint.cs" />
|
||||
<Compile Include="InstallChecker.cs" />
|
||||
<Compile Include="MaterialModifiers\ColorPropertyMaterialModifier.cs" />
|
||||
<Compile Include="MaterialModifiers\FloatPropertyMaterialModifier.cs" />
|
||||
@ -55,6 +59,7 @@
|
||||
<Compile Include="ModuleRestockDepthMask.cs" />
|
||||
<Compile Include="ModuleRestockHeatEffects.cs" />
|
||||
<Compile Include="ModuleRestockISRUAnimation.cs" />
|
||||
<Compile Include="ModuleRestockConstraints.cs" />
|
||||
<Compile Include="ModuleRestockModifyFairingMaterials.cs" />
|
||||
<Compile Include="ModuleRestockModifyMaterials.cs" />
|
||||
<Compile Include="PartModuleExtensions.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user