Titan  v1.0
A high-performance CUDA-based physics simulation sandbox for robotics, physics, and reinforcement learning.
titan::Simulation Class Reference

#include <sim.h>

Public Member Functions

MasscreateMass ()
 
MasscreateMass (const Vec &pos)
 
SpringcreateSpring ()
 
SpringcreateSpring (Mass *m1, Mass *m2)
 
void deleteMass (Mass *m)
 
void deleteSpring (Spring *s)
 
void get (Mass *m)
 
void get (Spring *s)
 
void get (Container *c)
 
void set (Mass *m)
 
void set (Spring *s)
 
void set (Container *c)
 
void getAll ()
 
void setAll ()
 
void createPlane (const Vec &abc, double d)
 
void createPlane (const Vec &abc, double d, double FRICTION_K, double FRICTION_S)
 
void createBall (const Vec &center, double r)
 
void clearConstraints ()
 
ContainercreateContainer ()
 
void deleteContainer (Container *c)
 
CubecreateCube (const Vec &center, double side_length)
 
LatticecreateLattice (const Vec &center, const Vec &dims, int nx=10, int ny=10, int nz=10)
 
BeamcreateBeam (const Vec &center, const Vec &dims, int nx=10, int ny=10, int nz=10)
 
ContainerimportFromSTL (const std::string &path, double density=10.0, int num_rays=5)
 
void setAllSpringConstantValues (double k)
 
void setAllMassValues (double m)
 
void setTimeStep (double delta_t)
 
void setGlobalAcceleration (const Vec &global_acc)
 
void defaultRestLengths ()
 
void start ()
 
void stop ()
 
void stop (double time)
 
void pause (double t)
 
void resume ()
 
void reset ()
 
void setBreakpoint (double time)
 
void wait (double t)
 
void waitUntil (double t)
 
void waitForEvent ()
 
double time ()
 
bool running ()
 
void printPositions ()
 
 Simulation ()
 
 ~Simulation ()
 
SpringgetSpringByIndex (int i)
 
MassgetMassByIndex (int i)
 
ContainergetContainerByIndex (int i)
 

Public Attributes

std::vector< Mass * > masses
 
std::vector< Spring * > springs
 
std::vector< Container * > containers
 

Constructor & Destructor Documentation

◆ Simulation()

titan::Simulation::Simulation ( )

◆ ~Simulation()

titan::Simulation::~Simulation ( )

Member Function Documentation

◆ clearConstraints()

void titan::Simulation::clearConstraints ( )

◆ createBall()

void titan::Simulation::createBall ( const Vec center,
double  r 
)

◆ createBeam()

Beam* titan::Simulation::createBeam ( const Vec center,
const Vec dims,
int  nx = 10,
int  ny = 10,
int  nz = 10 
)

◆ createContainer()

Container* titan::Simulation::createContainer ( )

◆ createCube()

Cube* titan::Simulation::createCube ( const Vec center,
double  side_length 
)

◆ createLattice()

Lattice* titan::Simulation::createLattice ( const Vec center,
const Vec dims,
int  nx = 10,
int  ny = 10,
int  nz = 10 
)

◆ createMass() [1/2]

Mass* titan::Simulation::createMass ( )

◆ createMass() [2/2]

Mass* titan::Simulation::createMass ( const Vec pos)

◆ createPlane() [1/2]

void titan::Simulation::createPlane ( const Vec abc,
double  d 
)

◆ createPlane() [2/2]

void titan::Simulation::createPlane ( const Vec abc,
double  d,
double  FRICTION_K,
double  FRICTION_S 
)

◆ createSpring() [1/2]

Spring* titan::Simulation::createSpring ( )

◆ createSpring() [2/2]

Spring* titan::Simulation::createSpring ( Mass m1,
Mass m2 
)

◆ defaultRestLengths()

void titan::Simulation::defaultRestLengths ( )

◆ deleteContainer()

void titan::Simulation::deleteContainer ( Container c)

◆ deleteMass()

void titan::Simulation::deleteMass ( Mass m)

◆ deleteSpring()

void titan::Simulation::deleteSpring ( Spring s)

◆ get() [1/3]

void titan::Simulation::get ( Container c)

◆ get() [2/3]

void titan::Simulation::get ( Mass m)

◆ get() [3/3]

void titan::Simulation::get ( Spring s)

◆ getAll()

void titan::Simulation::getAll ( )

◆ getContainerByIndex()

Container* titan::Simulation::getContainerByIndex ( int  i)

◆ getMassByIndex()

Mass* titan::Simulation::getMassByIndex ( int  i)

◆ getSpringByIndex()

Spring* titan::Simulation::getSpringByIndex ( int  i)

◆ importFromSTL()

Container* titan::Simulation::importFromSTL ( const std::string &  path,
double  density = 10.0,
int  num_rays = 5 
)

◆ pause()

void titan::Simulation::pause ( double  t)

◆ printPositions()

void titan::Simulation::printPositions ( )

◆ reset()

void titan::Simulation::reset ( )

◆ resume()

void titan::Simulation::resume ( )

◆ running()

bool titan::Simulation::running ( )

◆ set() [1/3]

void titan::Simulation::set ( Container c)

◆ set() [2/3]

void titan::Simulation::set ( Mass m)

◆ set() [3/3]

void titan::Simulation::set ( Spring s)

◆ setAll()

void titan::Simulation::setAll ( )

◆ setAllMassValues()

void titan::Simulation::setAllMassValues ( double  m)

◆ setAllSpringConstantValues()

void titan::Simulation::setAllSpringConstantValues ( double  k)

◆ setBreakpoint()

void titan::Simulation::setBreakpoint ( double  time)

◆ setGlobalAcceleration()

void titan::Simulation::setGlobalAcceleration ( const Vec global_acc)

◆ setTimeStep()

void titan::Simulation::setTimeStep ( double  delta_t)

◆ start()

void titan::Simulation::start ( )

◆ stop() [1/2]

void titan::Simulation::stop ( )

◆ stop() [2/2]

void titan::Simulation::stop ( double  time)

◆ time()

double titan::Simulation::time ( )

◆ wait()

void titan::Simulation::wait ( double  t)

◆ waitForEvent()

void titan::Simulation::waitForEvent ( )

◆ waitUntil()

void titan::Simulation::waitUntil ( double  t)

Member Data Documentation

◆ containers

std::vector<Container *> titan::Simulation::containers

◆ masses

std::vector<Mass *> titan::Simulation::masses

◆ springs

std::vector<Spring *> titan::Simulation::springs

The documentation for this class was generated from the following file: