MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / stepSimulation

Method stepSimulation

examples/Tutorial/Dof6ConstraintTutorial.cpp:497–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497void Dof6ConstraintTutorial::stepSimulation(float deltaTime)
498{
499 //animate();
500
501 //float time = m_data->m_timeSeriesCanvas->getCurrentTime();
502
503 float prevPos = m_data->m_TranslateSpringBody->getWorldTransform().getOrigin().x();
504 m_dynamicsWorld->stepSimulation(deltaTime);
505 float xPos = m_data->m_TranslateSpringBody->getWorldTransform().getOrigin().x();
506
507 m_data->m_timeSeriesCanvas->insertDataAtCurrentTime(xPos, 0, true);
508 m_data->m_timeSeriesCanvas->insertDataAtCurrentTime(m_data->m_TranslateSpringBody->getLinearVelocity().x(), 1, true);
509
510 if (deltaTime > 0)
511 {
512 m_data->m_timeSeriesCanvas->insertDataAtCurrentTime((xPos - prevPos) / deltaTime, 2, true);
513 }
514 prevPos = xPos;
515 m_data->m_timeSeriesCanvas->nextTick();
516}
517
518class CommonExampleInterface* Dof6ConstraintTutorialCreateFunc(CommonExampleOptions& options)
519{

Callers

nothing calls this directly

Calls 4

nextTickMethod · 0.80
xMethod · 0.45
getLinearVelocityMethod · 0.45

Tested by

no test coverage detected