BeadSim.cpp 419 Bytes
Newer Older
Yuwei Xiao's avatar
ex2    
Yuwei Xiao committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "BeadSim.h"


bool BeadSim::advance() {


    auto v = p_bead->getLinearVelocity();
    auto p = p_bead->getPosition();

    // TODO update position and velcity of p_bead
    // constraint C(x) = 0.5*(p.dot(p) - m_radius^2) = 0;


    m_time += m_dt;
    m_step++;

    // log
    if ((m_step % m_log_frequency) == 0) {
        m_trajectories.back().push_back(p_bead->getPosition());
    }
    return false;

}