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

Fixed Pilus Physics Size #1373

Merged
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions simulation_parameters/microbe_stage/organelles.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"components": {
"pilus": {}
},
"shouldScale": false,
"prokaryoteChance": 0.5,
"chanceToCreate": 0.5,
"mass": 0.5,
Expand Down Expand Up @@ -552,6 +553,7 @@
},
"nucleus": {}
},
"shouldScale": false,
"prokaryoteChance": 0,
"chanceToCreate": 0,
"mass": 0.7,
Expand Down
5 changes: 5 additions & 0 deletions src/microbe_stage/OrganelleDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ and the capacity of the process
/// </summary>
public int MPCost;

/// <summary>
/// Controls whether this organelle scales with growth progress (progress towards division and reproduction).
/// </summary>
public bool ShouldScale = true;

/// <summary>
/// Caches the rotated hexes
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions src/microbe_stage/PlacedOrganelle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ private void RecalculateGrowthValue()

private void ApplyScale()
{
// Nucleus isn't scaled
if (HasComponent<NucleusComponent>())
hhyyrylainen marked this conversation as resolved.
Show resolved Hide resolved
if (!Definition.ShouldScale)
return;

Scale = new Vector3(1 + GrowthValue, 1 + GrowthValue, 1 + GrowthValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public virtual void Update(float elapsed)
var rotation = MathUtils.CreateRotationForExternal(angle);

OnPositionChanged(rotation, angle, membraneCoords);

lastCalculatedPos = membraneCoords;
}
}

Expand Down