Class IndirectInstancer<I extends Instance>
java.lang.Object
dev.engine_room.flywheel.backend.engine.AbstractInstancer<I>
dev.engine_room.flywheel.backend.engine.indirect.IndirectInstancer<I>
- All Implemented Interfaces:
Instancer<I>
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
AbstractInstancer.Recreate<I extends Instance> -
Field Summary
FieldsFields inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
environment, recreate, type -
Constructor Summary
ConstructorsConstructorDescriptionIndirectInstancer(InstancerKey<I> key, AbstractInstancer.Recreate<I> recreate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDraw(IndirectDraw draw) intvoidclear()Clear all instances without freeing resources.voiddelete()draws()static @Nullable IndirectInstancer<?> fromState(InstanceHandleImpl.State<?> handle) intintlocal2GlobalInstanceIndex(int instanceIndex) intvoidrevealInstance(InstanceHandleImpl<I> handle, I instance) voidstealInstance(I instance) Steal an instance from another instancer.voidupdate(int modelIndex, int baseInstance) voiduploadInstances(StagingBuffer stagingBuffer, int instanceVbo) voidwriteModel(long ptr) Methods inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.engine_room.flywheel.api.instance.Instancer
createInstances
-
Field Details
-
mapping
-
-
Constructor Details
-
IndirectInstancer
-
-
Method Details
-
fromState
@Nullable public static @Nullable IndirectInstancer<?> fromState(InstanceHandleImpl.State<?> handle) -
addDraw
-
draws
-
update
public void update(int modelIndex, int baseInstance) -
writeModel
public void writeModel(long ptr) -
uploadInstances
-
parallelUpdate
public void parallelUpdate()- Specified by:
parallelUpdatein classAbstractInstancer<I extends Instance>
-
delete
public void delete()- Specified by:
deletein classAbstractInstancer<I extends Instance>
-
modelIndex
public int modelIndex() -
baseInstance
public int baseInstance() -
local2GlobalInstanceIndex
public int local2GlobalInstanceIndex(int instanceIndex) -
createInstance
- Returns:
- a handle to a new copy of this model.
-
revealInstance
- Specified by:
revealInstancein classAbstractInstancer<I extends Instance>
-
stealInstance
Description copied from interface:InstancerSteal an instance from another instancer.
This has the effect of swapping the instance's model in-place.
If the given instance is already owned by this instancer, this method does nothing.
If the given instance isnull, this method does nothing.
If the given instance was created by a different backend, the behavior of this method is undefined.- Parameters:
instance- The instance to steal.
-
instanceCount
public int instanceCount()- Specified by:
instanceCountin classAbstractInstancer<I extends Instance>
-
clear
public void clear()Clear all instances without freeing resources.- Specified by:
clearin classAbstractInstancer<I extends Instance>
-