Comments (3)
So, to be clear, we are talking about PQSLandControl.OnVertexBuildHeight()
?
This piece of code is indeed quite hard to follow. This pattern of having instance fields being used as local variables shared by multiple methods all over the place is really awful.
Despite this being quite weird, I think sx
is designed to be in the [-0.25, 0.75]
range. There are way too many places where this is used for this to be a mistake. Since this is mapping to texture UV coordinates, my interpretation is that there is a deliberate intent to have a 90° offset between the texture origin and the 0° longitude.
And in fact, when using those values as UV coordinates, the stock code always does val = Math.Abs(val - Math.Floor(val))
which is equivalent as your modified code to transform back the value to a valid [0, 1]
UV range.
I think the actual mistake is indeed PQSLandControl.OnVertexBuildHeight()
trying to get back a longitude value from the sx
coordinates without accounting for that offset, so your fix makes sense from that PoV.
What I'm unsure of is how this will interact with the "intended" scatter placement. Fixing this like that mean whatever stuff is used to configure the distribution is working with a "the origin is at 90° longitude" assumption, but I guess that's already accounted for by people using this. Still, a confirmation that scatters are actually where they are supposed to be would be nice.
I will implement that fix and try to do a release ASAP.
On what this fix should be described, what is PQSLandControl
used for ? Does it only affect scatters distribution or is the class used for other purposes ?
from kspcommunityfixes.
Yes you got the right function. And looking at it I agree with everything you say... just seems very odd a choice of coordinate system.
Will test soon.
from kspcommunityfixes.
Forgot to answer one point: LandControl can do a bit more than scatters. It can do some terrain coloring effects amongst other things. Mainly scatters though.
from kspcommunityfixes.
Related Issues (20)
- KAL-1000 setup is deleted when vessel/parts with KAL and robotics are stored in subassemblies
- Report: attachment node issues in 1.34 HOT 2
- Performance: TemperatureGaugeSystem.Update and CreateGauges can cause a large spike HOT 1
- ReRootPreserveSurfaceAttach does not reconnect the child attachnode to the parent part HOT 9
- Crew spots unavailable in VAB when loading Subassemblies with crew capacity HOT 5
- Agressive Negotioation strategy allows fund raising glitch
- Aggressive Negotiations: Cannot launch craft that would exceed available funds without the strategy discount
- FuelLines connected to moveable parts load in the built position after f5/f9 HOT 4
- Kerbal standing still on a part (on landed vessel) moves forward a bit every x seconds HOT 3
- AttachNodes seem to hold onto a reference to a previous part HOT 3
- The GameEvents memoryleak fix should have an option for removing modded event handlers HOT 3
- ModuleAnimateGeneric crewcapacity/IVA patch should not apply in the editor
- Better Undo/Redo can merge two steps into one HOT 3
- Undocking a double docked vehicle from another while landed causes entire vehicle to accelerate upward HOT 3
- Bounds calculation should consider the default or active variant given by a part config for parts with varying sizes HOT 4
- VAB/SPH: Staging stack icons can get stuck and become unusable HOT 2
- Stock OrbitalConstructionContract will softlock the game and brick the save if generated for a body that no longer exists
- Max physics dt slider should round to nearest 0.01 HOT 2
- Ground anchor levitates after a scene load HOT 2
- Performance: Ships with large numbers of engines are slow because of interleaved transform updates/raycasts HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kspcommunityfixes.