diff --git a/src/main/java/com/github/stephengold/joltjni/Float3.java b/src/main/java/com/github/stephengold/joltjni/Float3.java index 4eed192a..2f575ade 100644 --- a/src/main/java/com/github/stephengold/joltjni/Float3.java +++ b/src/main/java/com/github/stephengold/joltjni/Float3.java @@ -21,6 +21,8 @@ of this software and associated documentation files (the "Software"), to deal */ package com.github.stephengold.joltjni; +import java.nio.FloatBuffer; + /** * A vector composed of 3 single-precision components, used as a storage class. * @@ -102,6 +104,18 @@ public float get(int index) { } } + /** + * Write all 3 components to the specified buffer and advance the buffer's + * position by 3. The vector is unaffected. + * + * @param storeBuffer the destination buffer (not null) + */ + public void put(FloatBuffer storeBuffer) { + storeBuffer.put(x); + storeBuffer.put(y); + storeBuffer.put(z); + } + /** * Set all 3 components to specified values. *