7 #ifndef __tire_ClosestGroundContactSystem_h__ 8 #define __tire_ClosestGroundContactSystem_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_asPoint.bind(rg_all->scope());
32 m_asContact.bind(rg_all->scope());
33 m_asLocator.bind(rg_all->scope());
34 m_asGround.filter(m_grounds, rg_all);
37 i_rg != rg_all->end(); i_rg++)
41 if(!m_asContact.check(spRA)) {
continue; }
43 if(m_asLocator.check(spRA))
45 for(
unsigned int i_r = 0; i_r < spRA->length(); i_r++)
47 m_xform_contacts.push_back(spRA->getRecord(i_r));
50 else if(m_asPoint.check(spRA))
52 for(
unsigned int i_r = 0; i_r < spRA->length(); i_r++)
54 m_point_contacts.push_back(spRA->getRecord(i_r));
61 if(!rg_all->scope().isValid()) {
return; }
63 for(
unsigned int i_ground = 0;i_ground<m_grounds.size();i_ground++)
65 Record &r_ground = m_grounds[i_ground];
67 for(
unsigned int i_contact = 0;
68 i_contact < m_point_contacts.size(); i_contact++)
70 Record &r_contact = m_point_contacts[i_contact];
73 m_asContact.contact(r_contact) =
74 m_asPoint.location(r_contact);
75 m_asContact.contact(r_contact)[2] =
76 m_asGround.height(r_ground);
80 for(
unsigned int i_contact = 0;
81 i_contact < m_xform_contacts.size(); i_contact++)
83 Record &r_contact = m_xform_contacts[i_contact];
86 m_asContact.contact(r_contact) =
87 m_asLocator.transform(r_contact).translation();
88 m_asContact.contact(r_contact)[2] =
89 m_asGround.height(r_ground);
97 AsContactLive m_asContact;
100 std::vector<Record> m_grounds;
101 std::vector<Record> m_xform_contacts;
102 std::vector<Record> m_point_contacts;
kernel
Definition: namespace.dox:3
Ground.
Definition: tireAS.h:147
Time Stepping System.
Definition: Stepper.h:15
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Something with a location in simulation.
Definition: moaAS.h:216
STL style iterator.
Definition: RecordGroup.h:124
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53