Package com.github.stephengold.joltjni
Class HeightFieldShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.HeightFieldShapeSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Settings used to construct a
HeightFieldShape.-
Constructor Summary
ConstructorsConstructorDescriptionHeightFieldShapeSettings(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount) Instantiate settings for the specified samples.HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount) Instantiate settings for the specified samples. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the cosine of the active-edge threshold angle.intReturn the number of bits per sample to use during compression.intReturn the block size.floatReturn the artificial maximum height.floatReturn the artificial minimum height.Return the offset of the first sample.intCount the samples.getScale()Return the scale factors.voidsetActiveEdgeCosThresholdAngle(float cosine) Alter the active-edge threshold angle.voidsetBitsPerSample(int numBits) Alter the number of bits per sample to use during compression.voidsetBlockSize(int numRows) Alter the block size.voidsetMaxHeightValue(float maxHeight) Alter the artificial maximum height.voidsetMinHeightValue(float minHeight) Alter the artificial minimum height.voidAlter the offset of the first sample.voidAlter the scale factors.Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, create, getRefCount, setEmbedded, toRefMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
HeightFieldShapeSettings
Instantiate settings for the specified samples.- Parameters:
samples- array of height values (not null, length≥4, unaffected)offset- (not null, unaffected)scale- (not null, unaffected)sampleCount- the number of height values along each edge (≥2*blockSize)
-
HeightFieldShapeSettings
public HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount) Instantiate settings for the specified samples.- Parameters:
samples- array of height values (not null, capacity≥4, unaffected)offset- (not null, unaffected)scale- (not null, unaffected)sampleCount- the number of height values along each edge (≥2*blockSize)
-
-
Method Details
-
getActiveEdgeCosThresholdAngle
public float getActiveEdgeCosThresholdAngle()Return the cosine of the active-edge threshold angle. The settings are unaffected. (native attribute: mActiveEdgeCosThresholdAngle)- Returns:
- the cosine
-
getBitsPerSample
public int getBitsPerSample()Return the number of bits per sample to use during compression. The settings are unaffected. (native attribute: mBitsPerSample)- Returns:
- the number of bits (≥1, ≤8)
-
getBlockSize
public int getBlockSize()Return the block size. The settings are unaffected. (native attribute: mBlockSize)For culling purposes, the height field is organized in blocks of
2 * mBlockSize * mBlockSizetriangles.Sensible values range from 2 to 8.
- Returns:
- the block size (in rows)
-
getMaxHeightValue
public float getMaxHeightValue()Return the artificial maximum height. The settings are unaffected. (native attribute: mMaxHeightValue)- Returns:
- the height value
-
getMinHeightValue
public float getMinHeightValue()Return the artificial minimum height. The settings are unaffected. (native attribute: mMinHeightValue)- Returns:
- the height value
-
getOffset
Return the offset of the first sample. The settings are unaffected. (native attribute: mOffset)- Returns:
- a new offset vector
-
getSampleCount
public int getSampleCount()Count the samples. The settings are unaffected. (native attribute: mSampleCount)- Returns:
- the number of samples (≥0)
-
getScale
Return the scale factors. The settings are unaffected. (native attribute: mScale)- Returns:
- a new scaling vector
-
setActiveEdgeCosThresholdAngle
public void setActiveEdgeCosThresholdAngle(float cosine) Alter the active-edge threshold angle. (native attribute: mActiveEdgeCosThresholdAngle)- Parameters:
cosine- the cosine of the desired angle (default=0.996195)
-
setBitsPerSample
public void setBitsPerSample(int numBits) Alter the number of bits per sample to use during compression. (native attribute: mBitsPerSample)- Parameters:
numBits- the number of bits (≥1, ≤8, default=8)
-
setBlockSize
public void setBlockSize(int numRows) Alter the block size. (native attribute: mBlockSize)For culling purposes, the height field is organized in blocks of
2 * mBlockSize * mBlockSizetriangles.Sensible values range from 2 to 8.
- Parameters:
numRows- the desired block size (in rows, default=2)
-
setMaxHeightValue
public void setMaxHeightValue(float maxHeight) Alter the artificial maximum height. (native attribute: mMaxHeightValue)- Parameters:
maxHeight- the desired height value (default=-MAX_VALUE)
-
setMinHeightValue
public void setMinHeightValue(float minHeight) Alter the artificial minimum height. (native attribute: mMinHeightValue)- Parameters:
minHeight- the desired height value (default=MAX_VALUE)
-
setOffset
Alter the offset of the first sample. (native attribute: mOffset)- Parameters:
offset- the desired offset vector (not null, unaffected, default=(0,0,0))
-
setScale
Alter the scale factors. (native attribute: mScale)- Parameters:
scale- the desired scale factors (not null, unaffected, default=(1,1,1))
-