7 #ifndef __tire_GroundCollisionSystem_h__ 8 #define __tire_GroundCollisionSystem_h__ 26 void initialize(
void) {}
27 virtual void compile(
const t_note_id &a_note_id)
29 rg_all = m_rg_dataset;
30 m_asGround.bind(rg_all->scope());
31 m_asTireLive.bind(rg_all->scope());
32 m_asGround.filter(m_grounds, rg_all);
33 m_asTireLive.filter(m_tires, rg_all);
37 if(!rg_all->scope().isValid()) {
return; }
39 for(
unsigned int i_ground = 0;i_ground< m_grounds.size();i_ground++)
41 Record &r_ground = m_grounds[i_ground];
43 for(
unsigned int i_tire = 0; i_tire < m_tires.size(); i_tire++)
45 Record &r_tire = m_tires[i_tire];
47 if(determinant(m_asTireLive.transform(r_tire)) == 0.0)
52 invert(inv_tire_transform, m_asTireLive.transform(r_tire));
56 m_asTireLive.transform(r_tire).translation();
57 contact_point[2] = m_asGround.height(r_ground);
60 transformVector<3, t_moa_real>(inv_tire_transform,
63 t_moa_v3 Lt = m_asTireLive.transform(r_tire).translation();
64 m_asTireLive.contact_radius(r_tire) =
65 Lt[2] - m_asGround.height(r_ground);
69 rotateVector<3, t_moa_real>
76 t_moa_real m = result[0];
79 if(m > 1.0) { m = 1.0; }
80 if(m < -1.0) { m = -1.0; }
82 m_asTireLive.inclination(r_tire) = asin(m);
88 if(m > 1.0) { m = 1.0; }
89 if(m < -1.0) { m = -1.0; }
91 m_asTireLive.pitch(r_tire) = asin(m);
100 std::vector<Record> m_grounds;
101 std::vector<Record> m_tires;
kernel
Definition: namespace.dox:3
Ground.
Definition: tireAS.h:147
Matrix< 4, 4, T > & invert(Matrix< 4, 4, T > &a_inverted, const Matrix< 4, 4, T > &a_matrix)
4x4 full matrix inversion
Definition: Matrix.h:1033
Time Stepping System.
Definition: Stepper.h:15
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Run Time Single Contact Tire Model.
Definition: tireAS.h:49
virtual void compile(const t_note_id &a_note_id)
Compile internal structure for dataset.
Definition: GroundCollisionSystem.h:27
MOA Toy/Test Ground Collision System – M*N: Ground and Tires.
Definition: GroundCollisionSystem.h:18
Reference to an instance of a Layout.
Definition: RecordSB.h:35
void step(t_moa_real a_dt)
Move system forward in time by a timestep.
Definition: GroundCollisionSystem.h:35