PeriDyno 1.2.1
Loading...
Searching...
No Matches
VehicleInfo.h
Go to the documentation of this file.
1
2#pragma once
3#include <vector>
4#include <memory>
5#include <string>
6
7#include "Vector.h"
8#include "Matrix.h"
9#include "OBase.h"
10
11
12namespace dyno {
13
20
22 {
23 Box = 1,
24 Tet = 2,
26 Sphere = 8,
27 Tri = 16,
29 };
30
32 {
34 Slider = 2,
35 Hinge = 3,
36 Fixed = 4,
37 Point = 5,
39 };
40
41 struct Name_Shape
42 {
43 //Func
45 Name_Shape(std::string n,int Id = -1)
46 {
47 name = n;
48 rigidBodyId = Id;
49 }
50
51 //Var
52 std::string name = "";
53 int rigidBodyId = -1;
54
55 };
56
61 {
63
64 VehicleRigidBodyInfo(Name_Shape name, int shapeId, ConfigShapeType type, Real density = 100);
65
66 VehicleRigidBodyInfo(Name_Shape name, int shapeId, ConfigShapeType type, Transform3f trans, Real density = 100);
67
68 //Shape:
70
71 int meshShapeId = -1;//1 //3
73 Transform3f transform = Transform3f(Vec3f(0), Mat3f::identityMatrix(), Vec3f(1));//15 //19
74 Vec3f Offset = Vec3f(0);//3 //22
75
76 Vec3f mHalfLength = Vec3f(1);//3 //25 // if(type == Box);
77 float radius = 1;//1 //26 // if(type == Sphere); if(type == Capsule);
78 std::vector<Vec3f> tet = {Vec3f(0),Vec3f(0),Vec3f(0),Vec3f(0,1,0) };//12 //38 // if(type == Tet);
79 float capsuleLength = 1;//1 //39 // if(type == Capsule);
81
82 Real mDensity = 100;//1 //41
83
84 uint rigidGroup = 0;//1 //42
85 };
86
91 {
93 VehicleJointInfo(Name_Shape Name1,Name_Shape Name2,ConfigJointType typeIn,Vector<Real, 3> Axi = Vec3f(1, 0, 0),Vector<Real, 3> Point = Vec3f(0),bool Moter = false,Real moter = 0,bool Range = false,Real min = 0,Real max = 0);
94
98 bool mUseMoter = false;//1
99 bool mUseRange = false;//1
101 Real mMin = 0;//1
102 Real mMax = 0;//1
103 Real mMoter = 0;//1
105 };
106
107
114 {
115 public:
117 VehicleBind(int size);
118 ~VehicleBind();
119
120 bool isValid() {return mVehicleRigidBodyInfo.size();}
121
122 std::vector<VehicleRigidBodyInfo> mVehicleRigidBodyInfo;
123 std::vector<VehicleJointInfo> mVehicleJointInfo;
124
125
126
127 };
128
130 {
131 public:
132
134 Animation2JointConfig(std::string name, int id, uint axis)
135 {
136 this->JointName = name;
137 this->JointId = id;
138 this->Axis = axis;
139 }
140 Animation2JointConfig(std::string name, int id, uint axis, float intensity)
141 {
142 this->JointName = name;
143 this->JointId = id;
144 this->Axis = axis;
145 this->Intensity = intensity;
146 }
147 std::string JointName;
148 int JointId = -1;
150 float Intensity = 1;
151 };
152
153
154}
155#include "VehicleInfo.inl"
156
double Real
Definition Typedef.inl:23
Animation2JointConfig(std::string name, int id, uint axis)
Animation2JointConfig(std::string name, int id, uint axis, float intensity)
std::vector< VehicleRigidBodyInfo > mVehicleRigidBodyInfo
std::vector< VehicleJointInfo > mVehicleJointInfo
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
ConfigJointType
Definition VehicleInfo.h:32
@ Point
Definition VehicleInfo.h:37
@ BallAndSocket
Definition VehicleInfo.h:33
@ OtherJoint
Definition VehicleInfo.h:38
@ Slider
Definition VehicleInfo.h:34
@ Hinge
Definition VehicleInfo.h:35
@ Fixed
Definition VehicleInfo.h:36
ConfigShapeType
Definition VehicleInfo.h:22
@ Sphere
Definition VehicleInfo.h:26
@ OtherShape
Definition VehicleInfo.h:28
@ Capsule
Definition VehicleInfo.h:25
Transform< float, 3 > Transform3f
Vector< float, 3 > Vec3f
Definition Vector3D.h:93
unsigned int uint
Definition VkProgram.h:14
ConfigMotionType
Definition VehicleInfo.h:15
@ CMT_Static
Definition VehicleInfo.h:16
@ CMT_Dynamic
Definition VehicleInfo.h:18
@ CMT_Kinematic
Definition VehicleInfo.h:17
std::string name
Definition VehicleInfo.h:52
Name_Shape(std::string n, int Id=-1)
Definition VehicleInfo.h:45
Vector< Real, 3 > mAnchorPoint
ConfigJointType mJointType
Definition VehicleInfo.h:95
Name_Shape mRigidBodyName_2
Definition VehicleInfo.h:97
Name_Shape mRigidBodyName_1
Definition VehicleInfo.h:96
Vector< Real, 3 > mAxis
std::vector< Vec3f > tet
Definition VehicleInfo.h:78
ConfigMotionType motion
Definition VehicleInfo.h:80
ConfigShapeType shapeType
Definition VehicleInfo.h:72
#define max(x, y)
Definition svd3_cuda.h:41