Refactor "Missile" -> "Interceptor"
This commit is contained in:
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEngine;
|
||||
|
||||
public class Hydra70 : Missile {
|
||||
public class Hydra70 : Interceptor {
|
||||
private bool _submunitionsLaunched = false;
|
||||
|
||||
protected override void FixedUpdate() {
|
||||
@@ -34,20 +34,20 @@ public class Hydra70 : Missile {
|
||||
}
|
||||
|
||||
public void SpawnSubmunitions() {
|
||||
List<Missile> submunitions = new List<Missile>();
|
||||
switch (_agentConfig.submunitions_config.agent_config.missile_type) {
|
||||
case MissileType.MICROMISSILE:
|
||||
List<Interceptor> submunitions = new List<Interceptor>();
|
||||
switch (_agentConfig.submunitions_config.agent_config.interceptor_type) {
|
||||
case InterceptorType.MICROMISSILE:
|
||||
for (int i = 0; i < _agentConfig.submunitions_config.num_submunitions; i++) {
|
||||
AgentConfig convertedConfig =
|
||||
AgentConfig.FromSubmunitionAgentConfig(_agentConfig.submunitions_config.agent_config);
|
||||
|
||||
convertedConfig.initial_state.position = transform.position;
|
||||
convertedConfig.initial_state.velocity = GetComponent<Rigidbody>().velocity;
|
||||
Missile submunition = SimManager.Instance.CreateMissile(convertedConfig);
|
||||
Interceptor submunition = SimManager.Instance.CreateInterceptor(convertedConfig);
|
||||
submunitions.Add(submunition);
|
||||
}
|
||||
break;
|
||||
}
|
||||
SimManager.Instance.AssignMissilesToThreats(submunitions);
|
||||
SimManager.Instance.AssignInterceptorsToThreats(submunitions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Micromissile : Missile {
|
||||
public class Micromissile : Interceptor {
|
||||
[SerializeField]
|
||||
private float _navigationGain = 3f; // Typically 3-5
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Micromissile : Missile {
|
||||
float acc_az = N * closing_velocity * los_rate_az;
|
||||
float acc_el = N * closing_velocity * los_rate_el;
|
||||
|
||||
// Convert acceleration commands to missile body frame
|
||||
// Convert acceleration commands to craft body frame
|
||||
accelerationCommand = transform.right * acc_az + transform.up * acc_el;
|
||||
|
||||
// Clamp the acceleration command to the maximum acceleration
|
||||
|
||||
Reference in New Issue
Block a user