Package gaiasky.scenegraph.component
Class ModelComponent
java.lang.Object
gaiasky.scenegraph.component.ModelComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
public class ModelComponent extends java.lang.Object implements com.badlogic.gdx.utils.Disposable, IObserver
-
Field Summary
Fields Modifier and Type Field Description boolean
culling
com.badlogic.gdx.graphics.g3d.Environment
env
boolean
forceInit
IntModelInstance
instance
java.lang.String
modelFile
MaterialComponent
mtc
COMPONENTSjava.util.Map<java.lang.String,java.lang.Object>
params
RelativisticEffectsComponent
rec
double
scale
java.lang.String
type
VelocityBufferComponent
vbc
-
Constructor Summary
Constructors Constructor Description ModelComponent()
ModelComponent(java.lang.Boolean initEnvironment)
-
Method Summary
Modifier and Type Method Description void
addColorToMat()
void
clearDirectionals()
Turns off all directional lightscom.badlogic.gdx.graphics.g3d.environment.DirectionalLight
directional(int i)
Returns the given directional lightvoid
dispose()
void
doneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc)
void
doneLoading(com.badlogic.gdx.assets.AssetManager manager, com.badlogic.gdx.math.Matrix4 localTransform, float[] cc, boolean mesh)
boolean
hasHeight()
void
initialize()
void
initialize(boolean mesh)
void
notify(Events event, java.lang.Object... data)
static void
setAmbientLight(float level)
Sets the ambient lightvoid
setColorAttribute(long attrib, float[] rgba)
void
setCulling(java.lang.Boolean culling)
void
setCulling(java.lang.String culling)
void
setDepthTest(int func, boolean mask)
void
setFloatExtAttribute(long attrib, float value)
void
setMaterial(MaterialComponent mtc)
void
setModel(java.lang.String model)
Sets the model file path (this must be a .g3db, .g3dj or .obj).void
setParams(java.util.Map<java.lang.String,java.lang.Object> params)
void
setScale(java.lang.Double scale)
void
setScale(java.lang.Long scale)
void
setStaticlight(java.lang.Boolean staticLight)
void
setStaticlight(java.lang.Double lightLevel)
void
setStaticlight(java.lang.String staticLight)
void
setTransparency(float alpha)
void
setTransparency(float alpha, int src, int dst)
void
setTransparencyColor(float alpha)
void
setType(java.lang.String type)
Sets the type of the model to construct.void
setUsecolor(java.lang.Boolean usecolor)
void
setUsecolor(java.lang.String usecolor)
static void
toggleAmbientLight(boolean on)
java.lang.String
toString()
void
touch()
void
touch(com.badlogic.gdx.math.Matrix4 localTransform)
Initialises the model or texture if LAZY_X_INIT is onvoid
update(float alpha)
void
update(com.badlogic.gdx.math.Matrix4 localTransform, float alpha)
void
update(com.badlogic.gdx.math.Matrix4 localTransform, float alpha, int blendSrc, int blendDst)
void
updateRelativisticEffects(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera)
void
updateRelativisticEffects(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera, float vc)
void
updateRelativisticEffects(ICamera camera)
void
updateRelativisticEffects(ICamera camera, float vc)
void
updateVelocityBufferUniforms(com.badlogic.gdx.graphics.g3d.Material mat, ICamera camera)
void
updateVelocityBufferUniforms(ICamera camera)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
forceInit
public boolean forceInit -
instance
-
env
public com.badlogic.gdx.graphics.g3d.Environment env -
params
public java.util.Map<java.lang.String,java.lang.Object> params -
type
public java.lang.String type -
modelFile
public java.lang.String modelFile -
scale
public double scale -
culling
public boolean culling -
mtc
COMPONENTS -
rec
-
vbc
-
-
Constructor Details
-
ModelComponent
public ModelComponent() -
ModelComponent
public ModelComponent(java.lang.Boolean initEnvironment)
-
-
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) -
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 -
addColorToMat
public void addColorToMat() -
dispose
public void dispose()- Specified by:
dispose
in 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
public void setType(java.lang.String type)Sets the type of the model to construct.- Parameters:
type
- The type. Currently supported types are sphere|cylinder|ring|disc.
-
setMaterial
-
setModel
public void setModel(java.lang.String model)Sets the model file path (this must be a .g3db, .g3dj or .obj).- Parameters:
model
-
-
setStaticlight
public void setStaticlight(java.lang.String staticLight) -
setStaticlight
public void setStaticlight(java.lang.Boolean staticLight) -
setStaticlight
public void setStaticlight(java.lang.Double lightLevel) -
setParams
public void setParams(java.util.Map<java.lang.String,java.lang.Object> params) -
setScale
public void setScale(java.lang.Double scale) -
setScale
public void setScale(java.lang.Long scale) -
setCulling
public void setCulling(java.lang.String culling) -
setCulling
public void setCulling(java.lang.Boolean culling) -
setUsecolor
public void setUsecolor(java.lang.String usecolor) -
setUsecolor
public void setUsecolor(java.lang.Boolean usecolor) -
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
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-