PeriDyno 1.0.0
Loading...
Searching...
No Matches
RigidBodyShared.h
Go to the documentation of this file.
1#pragma once
2
3#include "Vector.h"
4#include "Matrix.h"
5#include "Quat.h"
6
8#include "Topology/DiscreteElements.h"
9
10namespace dyno
11{
18
19 // Custom get and set functions for v member
20 static void set_v(TetInfo& obj, const std::vector<Vec3f>& values) {
21 if (values.size() != 4) {
22 throw std::runtime_error("TetInfo.v must be a list of 4 Vec3f elements.");
23 }
24 for (size_t i = 0; i < 4; ++i) {
25 obj.v[i] = values[i];
26 }
27 }
28
29 static std::vector<Vec3f> get_v(const TetInfo& obj) {
30 std::vector<Vec3f> values;
31 for (size_t i = 0; i < 4; ++i) {
32 values.push_back(obj.v[i]);
33 }
34 return values;
35 }
36
104}
Implementation of quaternion.
double Real
Definition Typedef.inl:23
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
@ CT_AllObjects
static std::vector< Vec3f > get_v(const TetInfo &obj)
static void set_v(TetInfo &obj, const std::vector< Vec3f > &values)
unsigned int uint
Definition VkProgram.h:14
RigidBodyInfo(Vector< Real, 3 > p, Quat< Real > q=Quat< Real >(0.0f, 0.0f, 0.0f, 1.0f))
Vector< Real, 3 > offset
An offset from the barycenter to the geometric center.
Vector< Real, 3 > angularVelocity
The angular velocity of the body.
Vector< Real, 3 > position
The barycenter of the body.
CollisionMask collisionMask
Vector< Real, 3 > linearVelocity
The linear velocity of the body's origin in world co-ordinates.
SquareMatrix< Real, 3 > inertia
The inertia of the body.
Vector< Real, 3 > v[4]