Package com.github.stephengold.joltjni
Class HeightFieldShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.HeightFieldShapeSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSerializableObject,ConstShapeSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
HeightFieldShape.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate the default settings.HeightFieldShapeSettings(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount) Instantiate settings for the specified samples.HeightFieldShapeSettings(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices) Instantiate settings for the specified samples.HeightFieldShapeSettings(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices, PhysicsMaterialList materialList) Instantiate settings for the specified samples.Instantiate a copy of the specified settings.HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount) Instantiate settings for the specified samples.HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices) Instantiate settings for the specified samples.HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices, PhysicsMaterialList materialList) 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.Copy the offset of the first sample.intCount the samples.getScale()Copy 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, cloneShapeSettings, create, getRefCount, setEmbedded, setVirtualAddressAsCoOwner, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
HeightFieldShapeSettings
public HeightFieldShapeSettings()Instantiate the default settings. -
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(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices) 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)materialIndices- a material index for each sample (default=null)
-
HeightFieldShapeSettings
public HeightFieldShapeSettings(float[] samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices, PhysicsMaterialList materialList) 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)materialIndices- a material index for each sample (default=null)materialList- the list of materials
-
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)
-
HeightFieldShapeSettings
public HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices) 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)materialIndices- a material index for each sample (default=null)
-
HeightFieldShapeSettings
public HeightFieldShapeSettings(FloatBuffer samples, Vec3Arg offset, Vec3Arg scale, int sampleCount, byte[] materialIndices, PhysicsMaterialList materialList) 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)materialIndices- a material index for each sample (default=null)materialList- the list of materials
-
HeightFieldShapeSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
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
Copy 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
Copy 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=-1e15)
-
setMinHeightValue
public void setMinHeightValue(float minHeight) Alter the artificial minimum height. (native attribute: mMinHeightValue)- Parameters:
minHeight- the desired height value (default=1e15)
-
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))
-