File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
jme3-core/src/main/java/com/jme3/scene Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1168,7 +1168,7 @@ public void read(JmeImporter im) throws IOException {
11681168 stride = ic .readInt ("stride" , 0 );
11691169 instanceSpan = ic .readInt ("instanceSpan" , 0 );
11701170 name = ic .readString ("name" , null );
1171-
1171+
11721172 componentsLength = components * format .getComponentSize ();
11731173
11741174 String dataName = "data" + format .name ();
@@ -1194,14 +1194,28 @@ public void read(JmeImporter im) throws IOException {
11941194 }
11951195 }
11961196
1197+ /**
1198+ * Returns the name of this `VertexBuffer`. If no name has been explicitly
1199+ * set, a default name is generated based on its class name and buffer type
1200+ * (e.g., "VertexBuffer(Position)").
1201+ *
1202+ * @return The name of the `VertexBuffer`.
1203+ */
11971204 public String getName () {
11981205 if (name == null ) {
1199- name = getClass ().getSimpleName () + "(" + getBufferType ().name () + ")" ;
1206+ return String . format ( "%s(%s)" , getClass ().getSimpleName (), getBufferType ().name ()) ;
12001207 }
12011208 return name ;
12021209 }
12031210
1211+ /**
1212+ * Sets a custom name for this `VertexBuffer`.
1213+ *
1214+ * @param name The new name for the `VertexBuffer`. Can be null to revert
1215+ * to the default generated name.
1216+ */
12041217 public void setName (String name ) {
12051218 this .name = name ;
12061219 }
1220+
12071221}
You can’t perform that action at this time.
0 commit comments