Package gaiasky.scenegraph.component
Class ModelComponent
java.lang.Object
gaiasky.scenegraph.component.ModelComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleancom.badlogic.gdx.graphics.g3d.EnvironmentbooleanCOMPONENTSdouble -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidTurns off all directional lightscom.badlogic.gdx.graphics.g3d.environment.DirectionalLightdirectional(int i)Returns the given directional lightvoiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc)voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc, boolean mesh)booleanvoidvoidinitialize(boolean mesh)booleanbooleanvoidload(com.badlogic.gdx.math.Matrix4 localTransform)voidEvent notification call.static voidsetAmbientLight(float level)Sets the ambient lightvoidsetColorAttribute(long attrib, float[] rgba)voidsetCulling(Boolean culling)voidsetCulling(String culling)voidsetDepthTest(int func, boolean mask)voidsetFloatExtAttribute(long attrib, float value)voidsetMaterial(MaterialComponent mtc)voidSets the model file path (this must be a .g3db, .g3dj or .obj).voidsetModelInitialized(boolean initialized)voidvoidvoidvoidsetStaticlight(Boolean staticLight)voidsetStaticlight(Double lightLevel)voidsetStaticlight(String staticLight)voidsetTransparency(float alpha)voidsetTransparency(float alpha, int src, int dst)voidsetTransparencyColor(float alpha)voidSets the type of the model to construct.voidsetUsecolor(Boolean usecolor)voidsetUsecolor(String usecolor)static voidtoggleAmbientLight(boolean on)toString()voidtouch()voidtouch(com.badlogic.gdx.math.Matrix4 localTransform)Initialises the model or texture if LAZY_X_INIT is onvoidupdate(float alpha)voidupdate(com.badlogic.gdx.math.Matrix4 localTransform, float alpha)voidupdate(com.badlogic.gdx.math.Matrix4 localTransform, float alpha, int blendSrc, int blendDst)voidupdateRelativisticEffects(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera)voidupdateRelativisticEffects(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera, float vc)voidupdateRelativisticEffects(ICamera camera)voidupdateRelativisticEffects(ICamera camera, float vc)voidupdateVelocityBufferUniforms(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera)voidupdateVelocityBufferUniforms(ICamera camera)
-
Field Details
-
forceInit
public boolean forceInit -
instance
-
env
public com.badlogic.gdx.graphics.g3d.Environment env -
params
-
type
-
modelFile
-
scale
public double scale -
culling
public boolean culling -
mtc
COMPONENTS -
rec
-
vbc
-
-
Constructor Details
-
ModelComponent
public ModelComponent() -
ModelComponent
-
-
Method Details
-
toggleAmbientLight
public static void toggleAmbientLight(boolean on) -
setAmbientLight
public static void setAmbientLight(float level)Sets the ambient light- Parameters:
level- Ambient light level between 0 and 1
-
directional
public com.badlogic.gdx.graphics.g3d.environment.DirectionalLight directional(int i)Returns the given directional light- Parameters:
i- The index of the light (must be less thanConstants.N_DIR_LIGHTS.- Returns:
- The directional light with index i
-
clearDirectionals
public void clearDirectionals()Turns off all directional lights -
initialize
public void initialize() -
initialize
public void initialize(boolean mesh) -
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc) -
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc, boolean mesh) -
load
public void load(com.badlogic.gdx.math.Matrix4 localTransform) -
update
public void update(com.badlogic.gdx.math.Matrix4 localTransform, float alpha, int blendSrc, int blendDst) -
update
public void update(com.badlogic.gdx.math.Matrix4 localTransform, float alpha) -
update
public void update(float alpha) -
touch
public void touch() -
touch
public void touch(com.badlogic.gdx.math.Matrix4 localTransform)Initialises the model or texture if LAZY_X_INIT is on -
setModelInitialized
public void setModelInitialized(boolean initialized) -
addColorToMat
public void addColorToMat() -
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
setTransparency
public void setTransparency(float alpha, int src, int dst) -
setDepthTest
public void setDepthTest(int func, boolean mask) -
setTransparency
public void setTransparency(float alpha) -
setTransparencyColor
public void setTransparencyColor(float alpha) -
setFloatExtAttribute
public void setFloatExtAttribute(long attrib, float value) -
setColorAttribute
public void setColorAttribute(long attrib, float[] rgba) -
setType
Sets the type of the model to construct.- Parameters:
type- The type. Currently supported types are sphere|cylinder|ring|disc.
-
setMaterial
-
setModel
Sets the model file path (this must be a .g3db, .g3dj or .obj).- Parameters:
model- The model file name.
-
setStaticlight
-
setStaticlight
-
setStaticlight
-
setParams
-
setScale
-
setScale
-
setCulling
-
setCulling
-
setUsecolor
-
setUsecolor
-
updateVelocityBufferUniforms
-
updateVelocityBufferUniforms
public void updateVelocityBufferUniforms(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera) -
updateRelativisticEffects
-
updateRelativisticEffects
-
updateRelativisticEffects
-
updateRelativisticEffects
public void updateRelativisticEffects(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera, float vc) -
hasHeight
public boolean hasHeight() -
notify
Description copied from interface:IObserverEvent notification call. -
isModelInitialised
public boolean isModelInitialised() -
isModelLoading
public boolean isModelLoading() -
toString
-