forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodeHingeJoint.I
More file actions
186 lines (156 loc) · 4.26 KB
/
odeHingeJoint.I
File metadata and controls
186 lines (156 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file odeHingeJoint.I
* @author joswilso
* @date 2006-12-27
*/
INLINE void OdeHingeJoint::
set_anchor(dReal x, dReal y, dReal z) {
dJointSetHingeAnchor(_id, x, y, z);
}
INLINE void OdeHingeJoint::
set_anchor(const LVecBase3f &anchor) {
dJointSetHingeAnchor(_id, anchor[0], anchor[1], anchor[2]);
}
INLINE void OdeHingeJoint::
set_anchor_delta(dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az) {
dJointSetHingeAnchorDelta(_id, x, y, z, ax, ay, az);
}
INLINE void OdeHingeJoint::
set_anchor_delta(const LVecBase3f &anchor, const LVecBase3f &vec) {
dJointSetHingeAnchorDelta(_id, anchor[0], anchor[1], anchor[2], vec[0], vec[1], vec[2]);
}
INLINE void OdeHingeJoint::
set_axis(dReal x, dReal y, dReal z) {
dJointSetHingeAxis(_id, x, y, z);
}
INLINE void OdeHingeJoint::
set_axis(const LVecBase3f &axis) {
dJointSetHingeAxis(_id, axis[0], axis[1], axis[2]);
}
INLINE void OdeHingeJoint::
add_torque(dReal torque) {
dJointAddHingeTorque(_id, torque);
}
INLINE LVecBase3f OdeHingeJoint::
get_anchor() const {
dVector3 result;
dJointGetHingeAnchor(_id, result);
return LVecBase3f(result[0], result[1], result[2]);
}
INLINE LVecBase3f OdeHingeJoint::
get_anchor2() const {
dVector3 result;
dJointGetHingeAnchor2(_id, result);
return LVecBase3f(result[0], result[1], result[2]);
}
INLINE LVecBase3f OdeHingeJoint::
get_axis() const {
dVector3 result;
dJointGetHingeAxis(_id, result);
return LVecBase3f(result[0], result[1], result[2]);
}
INLINE dReal OdeHingeJoint::
get_angle() const {
return dJointGetHingeAngle(_id);
}
INLINE dReal OdeHingeJoint::
get_angle_rate() const {
return dJointGetHingeAngleRate(_id);
}
INLINE void OdeHingeJoint::
set_param_lo_stop(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamLoStop, val);
}
INLINE void OdeHingeJoint::
set_param_hi_stop(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamHiStop, val);
}
INLINE void OdeHingeJoint::
set_param_vel(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamVel, val);
}
INLINE void OdeHingeJoint::
set_param_f_max(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamFMax, val);
}
INLINE void OdeHingeJoint::
set_param_fudge_factor(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamFudgeFactor, val);
}
INLINE void OdeHingeJoint::
set_param_bounce(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamBounce, val);
}
INLINE void OdeHingeJoint::
set_param_CFM(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamCFM, val);
}
INLINE void OdeHingeJoint::
set_param_stop_ERP(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamStopERP, val);
}
INLINE void OdeHingeJoint::
set_param_stop_CFM(dReal val) {
nassertv( _id != 0 );
dJointSetHingeParam(_id, dParamStopCFM, val);
}
INLINE dReal OdeHingeJoint::
get_param_lo_stop() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamLoStop);
}
INLINE dReal OdeHingeJoint::
get_param_hi_stop() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamHiStop);
}
INLINE dReal OdeHingeJoint::
get_param_vel() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamVel);
}
INLINE dReal OdeHingeJoint::
get_param_f_max() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamFMax);
}
INLINE dReal OdeHingeJoint::
get_param_fudge_factor() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamFudgeFactor);
}
INLINE dReal OdeHingeJoint::
get_param_bounce() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamBounce);
}
INLINE dReal OdeHingeJoint::
get_param_CFM() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamCFM);
}
INLINE dReal OdeHingeJoint::
get_param_stop_ERP() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamStopERP);
}
INLINE dReal OdeHingeJoint::
get_param_stop_CFM() const {
nassertr( _id != 0, 0 );
return dJointGetHingeParam(_id, dParamStopCFM);
}