Skip to content

Commit 9628b8b

Browse files
committed
rename the Contact class to CharacterContact
1 parent 92b0d25 commit 9628b8b

10 files changed

Lines changed: 66 additions & 53 deletions

File tree

Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ $(N)/glue/c/CylinderShape.cpp \
7676
$(N)/glue/c/CylinderShapeSettings.cpp \
7777
$(N)/glue/ch/CharacterBase.cpp \
7878
$(N)/glue/ch/CharacterBaseSettings.cpp \
79+
$(N)/glue/ch/CharacterContact.cpp \
7980
$(N)/glue/ch/CharacterContactSettings.cpp \
8081
$(N)/glue/ch/Character.cpp \
8182
$(N)/glue/ch/CharacterRefC.cpp \
@@ -93,7 +94,6 @@ $(N)/glue/co/Constraint.cpp \
9394
$(N)/glue/co/ConstraintResult.cpp \
9495
$(N)/glue/co/Constraints.cpp \
9596
$(N)/glue/co/ConstraintSettings.cpp \
96-
$(N)/glue/co/Contact.cpp \
9797
$(N)/glue/co/ContactKey.cpp \
9898
$(N)/glue/co/ContactListener.cpp \
9999
$(N)/glue/co/ContactListenerList.cpp \

src/main/java/com/github/stephengold/joltjni/Contact.java renamed to src/main/java/com/github/stephengold/joltjni/CharacterContact.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ of this software and associated documentation files (the "Software"), to deal
2929

3030
/**
3131
* Describe a contact between a {@code Character} and a body or another
32-
* character. (native type: {@code CharacterContact})
32+
* character.
3333
*
3434
* @author Stephen Gold sgold@sonic.net
3535
*/
36-
public class Contact extends ContactKey implements ConstContact {
36+
public class CharacterContact extends ContactKey implements ConstContact {
3737
// *************************************************************************
3838
// fields
3939

@@ -56,7 +56,8 @@ public class Contact extends ContactKey implements ConstContact {
5656
* <p>
5757
* For use in custom contact listeners.
5858
*/
59-
public Contact(long contactVa, boolean owner, PhysicsSystem system) {
59+
public CharacterContact(
60+
long contactVa, boolean owner, PhysicsSystem system) {
6061
super(false);
6162
assert system != null;
6263
this.system = system;

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ void onAdjustBodyVelocity(
5050
*
5151
* @param characterVa the virtual address of the {@code CharacterVirtual}
5252
* being solved (not zero)
53-
* @param contactVa the virtual address of the {@code Contact} (not zero)
53+
* @param contactVa the virtual address of the {@code CharacterContact} (not
54+
* zero)
5455
* @param settingsVa the virtual address of the
5556
* {@code CharacterContactSettings} for storing the desired behavior (not
5657
* zero)
@@ -64,7 +65,8 @@ void onCharacterContactAdded(
6465
*
6566
* @param characterVa the virtual address of the {@code CharacterVirtual}
6667
* being solved (not zero)
67-
* @param contactVa the virtual address of the {@code Contact} (not zero)
68+
* @param contactVa the virtual address of the {@code CharacterContact} (not
69+
* zero)
6870
* @param settingsVa the virtual address of the
6971
* {@code CharacterContactSettings} for storing the desired behavior (not
7072
* zero)
@@ -137,7 +139,8 @@ void onCharacterContactSolve(long characterVa, long otherCharacterVa,
137139
*
138140
* @param characterVa the virtual address of the {@code CharacterVirtual}
139141
* being solved (not zero)
140-
* @param contactVa the virtual address of the {@code Contact} (not zero)
142+
* @param contactVa the virtual address of the {@code CharacterContact} (not
143+
* zero)
141144
* @return {@code true} if the contact is valid, otherwise {@code false}
142145
*/
143146
boolean onCharacterContactValidate(long characterVa, long contactVa);
@@ -148,7 +151,8 @@ void onCharacterContactSolve(long characterVa, long otherCharacterVa,
148151
*
149152
* @param characterVa the virtual address of the {@code CharacterVirtual}
150153
* being solved (not zero)
151-
* @param contactVa the virtual address of the {@code Contact} (not zero)
154+
* @param contactVa the virtual address of the {@code CharacterContact} (not
155+
* zero)
152156
* @param settingsVa the virtual address of the
153157
* {@code CharacterContactSettings} for storing the desired behavior (not
154158
* zero)
@@ -161,7 +165,8 @@ void onCharacterContactSolve(long characterVa, long otherCharacterVa,
161165
*
162166
* @param characterVa the virtual address of the {@code CharacterVirtual}
163167
* being solved (not zero)
164-
* @param contactVa the virtual address of the {@code Contact} (not zero)
168+
* @param contactVa the virtual address of the {@code CharacterContact} (not
169+
* zero)
165170
* @param settingsVa the virtual address of the
166171
* {@code CharacterContactSettings} for storing the desired behavior (not
167172
* zero)
@@ -230,7 +235,8 @@ void onContactSolve(long characterVa, int bodyId2, int subShapeId2,
230235
*
231236
* @param characterVa the virtual address of the {@code CharacterVirtual}
232237
* being solved (not zero)
233-
* @param contactVa the virtual address of the {@code Contact} (not zero)
238+
* @param contactVa the virtual address of the {@code CharacterContact} (not
239+
* zero)
234240
* @return {@code true} if the contact is valid, otherwise {@code false}
235241
*/
236242
boolean onContactValidate(long characterVa, long contactVa);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public ConstContact[] getActiveContacts() {
455455
ConstContact[] result = new ConstContact[numContacts];
456456
for (int i = 0; i < numContacts; ++i) {
457457
long contactVa = getActiveContact(characterVa, i);
458-
result[i] = new Contact(contactVa, true, system);
458+
result[i] = new CharacterContact(contactVa, true, system);
459459
}
460460

461461
return result;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public ConstContact[] getActiveContacts() {
303303
PhysicsSystem system = getPhysicsSystem();
304304
for (int i = 0; i < numContacts; ++i) {
305305
long contactVa = CharacterVirtual.getActiveContact(characterVa, i);
306-
result[i] = new Contact(contactVa, true, system);
306+
result[i] = new CharacterContact(contactVa, true, system);
307307
}
308308

309309
return result;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public ConstContact[] getActiveContacts() {
135135
PhysicsSystem system = getPhysicsSystem();
136136
for (int i = 0; i < numContacts; ++i) {
137137
long contactVa = CharacterVirtual.getActiveContact(characterVa, i);
138-
result[i] = new Contact(contactVa, true, system);
138+
result[i] = new CharacterContact(contactVa, true, system);
139139
}
140140

141141
return result;

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public void onAdjustBodyVelocity(
6262
*
6363
* @param characterVa the virtual address of the {@code CharacterVirtual}
6464
* being solved (not zero)
65-
* @param contactVa the virtual address of the {@code Contact} (not zero)
65+
* @param contactVa the virtual address of the {@code CharacterContact} (not
66+
* zero)
6667
* @param settingsVa the virtual address of the
6768
* {@code CharacterContactSettings} for storing the desired behavior (not
6869
* zero)
@@ -78,7 +79,8 @@ public void onCharacterContactAdded(
7879
*
7980
* @param characterVa the virtual address of the {@code CharacterVirtual}
8081
* being solved (not zero)
81-
* @param contactVa the virtual address of the {@code Contact} (not zero)
82+
* @param contactVa the virtual address of the {@code CharacterContact} (not
83+
* zero)
8284
* @param settingsVa the virtual address of the
8385
* {@code CharacterContactSettings} for storing the desired behavior (not
8486
* zero)
@@ -157,7 +159,8 @@ public void onCharacterContactSolve(long characterVa, long otherCharacterVa,
157159
*
158160
* @param characterVa the virtual address of the {@code CharacterVirtual}
159161
* being solved (not zero)
160-
* @param contactVa the virtual address of the {@code Contact} (not zero)
162+
* @param contactVa the virtual address of the {@code CharacterContact} (not
163+
* zero)
161164
* @return {@code true} if the contact is valid, otherwise {@code false}
162165
*/
163166
@Override
@@ -172,7 +175,8 @@ public boolean onCharacterContactValidate(
172175
*
173176
* @param characterVa the virtual address of the {@code CharacterVirtual}
174177
* being solved (not zero)
175-
* @param contactVa the virtual address of the {@code Contact} (not zero)
178+
* @param contactVa the virtual address of the {@code CharacterContact} (not
179+
* zero)
176180
* @param settingsVa the virtual address of the
177181
* {@code CharacterContactSettings} for storing the desired behavior (not
178182
* zero)
@@ -188,7 +192,8 @@ public void onContactAdded(
188192
*
189193
* @param characterVa the virtual address of the {@code CharacterVirtual}
190194
* being solved (not zero)
191-
* @param contactVa the virtual address of the {@code Contact} (not zero)
195+
* @param contactVa the virtual address of the {@code CharacterContact} (not
196+
* zero)
192197
* @param settingsVa the virtual address of the
193198
* {@code CharacterContactSettings} for storing the desired behavior (not
194199
* zero)
@@ -265,7 +270,8 @@ public void onContactSolve(long characterVa, int bodyId2, int subShapeId2,
265270
*
266271
* @param characterVa the virtual address of the {@code CharacterVirtual}
267272
* being solved (not zero)
268-
* @param contactVa the virtual address of the {@code Contact} (not zero)
273+
* @param contactVa the virtual address of the {@code CharacterContact} (not
274+
* zero)
269275
* @return {@code true} if the contact is valid, otherwise {@code false}
270276
*/
271277
@Override

src/main/java/com/github/stephengold/joltjni/readonly/ConstContact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ of this software and associated documentation files (the "Software"), to deal
2626
import com.github.stephengold.joltjni.enumerate.EMotionType;
2727

2828
/**
29-
* Read-only access to a {@code Contact}. (native type:
29+
* Read-only access to a {@code CharacterContact}. (native type:
3030
* {@code const CharacterContact}) TODO rename ConstCharacterContact
3131
*
3232
* @author Stephen Gold sgold@sonic.net

src/main/native/glue/co/Contact.cpp renamed to src/main/native/glue/ch/CharacterContact.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ SOFTWARE.
2525
*/
2626
#include "Jolt/Jolt.h"
2727
#include "Jolt/Physics/Character/CharacterVirtual.h"
28-
#include "auto/com_github_stephengold_joltjni_Contact.h"
28+
#include "auto/com_github_stephengold_joltjni_CharacterContact.h"
2929
#include "glue/glue.h"
3030

3131
using namespace JPH;
3232

3333
/*
34-
* Class: com_github_stephengold_joltjni_Contact
34+
* Class: com_github_stephengold_joltjni_CharacterContact
3535
* Method: free
3636
* Signature: (J)V
3737
*/
38-
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_free
38+
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_CharacterContact_free
3939
BODYOF_FREE(CharacterContact)
4040

4141
/*
42-
* Class: com_github_stephengold_joltjni_Contact
42+
* Class: com_github_stephengold_joltjni_CharacterContact
4343
* Method: getCanPushCharacter
4444
* Signature: (J)Z
4545
*/
46-
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getCanPushCharacter
46+
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getCanPushCharacter
4747
(JNIEnv *, jclass, jlong contactVa) {
4848
const CharacterContact * const pContact
4949
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -52,11 +52,11 @@ JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getCanPus
5252
}
5353

5454
/*
55-
* Class: com_github_stephengold_joltjni_Contact
55+
* Class: com_github_stephengold_joltjni_CharacterContact
5656
* Method: getCharacterB
5757
* Signature: (J)J
5858
*/
59-
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_Contact_getCharacterB
59+
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getCharacterB
6060
(JNIEnv *, jclass, jlong contactVa) {
6161
const CharacterContact * const pContact
6262
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -65,11 +65,11 @@ JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_Contact_getCharacter
6565
}
6666

6767
/*
68-
* Class: com_github_stephengold_joltjni_Contact
68+
* Class: com_github_stephengold_joltjni_CharacterContact
6969
* Method: getContactNormal
7070
* Signature: (JLjava/nio/FloatBuffer;)V
7171
*/
72-
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getContactNormal
72+
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getContactNormal
7373
(JNIEnv *pEnv, jclass, jlong contactVa, jobject storeFloats) {
7474
const CharacterContact * const pContact
7575
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -82,11 +82,11 @@ JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getContactNor
8282
}
8383

8484
/*
85-
* Class: com_github_stephengold_joltjni_Contact
85+
* Class: com_github_stephengold_joltjni_CharacterContact
8686
* Method: getDistance
8787
* Signature: (J)F
8888
*/
89-
JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_Contact_getDistance
89+
JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getDistance
9090
(JNIEnv *, jclass, jlong contactVa) {
9191
const CharacterContact * const pContact
9292
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -95,11 +95,11 @@ JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_Contact_getDistance
9595
}
9696

9797
/*
98-
* Class: com_github_stephengold_joltjni_Contact
98+
* Class: com_github_stephengold_joltjni_CharacterContact
9999
* Method: getFraction
100100
* Signature: (J)F
101101
*/
102-
JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_Contact_getFraction
102+
JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getFraction
103103
(JNIEnv *, jclass, jlong contactVa) {
104104
const CharacterContact * const pContact
105105
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -108,11 +108,11 @@ JNIEXPORT jfloat JNICALL Java_com_github_stephengold_joltjni_Contact_getFraction
108108
}
109109

110110
/*
111-
* Class: com_github_stephengold_joltjni_Contact
111+
* Class: com_github_stephengold_joltjni_CharacterContact
112112
* Method: getHadCollision
113113
* Signature: (J)Z
114114
*/
115-
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getHadCollision
115+
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getHadCollision
116116
(JNIEnv *, jclass, jlong contactVa) {
117117
const CharacterContact * const pContact
118118
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -121,11 +121,11 @@ JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getHadCol
121121
}
122122

123123
/*
124-
* Class: com_github_stephengold_joltjni_Contact
124+
* Class: com_github_stephengold_joltjni_CharacterContact
125125
* Method: getIsSensorB
126126
* Signature: (J)Z
127127
*/
128-
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getIsSensorB
128+
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getIsSensorB
129129
(JNIEnv *, jclass, jlong contactVa) {
130130
const CharacterContact * const pContact
131131
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -134,11 +134,11 @@ JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getIsSens
134134
}
135135

136136
/*
137-
* Class: com_github_stephengold_joltjni_Contact
137+
* Class: com_github_stephengold_joltjni_CharacterContact
138138
* Method: getLinearVelocity
139139
* Signature: (JLjava/nio/FloatBuffer;)V
140140
*/
141-
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getLinearVelocity
141+
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getLinearVelocity
142142
(JNIEnv *pEnv, jclass, jlong contactVa, jobject storeFloats) {
143143
const CharacterContact * const pContact
144144
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -151,11 +151,11 @@ JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getLinearVelo
151151
}
152152

153153
/*
154-
* Class: com_github_stephengold_joltjni_Contact
154+
* Class: com_github_stephengold_joltjni_CharacterContact
155155
* Method: getMotionTypeB
156156
* Signature: (J)I
157157
*/
158-
JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_Contact_getMotionTypeB
158+
JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getMotionTypeB
159159
(JNIEnv *, jclass, jlong contactVa) {
160160
const CharacterContact * const pContact
161161
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -164,11 +164,11 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_Contact_getMotionType
164164
}
165165

166166
/*
167-
* Class: com_github_stephengold_joltjni_Contact
167+
* Class: com_github_stephengold_joltjni_CharacterContact
168168
* Method: getPosition
169169
* Signature: (JLjava/nio/DoubleBuffer;)V
170170
*/
171-
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getPosition
171+
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getPosition
172172
(JNIEnv *pEnv, jclass, jlong contactVa, jobject storeDoubles) {
173173
const CharacterContact * const pContact
174174
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -181,11 +181,11 @@ JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getPosition
181181
}
182182

183183
/*
184-
* Class: com_github_stephengold_joltjni_Contact
184+
* Class: com_github_stephengold_joltjni_CharacterContact
185185
* Method: getSurfaceNormal
186186
* Signature: (JLjava/nio/FloatBuffer;)V
187187
*/
188-
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getSurfaceNormal
188+
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getSurfaceNormal
189189
(JNIEnv *pEnv, jclass, jlong contactVa, jobject storeFloats) {
190190
const CharacterContact * const pContact
191191
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -198,11 +198,11 @@ JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_Contact_getSurfaceNor
198198
}
199199

200200
/*
201-
* Class: com_github_stephengold_joltjni_Contact
201+
* Class: com_github_stephengold_joltjni_CharacterContact
202202
* Method: getUserData
203203
* Signature: (J)J
204204
*/
205-
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_Contact_getUserData
205+
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getUserData
206206
(JNIEnv *, jclass, jlong contactVa) {
207207
const CharacterContact * const pContact
208208
= reinterpret_cast<CharacterContact *> (contactVa);
@@ -211,11 +211,11 @@ JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_Contact_getUserData
211211
}
212212

213213
/*
214-
* Class: com_github_stephengold_joltjni_Contact
214+
* Class: com_github_stephengold_joltjni_CharacterContact
215215
* Method: getWasDiscarded
216216
* Signature: (J)Z
217217
*/
218-
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_Contact_getWasDiscarded
218+
JNIEXPORT jboolean JNICALL Java_com_github_stephengold_joltjni_CharacterContact_getWasDiscarded
219219
(JNIEnv *, jclass, jlong contactVa) {
220220
const CharacterContact * const pContact
221221
= reinterpret_cast<CharacterContact *> (contactVa);

0 commit comments

Comments
 (0)