Package com.github.stephengold.joltjni
Class HeightFieldShape
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.HeightFieldShape
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstShape,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A
Shape to represent a surface defined by a matrix of heights.-
Method Summary
Modifier and TypeMethodDescriptionintReturn the block size.getPosition(int x, int y) Copy the location of specified sample.booleanisNoCollision(int x, int y) Test whether the shape has a hole at the specified sample.Methods inherited from class com.github.stephengold.joltjni.Shape
copyDebugTriangles, countDebugTriangles, draw, getCenterOfMass, getInnerRadius, getLocalBounds, getMassProperties, getRefCount, getSubType, getType, getUserData, getWorldSpaceBounds, mustBeStatic, setEmbedded, setUserData, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
Method Details
-
getBlockSize
public int getBlockSize()Return the block size. The shape is unaffected.- Returns:
- the number of height values in a block
-
getPosition
Copy the location of specified sample. The shape is unaffected.- Parameters:
x- the X coordinate of the sample (≥0, <sampleCount)y- the Y coordinate of the sample (≥0, <sampleCount)- Returns:
- a new location vector
-
isNoCollision
public boolean isNoCollision(int x, int y) Test whether the shape has a hole at the specified sample. The shape is unaffected.- Parameters:
x- the X coordinate of the sample (≥0, <sampleCount)y- the Y coordinate of the sample (≥0, <sampleCount)- Returns:
- true if there's a hole, otherwise false
-