public static float GetBodySizeScore01(BodyGenome genome) { // Refactor: 25f is hardcoded approximate! // * WPP: approximate of what? (use a constant or exposed value) float normalizedSizeScore = Mathf.Clamp01(((genome.GetFullsizeBoundingBox().x + genome.GetFullsizeBoundingBox().z) / genome.GetFullsizeBoundingBox().y) / 25f); return(normalizedSizeScore); }
public CritterInitData(BodyGenome bodyGenome) { boundingBoxSize = bodyGenome.GetFullsizeBoundingBox(); spawnSizePercentage = 0.1f; maxEnergy = Mathf.Min(boundingBoxSize.x * boundingBoxSize.y, 0.5f); maxStomachCapacity = 1f; primaryHue = bodyGenome.appearanceGenome.huePrimary; secondaryHue = bodyGenome.appearanceGenome.hueSecondary; biteConsumeRadius = 1f; biteTriggerRadius = 1f; biteTriggerLength = 1f; eatEfficiencyPlant = 1f; eatEfficiencyDecay = 1f; eatEfficiencyMeat = 1f; // 0 = longest, 1 = shortest float swimLerp = Mathf.Clamp01((bodyGenome.coreGenome.creatureAspectRatio - 0.175f) / 0.35f); // Mag range: 2 --> 0.5 // freq range: 1 --> 2 swimMagnitude = Mathf.Lerp(0.225f, 1.1f, swimLerp); swimFrequency = Mathf.Lerp(1.5f, 0.6f, swimLerp); swimAnimSpeed = 6f; bodyCoord = bodyGenome.coreGenome.bodyCoord; headCoord = bodyGenome.coreGenome.headCoord; mouthCoord = bodyGenome.coreGenome.mouthCoord; bendiness = 1f; speciesID = 0; // what grid cell of texture sheet to use bodyPatternX = bodyGenome.appearanceGenome.bodyStrokeBrushTypeX; bodyPatternY = bodyGenome.appearanceGenome.bodyStrokeBrushTypeY; }