Skip to content

Commit 54295ba

Browse files
committed
MotorSettings: re-order methods
1 parent e1a5e34 commit 54295ba

File tree

1 file changed

+92
-90
lines changed

1 file changed

+92
-90
lines changed

src/main/java/com/github/stephengold/joltjni/MotorSettings.java

Lines changed: 92 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,98 @@ public MotorSettings(ConstMotorSettings original) {
9292
// *************************************************************************
9393
// new methods exposed
9494

95+
/**
96+
* Alter both force limits of a linear motor to be symmetrical.
97+
*
98+
* @param limit the desired limit (in Newtons)
99+
*/
100+
public void setForceLimit(float limit) {
101+
long settingsVa = va();
102+
setForceLimit(settingsVa, limit);
103+
}
104+
105+
/**
106+
* Alter both force limits of a linear motor.
107+
*
108+
* @param min the desired lower limit (in Newtons, default=-MAX_FLOAT)
109+
* @param max the desired upper limit (in Newtons, default=MAX_FLOAT)
110+
*/
111+
public void setForceLimits(float min, float max) {
112+
long settingsVa = va();
113+
setForceLimits(settingsVa, min, max);
114+
}
115+
116+
/**
117+
* Alter the maximum force to apply in a linear constraint. Ignored in an
118+
* angular motor. (native attribute: mMaxForceLimit)
119+
*
120+
* @param force the desired amount of force (in Newtons, typically positive,
121+
* default=MAX_VALUE)
122+
*/
123+
public void setMaxForceLimit(float force) {
124+
long settingsVa = va();
125+
setMaxForceLimit(settingsVa, force);
126+
}
127+
128+
/**
129+
* Alter the maximum torque to apply in an angular constraint. Ignored in a
130+
* linear motor. (native attribute: mMaxTorqueLimit)
131+
*
132+
* @param torque the desired amount of torque (in Newton.meters, typically
133+
* positive, default=MAX_VALUE)
134+
*/
135+
public void setMaxTorqueLimit(float torque) {
136+
long settingsVa = va();
137+
setMaxTorqueLimit(settingsVa, torque);
138+
}
139+
140+
/**
141+
* Alter the minimum force to apply in a linear constraint. Ignored in an
142+
* angular motor. (native attribute: mMinForceLimit)
143+
*
144+
* @param force the desired amount of force (in Newtons, typically negative,
145+
* default=-MAX_VALUE)
146+
*/
147+
public void setMinForceLimit(float force) {
148+
long settingsVa = va();
149+
setMinForceLimit(settingsVa, force);
150+
}
151+
152+
/**
153+
* Alter the minimum torque to apply in an angular constraint. Ignored in a
154+
* linear motor. (native attribute: mMinTorqueLimit)
155+
*
156+
* @param torque the desired amount of torque (in Newton.meters, typically
157+
* negative, default=-MAX_VALUE)
158+
*/
159+
public void setMinTorqueLimit(float torque) {
160+
long settingsVa = va();
161+
setMinTorqueLimit(settingsVa, torque);
162+
}
163+
164+
/**
165+
* Alter both torque limits of an angular motor to be symmetrical.
166+
*
167+
* @param limit the desired upper limit (in Newton.meters)
168+
*/
169+
public void setTorqueLimit(float limit) {
170+
long settingsVa = va();
171+
setTorqueLimit(settingsVa, limit);
172+
}
173+
174+
/**
175+
* Alter both torque limits of an angular motor.
176+
*
177+
* @param min the desired lower limit (in Newton.meters, default=-MAX_FLOAT)
178+
* @param max the desired upper limit (in Newton.meters, default=MAX_FLOAT)
179+
*/
180+
public void setTorqueLimits(float min, float max) {
181+
long settingsVa = va();
182+
setTorqueLimits(settingsVa, min, max);
183+
}
184+
// *************************************************************************
185+
// ConstMotorSettings methods
186+
95187
/**
96188
* Access the underlying {@code Constraint}, if any.
97189
*
@@ -218,96 +310,6 @@ public boolean isValid() {
218310

219311
return result;
220312
}
221-
222-
/**
223-
* Alter both force limits of a linear motor to be symmetrical.
224-
*
225-
* @param limit the desired limit (in Newtons)
226-
*/
227-
public void setForceLimit(float limit) {
228-
long settingsVa = va();
229-
setForceLimit(settingsVa, limit);
230-
}
231-
232-
/**
233-
* Alter both force limits of a linear motor.
234-
*
235-
* @param min the desired lower limit (in Newtons, default=-MAX_FLOAT)
236-
* @param max the desired upper limit (in Newtons, default=MAX_FLOAT)
237-
*/
238-
public void setForceLimits(float min, float max) {
239-
long settingsVa = va();
240-
setForceLimits(settingsVa, min, max);
241-
}
242-
243-
/**
244-
* Alter the maximum force to apply in a linear constraint. Ignored in an
245-
* angular motor. (native attribute: mMaxForceLimit)
246-
*
247-
* @param force the desired amount of force (in Newtons, typically positive,
248-
* default=MAX_VALUE)
249-
*/
250-
public void setMaxForceLimit(float force) {
251-
long settingsVa = va();
252-
setMaxForceLimit(settingsVa, force);
253-
}
254-
255-
/**
256-
* Alter the maximum torque to apply in an angular constraint. Ignored in a
257-
* linear motor. (native attribute: mMaxTorqueLimit)
258-
*
259-
* @param torque the desired amount of torque (in Newton.meters, typically
260-
* positive, default=MAX_VALUE)
261-
*/
262-
public void setMaxTorqueLimit(float torque) {
263-
long settingsVa = va();
264-
setMaxTorqueLimit(settingsVa, torque);
265-
}
266-
267-
/**
268-
* Alter the minimum force to apply in a linear constraint. Ignored in an
269-
* angular motor. (native attribute: mMinForceLimit)
270-
*
271-
* @param force the desired amount of force (in Newtons, typically negative,
272-
* default=-MAX_VALUE)
273-
*/
274-
public void setMinForceLimit(float force) {
275-
long settingsVa = va();
276-
setMinForceLimit(settingsVa, force);
277-
}
278-
279-
/**
280-
* Alter the minimum torque to apply in an angular constraint. Ignored in a
281-
* linear motor. (native attribute: mMinTorqueLimit)
282-
*
283-
* @param torque the desired amount of torque (in Newton.meters, typically
284-
* negative, default=-MAX_VALUE)
285-
*/
286-
public void setMinTorqueLimit(float torque) {
287-
long settingsVa = va();
288-
setMinTorqueLimit(settingsVa, torque);
289-
}
290-
291-
/**
292-
* Alter both torque limits of an angular motor to be symmetrical.
293-
*
294-
* @param limit the desired upper limit (in Newton.meters)
295-
*/
296-
public void setTorqueLimit(float limit) {
297-
long settingsVa = va();
298-
setTorqueLimit(settingsVa, limit);
299-
}
300-
301-
/**
302-
* Alter both torque limits of an angular motor.
303-
*
304-
* @param min the desired lower limit (in Newton.meters, default=-MAX_FLOAT)
305-
* @param max the desired upper limit (in Newton.meters, default=MAX_FLOAT)
306-
*/
307-
public void setTorqueLimits(float min, float max) {
308-
long settingsVa = va();
309-
setTorqueLimits(settingsVa, min, max);
310-
}
311313
// *************************************************************************
312314
// native private methods
313315

0 commit comments

Comments
 (0)