Skip to content

Commit

Permalink
acceleration in muscle cells corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Aug 16, 2024
1 parent a824e50 commit ffa49ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/EngineGpuKernels/MuscleProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ __device__ __inline__ void MuscleProcessor::movement(SimulationData& data, Simul

auto direction = float2{0, 0};
auto acceleration = 0.0f;
if (cudaSimulationParameters.cellFunctionMuscleMovementAngleFromSensor) {
if (cudaSimulationParameters.features.advancedMuscleControl && cudaSimulationParameters.cellFunctionMuscleMovementAngleFromSensor) {
if (auto sensorCell = findNearbySensor(cell)) {
auto const& sensorData = sensorCell->cellFunctionData.sensor;
if (sensorData.targetX != 0 || sensorData.targetY != 0) {
Expand All @@ -100,6 +100,7 @@ __device__ __inline__ void MuscleProcessor::movement(SimulationData& data, Simul
}
} else {
direction = CellFunctionProcessor::calcSignalDirection(data, cell);
acceleration = cudaSimulationParameters.cellFunctionMuscleMovementAcceleration[cell->color];
}
float angle = max(-0.5f, min(0.5f, activity.channels[3])) * 360.0f;
direction = Math::rotateClockwise(direction, angle);
Expand Down

0 comments on commit ffa49ac

Please sign in to comment.