Package com.jme3.scene.threadwarden
Class SceneGraphThreadWarden
java.lang.Object
com.jme3.scene.threadwarden.SceneGraphThreadWarden
Thread warden keeps track of mutations to the scene graph and ensures that they are only done on the main thread.
IF the parent node is marked as being reserved for the main thread (which basically means it's connected to the
root node)
Only has an effect if asserts are on
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic Threadstatic booleanIf THREAD_WARDEN_ENABLED is true AND asserts are on the checks are made. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanassertOnCorrectThread(Spatial spatial) static voidDisables the thread warden checks (even when other asserts are on).static Stringstatic booleanreset()static booleanMarks the given node as being reserved for the main thread.static booleanupdateRequirement(Spatial spatial, Node newParent)
-
Field Details
-
THREAD_WARDEN_ENABLED
public static boolean THREAD_WARDEN_ENABLEDIf THREAD_WARDEN_ENABLED is true AND asserts are on the checks are made. This parameter is here to allow asserts to run without thread warden checks (by setting this parameter to false) -
ASSERTS_ENABLED
public static boolean ASSERTS_ENABLED -
mainThread
-
spatialsThatAreMainThreadReserved
-
-
Constructor Details
-
SceneGraphThreadWarden
public SceneGraphThreadWarden()
-
-
Method Details
-
setup
Marks the given node as being reserved for the main thread. Additionally, sets the current thread as the main thread (if it hasn't already been set)- Parameters:
rootNode- the root node of the scene graph. This is used to determine if a spatial is a child of the root node. (Can add multiple "root" nodes, e.g. gui nodes or overlay nodes)
-
disableChecks
public static void disableChecks()Disables the thread warden checks (even when other asserts are on).Alternatively can be disabled by adding the -Dnothreadwarden=true parameter
-
updateRequirement
-
reset
public static boolean reset() -
assertOnCorrectThread
-
getTurnOnAssertsPrompt
-