File tree Expand file tree Collapse file tree
src/main/java/com/github/stephengold/joltjni Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,6 +227,28 @@ public Float3 getVelocity() {
227227 return result ;
228228 }
229229 // *************************************************************************
230+ // Object methods
231+
232+ /**
233+ * Return a string representation of the vertex, which is unaffected. For
234+ * example:
235+ * <pre>
236+ * Vertex{(0.0 2.0 0.0) v(0.0 -1.0 0.0) im=0.5}
237+ * </pre>
238+ *
239+ * @return the string representation (not {@code null}, not empty)
240+ */
241+ @ Override
242+ public String toString () {
243+ Float3 p = getPosition ();
244+ Float3 v = getVelocity ();
245+ float im = getInvMass ();
246+ String result = "Vertex{(" + p .x + " " + p .y + " " + p .z
247+ + ") v(" + v .x + " " + v .y + " " + v .z + ") im=" + im + "}" ;
248+
249+ return result ;
250+ }
251+ // *************************************************************************
230252 // native private methods
231253
232254 native private static long createCopy (long originalVa );
You can’t perform that action at this time.
0 commit comments