Class ConeLightComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.lighting.ConeLightComponent
Cone light component used to store the ConeLight object and all of its parameters.
This can be added to an entity to make it product light.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConeLightComponent(box2dLight.RayHandler rayHandler, int rays, com.badlogic.gdx.graphics.Color color, float distance, float directionDeg, float coneDegree) The ConeLight must be registered to the same rayHandler that is being rendered. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when the entity is created and registered.voiddispose()Called when the component is disposed.floatfloatfloatbox2dLight.ConeLightgetLight()booleanisActive()voidsetActive(boolean active) setAngularVelocityDeg(float w) setColor(com.badlogic.gdx.graphics.Color c) setConeDegree(float coneDeg) setDirectionDeg(float dirDeg) setDistance(float d) setFollowEntity(boolean f) setSoftnessLength(float softness) setVelocity(com.badlogic.gdx.math.Vector2 v) voidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ConeLightComponent
public ConeLightComponent(box2dLight.RayHandler rayHandler, int rays, com.badlogic.gdx.graphics.Color color, float distance, float directionDeg, float coneDegree) The ConeLight must be registered to the same rayHandler that is being rendered. All light objects must be attached to the rayHandler.
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
dispose
public void dispose()Description copied from class:ComponentCalled when the component is disposed. Dispose of any internal resources here. -
setVelocityZero
-
setVelocity
-
setAngularVelocityDeg
-
setFollowEntity
-
setColor
-
setDistance
-
setDirectionDeg
-
setConeDegree
-
setSoftnessLength
-
setActive
public void setActive(boolean active) -
isActive
public boolean isActive() -
getLight
public box2dLight.ConeLight getLight() -
getConeDegree
public float getConeDegree() -
getDirectionDeg
public float getDirectionDeg() -
getDistance
public float getDistance()
-