|
Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
|
#include <PhysicsBody.h>
Public Member Functions | |
| PhysicsBody ()=delete | |
| virtual | ~PhysicsBody ()=default |
| virtual void | step (float dt, BodyLock lock)=0 |
| virtual void | recordFrame (float t, BodyLock lock)=0 |
| virtual void | loadFrame (const ObjectSnapshot &snapshot, BodyLock lock)=0 |
| std::unique_lock< std::mutex > | lockState () const |
| uint32_t | getID () const |
| bool | isUnknown (const std::string &key, BodyLock lock) const |
| void | setUnknown (const std::string &key, bool active, BodyLock lock) |
| void | setForce (const std::string &name, const glm::vec3 &force, BodyLock lock) |
| glm::vec3 | getForce (const std::string &name, BodyLock lock) const |
| glm::vec3 | getNetForce (BodyLock lock) const |
| std::map< std::string, glm::vec3 > | getAllForces (BodyLock lock) const |
| glm::vec3 | getPosition (BodyLock lock) const |
| void | setPosition (const glm::vec3 &pos, BodyLock lock) |
| glm::vec3 | getVelocity (BodyLock lock) const |
| void | setVelocity (const glm::vec3 &vel, BodyLock lock) |
| virtual double | getMass (BodyLock lock) const |
| virtual void | setMass (double newMass, BodyLock lock) |
| virtual ThermalProperties | getThermalProperties (BodyLock lock) const |
| virtual void | setThermalProperty (const ThermalProperties &newProps, BodyLock lock) |
| float | getSurfaceArea () const |
| bool | getIsStatic (BodyLock lock) const |
| void | setIsStatic (bool newStatic, BodyLock lock) |
| glm::mat4 | getWorldTransform (BodyLock lock) const |
| void | setWorldTransform (const glm::mat4 &M, BodyLock lock) |
| void | setGlobalAccelerationRef (std::atomic< glm::vec3 > &globalAccRef) |
| void | clearAllFrames (BodyLock lock) |
| template<typename F > | |
| void | withFrames (BodyLock lock, F &&fn) const |
| virtual Bounding::ICollider * | getCollider () const |
| virtual bool | collidesWith (const PhysicsBody &other) const =0 |
| virtual bool | collidesWithPointMass (const PointMass &pm) const =0 |
| virtual bool | collidesWithRigidBody (const RigidBody &rb) const =0 |
| virtual bool | resolveCollisionWith (float dt, PhysicsBody &other)=0 |
| virtual bool | resolveCollisionWithPointMass (float dt, PointMass &pm)=0 |
| virtual bool | resolveCollisionWithRigidBody (float dt, RigidBody &rb)=0 |
Protected Member Functions | |
| PhysicsBody (uint32_t _id) | |
Protected Attributes | |
| std::mutex | stateMutex |
| std::vector< ObjectSnapshot > | frames |
| float | surfaceArea = 1.0f |
Definition at line 43 of file PhysicsBody.h.
|
delete |
|
virtualdefault |
|
inlineexplicitprotected |
Definition at line 94 of file PhysicsBody.h.
| void Physics::PhysicsBody::clearAllFrames | ( | BodyLock | lock | ) |
Definition at line 159 of file PhysicsBody.cpp.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
| std::map< std::string, glm::vec3 > Physics::PhysicsBody::getAllForces | ( | BodyLock | lock | ) | const |
|
inlinevirtual |
Reimplemented in Physics::RigidBody.
Definition at line 83 of file PhysicsBody.h.
| glm::vec3 Physics::PhysicsBody::getForce | ( | const std::string & | name, |
| BodyLock | lock | ||
| ) | const |
Definition at line 46 of file PhysicsBody.cpp.
|
inline |
Definition at line 54 of file PhysicsBody.h.
| bool Physics::PhysicsBody::getIsStatic | ( | BodyLock | lock | ) | const |
|
virtual |
| glm::vec3 Physics::PhysicsBody::getNetForce | ( | BodyLock | lock | ) | const |
| glm::vec3 Physics::PhysicsBody::getPosition | ( | BodyLock | lock | ) | const |
|
inline |
|
virtual |
| glm::vec3 Physics::PhysicsBody::getVelocity | ( | BodyLock | lock | ) | const |
| glm::mat4 Physics::PhysicsBody::getWorldTransform | ( | BodyLock | lock | ) | const |
Definition at line 143 of file PhysicsBody.cpp.
| bool Physics::PhysicsBody::isUnknown | ( | const std::string & | key, |
| BodyLock | lock | ||
| ) | const |
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
inline |
Definition at line 52 of file PhysicsBody.h.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
| void Physics::PhysicsBody::setForce | ( | const std::string & | name, |
| const glm::vec3 & | force, | ||
| BodyLock | lock | ||
| ) |
|
inline |
Definition at line 77 of file PhysicsBody.h.
| void Physics::PhysicsBody::setIsStatic | ( | bool | newStatic, |
| BodyLock | lock | ||
| ) |
|
virtual |
Reimplemented in Physics::PointMass.
Definition at line 115 of file PhysicsBody.cpp.
| void Physics::PhysicsBody::setPosition | ( | const glm::vec3 & | pos, |
| BodyLock | lock | ||
| ) |
|
virtual |
Reimplemented in Physics::PointMass.
Definition at line 167 of file PhysicsBody.cpp.
| void Physics::PhysicsBody::setUnknown | ( | const std::string & | key, |
| bool | active, | ||
| BodyLock | lock | ||
| ) |
Definition at line 16 of file PhysicsBody.cpp.
| void Physics::PhysicsBody::setVelocity | ( | const glm::vec3 & | vel, |
| BodyLock | lock | ||
| ) |
| void Physics::PhysicsBody::setWorldTransform | ( | const glm::mat4 & | M, |
| BodyLock | lock | ||
| ) |
|
pure virtual |
Implemented in Physics::PointMass, and Physics::RigidBody.
| void Physics::PhysicsBody::withFrames | ( | BodyLock | lock, |
| F && | fn | ||
| ) | const |
|
protected |
Definition at line 97 of file PhysicsBody.h.
|
mutableprotected |
Definition at line 96 of file PhysicsBody.h.
|
protected |
Definition at line 98 of file PhysicsBody.h.