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 TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
dispose()
Called when the component is disposed.box2dLight.ConeLight
getLight()
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) void
update()
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, 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:Component
Called 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:Component
Called 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:Component
Called when the component is disposed. Dispose of any internal resources here. -
setVelocityZero
-
setVelocity
-
setAngularVelocityDeg
-
setFollowEntity
-
setColor
-
setDistance
-
setDirectionDeg
-
setConeDegree
-
setSoftnessLength
-
getLight
public box2dLight.ConeLight getLight()
-