mirror of
https://github.com/Xevion/Boids.git
synced 2026-01-31 04:23:34 -06:00
tweaked algorithm values, fixed centering velocity breaking wrapping erratically due to improperly scaled velocities
This commit is contained in:
@@ -1252,25 +1252,27 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 7d72224fef7a4fb4a998b0980fe0eb77, type: 3}
|
m_Script: {fileID: 11500000, guid: 7d72224fef7a4fb4a998b0980fe0eb77, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
boidCount: 153
|
boidCount: 205
|
||||||
boidGroupRange: 2.69
|
boidGroupRange: 5.9
|
||||||
boidStartVelocity: 0.05
|
boidStartVelocity: 9.7
|
||||||
boidVelocityLimit: 0.3
|
minSpeed: 13.3
|
||||||
|
maxSpeed: 17.2
|
||||||
globalBias: 1
|
globalBias: 1
|
||||||
separationBias: 0.014
|
separationBias: 1.5
|
||||||
alignmentBias: 0.194
|
alignmentBias: 0.599
|
||||||
cohesionBias: 0.05
|
cohesionBias: 0.558
|
||||||
boundaryBias: 0.063
|
boundaryBias: 1.085
|
||||||
enableSeparation: 1
|
enableSeparation: 1
|
||||||
enableAlignment: 1
|
enableAlignment: 1
|
||||||
enableCohesion: 1
|
enableCohesion: 1
|
||||||
enableBoundary: 1
|
enableBoundary: 1
|
||||||
boidSeparationRange: 5
|
boidSeparationRange: 1.67
|
||||||
boundaryForce: 0.352
|
boundaryForce: 0.352
|
||||||
localFlocks: 1
|
localFlocks: 1
|
||||||
edgeWrapping: 1
|
edgeWrapping: 1
|
||||||
circleVertexCount: 360
|
circleVertexCount: 360
|
||||||
circleWidth: 0.1
|
circleWidth: 0.1
|
||||||
|
maxSteerForce: 100
|
||||||
focusedBoid: {fileID: 0}
|
focusedBoid: {fileID: 0}
|
||||||
boidObject: {fileID: 1737515784064720040, guid: 23e1eaaf69d4ef342ac3ef9590f6c642,
|
boidObject: {fileID: 1737515784064720040, guid: 23e1eaaf69d4ef342ac3ef9590f6c642,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -4121,7 +4123,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1165952970}
|
m_GameObject: {fileID: 1165952970}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -2.3479285, y: -7.3538084, z: -1779.8757}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class Boid : MonoBehaviour {
|
|||||||
// Skip Flock Calculations if wrapping in progress
|
// Skip Flock Calculations if wrapping in progress
|
||||||
if (_isWrappingX || _isWrappingY) {
|
if (_isWrappingX || _isWrappingY) {
|
||||||
UpdateCenteringVelocity();
|
UpdateCenteringVelocity();
|
||||||
_position += _centeringVelocity;
|
_position += _centeringVelocity * Time.deltaTime;
|
||||||
transform.position = _position;
|
transform.position = _position;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -63,7 +63,7 @@ public class Boid : MonoBehaviour {
|
|||||||
_velocity = dir * speed;
|
_velocity = dir * speed;
|
||||||
|
|
||||||
_position += _velocity * Time.deltaTime;
|
_position += _velocity * Time.deltaTime;
|
||||||
transform.position = new Vector3(_position.x, _position.y, 0);
|
transform.position = _position;
|
||||||
// transform.forward = dir;
|
// transform.forward = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user