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