|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
A proxy object that provides an AoS-like interface to a body stored in the Bodies SoA container.
More...
#include <body.hpp>


Public Member Functions | |
| BodyProxy (Bodies &in_bodies, std::size_t in_index) | |
| Construct a new Body Proxy object. More... | |
| operator ConstBodyProxy () const | |
| Implicit conversion operator to a const proxy. More... | |
| Vector3d & | a () |
| Access to body accelerations. More... | |
| Vector3d & | alpha () |
| Access to body angular accelerations. More... | |
| Vector3d & | omega () |
| Access to body angular velocities. More... | |
| void | addToX (const Vector3d &correction) |
| Add a displacement to a position. More... | |
| Vector3d | applyImpulse (const Vector3d &in_J, const Vector3d &in_r_vec) |
| Apply an impulse to a body. More... | |
| void | setAcceleration (const Vector3d &new_a) |
| Set the acceleration of a body. More... | |
| void | setAngularAcceleration (const Vector3d &new_alpha) |
| Set the angular acceleration of a body. More... | |
| void | accumulateAcceleration (const Vector3d &accel) |
| Accumulate an acceleration to a body. More... | |
| void | accumulateAngularAcceleration (const Vector3d &in_alpha) |
| Accumulate an angular acceleration to a body. More... | |
| void | resetAccelerations () |
| Resets linear and angular accelerations to zero. More... | |
| void | resetTorque () |
| Resets the accumulated torque to zero. More... | |
| void | accumulateTorque (const Vector3d &torque) |
| Accumulates a torque vector to the body's total torque. More... | |
| void | dampenVelocity (double linear_damping, double angular_damping) |
| Applies damping to linear and angular velocities. More... | |
| void | updateAlphaFromTorque () |
| Updates angular acceleration based on the accumulated torque. More... | |
Public Member Functions inherited from Model::BodyProxyBase< Bodies > | |
| BodyProxyBase (Bodies &in_bodies, std::size_t in_index) | |
| Construct a new Body Proxy Base object. More... | |
| double | m () const noexcept |
| Access to body masses. More... | |
| double | getInverseMass () const |
| Access to the inverse of the body masses. More... | |
| double | r () const noexcept |
| Access to body radii. More... | |
| double | getInverseInertia () const |
| Access to the inverse of the body's moment of inertia. More... | |
| const Vector3d & | x () const noexcept |
| Access to body positions. More... | |
| const Vector3d & | v () const noexcept |
| Access to body velocities. More... | |
| const Quaterniond & | q () const noexcept |
| Access to body orientation. More... | |
| const Vector3d & | omega () const noexcept |
| Access to body angular velocities. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Model::BodyProxyBase< Bodies > | |
| Bodies & | bodies_ |
| Reference to the main SoA container. More... | |
| std::size_t | index_ |
| The index of the body this proxy refers to. More... | |
A proxy object that provides an AoS-like interface to a body stored in the Bodies SoA container.
Mutable proxy for accessing individual bodies in the Bodies container.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Apply an impulse to a body.
| in_J | Impulse to be applied. |
| in_r_vec | Vector from the centre of mass to the contact point. |
Definition at line 514 of file body.hpp.


|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |