UsingVehicleClass : Différence entre versions
De Wiki
(2 révisions intermédiaires par le même utilisateur non affichées) | |||
Ligne 10 : | Ligne 10 : | ||
veh.setDryMass(dryMass); | veh.setDryMass(dryMass); | ||
− | // Shape | + | // Shape : A vehicle object must have a main shape ! |
final double lref = 1.; | final double lref = 1.; | ||
veh.setMainShape(new Sphere(Vector3D.ZERO, lref)); | veh.setMainShape(new Sphere(Vector3D.ZERO, lref)); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// Getting the corresponding assembly | // Getting the corresponding assembly | ||
final Assembly assembly = veh.createAssembly(FramesFactory.getCIRF()); | final Assembly assembly = veh.createAssembly(FramesFactory.getCIRF()); | ||
Ligne 40 : | Ligne 19 : | ||
// Getting the corresponding mass model (useful for propagation, maneuvres, ...) | // Getting the corresponding mass model (useful for propagation, maneuvres, ...) | ||
final MassProvider mm = new MassModel(assembly); | final MassProvider mm = new MassModel(assembly); | ||
− | + | ||
System.out.println("Name of the main part: " + assembly.getMainPart().getName()); | System.out.println("Name of the main part: " + assembly.getMainPart().getName()); | ||
System.out.println("Total mass: " + mm.getTotalMass()); | System.out.println("Total mass: " + mm.getTotalMass()); | ||
− | |||
− | |||
− | |||
− | |||
} | } |
Version actuelle en date du 21 décembre 2018 à 10:04
public class UsingVehicleClass { public static void main(String[] args) throws PatriusException { Vehicle veh = new Vehicle(); // Dry mass final double dryMass = 1000.; veh.setDryMass(dryMass); // Shape : A vehicle object must have a main shape ! final double lref = 1.; veh.setMainShape(new Sphere(Vector3D.ZERO, lref)); // Getting the corresponding assembly final Assembly assembly = veh.createAssembly(FramesFactory.getCIRF()); // Getting the corresponding mass model (useful for propagation, maneuvres, ...) final MassProvider mm = new MassModel(assembly); System.out.println("Name of the main part: " + assembly.getMainPart().getName()); System.out.println("Total mass: " + mm.getTotalMass()); } }