Commit 4ad6123b authored by Christian Winter's avatar Christian Winter

bugfix. preview rendering of only-to-position-locked instance rotation and scaling

parent 96c14d5b
Pipeline #4767300 passed with stage
in 57 seconds
......@@ -1037,28 +1037,32 @@
for (let line of instance.reference.lines)
{
let start = line.start.position;
start = start.addVector(instance.transform.position);
start = start.scaleFrom(instance.transform.position, instance.transform.scale);
start = start.rotateAround(instance.transform.position, instance.transform.rotation);
let end = line.end.position;
end = end.addVector(instance.transform.position);
end = end.scaleFrom(instance.transform.position, instance.transform.scale);
end = end.rotateAround(instance.transform.position, instance.transform.rotation);
// transform from prefab to instance
let start = instance.instanceSpaceForPosition(line.start.position);
let end = instance.instanceSpaceForPosition(line.end.position);
if (deltaPos) {
start = start.addVector(deltaPos);
end = end.addVector(deltaPos);
}
if (deltaRot && !Preferences.onlyTransformPrefabInstancePosition) {
if (deltaRot) {
start = start.rotateAround(center, deltaRot);
end = end.rotateAround(center, deltaRot);
if (Preferences.onlyTransformPrefabInstancePosition) {
start = start.rotateAround(pos, -deltaRot);
end = end.rotateAround(pos, -deltaRot);
}
}
if (deltaScale && !Preferences.onlyTransformPrefabInstancePosition) {
if (deltaScale) {
start = start.scaleFrom(center, deltaScale);
end = end.scaleFrom(center, deltaScale);
if (Preferences.onlyTransformPrefabInstancePosition) {
start = start.scaleFrom(pos, deltaScale.oneDividedByThisVector());
end = end.scaleFrom(pos, deltaScale.oneDividedByThisVector());
}
}
this.drawLineFromTo(start, end, line.thickness, line.color);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment