Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/tree scale #346

Merged
merged 8 commits into from
Dec 12, 2024
Merged

Feature/tree scale #346

merged 8 commits into from
Dec 12, 2024

Conversation

TomSimons
Copy link
Contributor

@TomSimons TomSimons commented Dec 9, 2024

  • Transform property section now supports a custom unit symbol, a definable amount of decimals per property, and a scale multiplier. This was applied to the trees in the object library.
  • Increased default scale of trees.
  • Increased max size in scattered objects to 50m

https://cdn-dev-ams-3da.azureedge.net/autobuild/feature/tree-scale/345478263/

Copy link
Contributor

@bozmir bozmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat kleine optimalisaties maar niet perse nodig

double.TryParse(position.zField.Text, out var z);
var numberFormat = new NumberFormatInfo
{
NumberDecimalSeparator = "."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings die vaker gebruikt gaan worden altijd cachen. dit is veel memory allocatie, dus bv. NumberDecimalSeparator = defaultNumberSeperator;

float.TryParse(rotation.zField.Text, out var z);
var numberFormat = new NumberFormatInfo
{
NumberDecimalSeparator = "."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

float.TryParse(scale.zField.Text.Replace(percentageCharacter, ""), out var z);
var numberFormat = new NumberFormatInfo
{
NumberDecimalSeparator = "."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hiephoi


TransformPropertyData.LocalScale = new Vector3(x / 100.0f, y / 100.0f, z / 100.0f);
TransformPropertyData.LocalScale = new Vector3(x / scaleMultiplier, y / scaleMultiplier, z / scaleMultiplier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misschien omdat ik te weinig kennis heb van dit onderdeel maar met een multiplier verwacht ik een * operator, moet de input waarde zijn inverse zijn?

scale.xField.SetTextWithoutNotify($"{xPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}");
scale.yField.SetTextWithoutNotify($"{yPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}");
scale.zField.SetTextWithoutNotify($"{zPercentage.ToString("0", CultureInfo.InvariantCulture)}{percentageCharacter}");
return format;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string defaultZero = "0";
string defaultZeroSeperator = "0.";
en
format += defaultZero;

nog beter een stringbuilder maar dat is in dit geval overkill

Copy link
Contributor

@bozmir bozmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

netjes

@TomSimons TomSimons merged commit db2e1d5 into main Dec 12, 2024
2 checks passed
@TomSimons TomSimons deleted the feature/tree-scale branch December 12, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants