Skip to content

Commit

Permalink
rename DrawSettings to distinguish it from SkeletonPose::DrawSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Sep 19, 2024
1 parent b620c28 commit 017611a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ of this software and associated documentation files (the "Software"), to deal
*
* @author Stephen Gold [email protected]
*/
public class DrawSettings extends JoltPhysicsObject {
public class BodyManagerDrawSettings extends JoltPhysicsObject {
// *************************************************************************
// constructors

/**
* Instantiate settings with the default values.
*/
public DrawSettings() {
public BodyManagerDrawSettings() {
long settingsVa = createDrawSettings();
setVirtualAddress(settingsVa, () -> free(settingsVa));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public void addConstraint(Constraint constraint) {
* @param settings the settings to use (not null)
* @param renderer the renderer to use (not null)
*/
public void drawBodies(DrawSettings settings, DebugRenderer renderer) {
public void drawBodies(
BodyManagerDrawSettings settings, DebugRenderer renderer) {
long systemVa = va();
long settingsVa = settings.va();
long rendererVa = renderer.va();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@ SOFTWARE.
*/
#include <Jolt/Jolt.h>
#include <Jolt/Physics/Body/BodyManager.h>
#include "auto/com_github_stephengold_joltjni_DrawSettings.h"
#include "auto/com_github_stephengold_joltjni_BodyManagerDrawSettings.h"
#include "glue/glue.h"

using namespace JPH;

/*
* Class: com_github_stephengold_joltjni_DrawSettings
* Class: com_github_stephengold_joltjni_BodyManagerDrawSettings
* Method: createDrawSettings
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_DrawSettings_createDrawSettings
JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_BodyManagerDrawSettings_createDrawSettings
(JNIEnv *, jclass) {
#ifdef JPH_DEBUG_RENDERER
BodyManager::DrawSettings * const pResult = new BodyManager::DrawSettings();
TRACE_NEW("DrawSettings", pResult)
TRACE_NEW("BodyManager::DrawSettings", pResult)
return reinterpret_cast<jlong> (pResult);
#else
return 0;
#endif
}

/*
* Class: com_github_stephengold_joltjni_DrawSettings
* Class: com_github_stephengold_joltjni_BodyManagerDrawSettings
* Method: free
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_DrawSettings_free
JNIEXPORT void JNICALL Java_com_github_stephengold_joltjni_BodyManagerDrawSettings_free
(JNIEnv *, jclass, jlong settingsVa) {
#ifdef JPH_DEBUG_RENDERER
BodyManager::DrawSettings * const pSettings
= reinterpret_cast<BodyManager::DrawSettings *> (settingsVa);
TRACE_DELETE("DrawSettings", pSettings)
TRACE_DELETE("BodyManager::DrawSettings", pSettings)
delete pSettings;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ else if (validate_state)
if (enable_debug_renderer)
{
// Draw the state of the world
DrawSettings settings = new DrawSettings();
BodyManagerDrawSettings settings = new BodyManagerDrawSettings();
physics_system.drawBodies(settings, renderer);

// Mark end of frame
Expand Down

0 comments on commit 017611a

Please sign in to comment.