Skip to content

Commit

Permalink
VehicleConstraintRef: add the resetGravityOverride() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 15, 2025
1 parent 58aeda6 commit b8a6816
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public void onStep(long contextVa) {
onStep(constraintVa, contextVa);
}
// *************************************************************************
// native private methods
// native methods

native private static int countWheels(long constraintVa);

Expand All @@ -290,7 +290,7 @@ native private static long getWheelWorldTransform(
native private static void overrideGravity(
long constraintVa, float ax, float ay, float az);

native private static void resetGravityOverride(long constraintVa);
native static void resetGravityOverride(long constraintVa);

native private static void setNumStepsBetweenCollisionTestActive(
long constraintVa, int numSteps);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2024 Stephen Gold
Copyright (c) 2024-2025 Stephen Gold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -54,6 +54,16 @@ public VehicleConstraintRef() {
setVirtualAddress(refVa, freeingAction);
}
// *************************************************************************
// new methods exposed

/**
* Remove the gravity override, if any.
*/
public void resetGravityOverride() {
long constraintVa = targetVa();
VehicleConstraint.resetGravityOverride(constraintVa);
}
// *************************************************************************
// Ref methods

/**
Expand Down

0 comments on commit b8a6816

Please sign in to comment.