Package com.jozufozu.flywheel.core.model
Interface Model
- All Known Implementing Classes:
BlockModel,ModelPart
public interface Model
A model that can be rendered by flywheel.
It is expected that the following assertion will not fail:
Model model = ...;
VecBuffer into = ...;
int initial = VecBuffer.unwrap().position();
model.buffer(into);
int final = VecBuffer.unwrap().position();
assert model.size() == final - initial;
-
Method Summary
Modifier and TypeMethodDescriptiondefault ElementBufferCreate an element buffer object that indexes the vertices of this model.voiddelete()default booleanempty()Is there nothing to render?getType()name()A name uniquely identifying this model.default intsize()The size in bytes that this model's data takes up.intdefault voidwriteInto(ByteBuffer buffer)
-
Method Details
-
name
String name()A name uniquely identifying this model. -
getReader
VertexList getReader() -
vertexCount
int vertexCount()- Returns:
- The number of vertices the model has.
-
getType
VertexType getType() -
createEBO
Create an element buffer object that indexes the vertices of this model.Very often models in minecraft are made up of sequential quads, which is a very predictable pattern. The default implementation accommodates this, however this can be overridden to change the behavior and support more complex models.
- Returns:
- an element buffer object indexing this model's vertices.
-
delete
void delete() -
size
default int size()The size in bytes that this model's data takes up. -
empty
default boolean empty()Is there nothing to render?- Returns:
- true if there are no vertices.
-
writeInto
-