Package gaiasky.scenegraph.component
Class ModelComponent
java.lang.Object
gaiasky.scenegraph.component.NamedComponent
gaiasky.scenegraph.component.ModelComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
,IComponent
public class ModelComponent
extends NamedComponent
implements com.badlogic.gdx.utils.Disposable, IObserver
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
boolean
COMPONENTSdouble
Fields inherited from class gaiasky.scenegraph.component.NamedComponent
name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addReflectionCubemapAttribute
(com.badlogic.gdx.utils.Array<Material> materials) void
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
void
initialize
(boolean mesh) void
initialize
(String name) boolean
boolean
void
load
(com.badlogic.gdx.math.Matrix4 localTransform) void
Event notification call.void
print
(Logger.Log log) void
randomizeAll
(long seed, double size) Creates a random model component using the given seed.void
removeReflectionCubemapAttribute
(com.badlogic.gdx.utils.Array<Material> materials) static void
setAmbientLight
(float level) Sets the ambient lightvoid
setColorAttribute
(int attrib, float[] rgba) void
setCulling
(Boolean culling) void
setCulling
(String culling) void
setDepthTest
(int func, boolean mask) void
setFloatExtAttribute
(int attrib, float value) void
void
Sets the model file path (this must be a .g3db, .g3dj or .obj).void
setModelInitialized
(boolean initialized) void
void
void
void
setStaticlight
(Boolean staticLight) void
setStaticlight
(Double lightLevel) void
setStaticlight
(String staticLight) void
setTransparency
(float alpha) void
setTransparency
(float alpha, int src, int dst) void
setTransparencyColor
(float alpha) void
Sets the type of the model to construct.void
setUsecolor
(Boolean usecolor) void
setUsecolor
(String usecolor) void
setVROffset
(NaturalCamera cam) static void
toggleAmbientLight
(boolean on) 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
(ICamera camera) void
updateRelativisticEffects
(ICamera camera, float vc) void
updateRelativisticEffects
(Material mat, ICamera camera) void
updateRelativisticEffects
(Material mat, ICamera camera, float vc) void
updateVelocityBufferUniforms
(ICamera camera) void
updateVelocityBufferUniforms
(Material mat, ICamera camera) Methods inherited from class gaiasky.scenegraph.component.NamedComponent
createModelParameters, gaussian, gaussian, gaussian
-
Field Details
-
forceInit
public boolean forceInit -
instance
-
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
- Specified by:
initialize
in interfaceIComponent
- Overrides:
initialize
in classNamedComponent
-
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:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-
setVROffset
-
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(int attrib, float value) -
setColorAttribute
public void setColorAttribute(int 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
-
updateRelativisticEffects
-
updateRelativisticEffects
-
updateRelativisticEffects
-
updateRelativisticEffects
-
addReflectionCubemapAttribute
-
removeReflectionCubemapAttribute
-
hasHeight
public boolean hasHeight() -
notify
Description copied from interface:IObserver
Event notification call. -
isModelInitialised
public boolean isModelInitialised() -
isModelLoading
public boolean isModelLoading() -
toString
-
randomizeAll
public void randomizeAll(long seed, double size) Creates a random model component using the given seed. Creates random elevation data, as well as diffuse, normal and specular textures.- Parameters:
seed
- The seed to use.size
- The size of the base body in internal units.
-
print
-