Class ConeLightComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.lighting.ConeLightComponent

public class ConeLightComponent extends Component
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.
  • 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.
      Overrides:
      create in class Component
    • 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.
      Overrides:
      update in class Component
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component
    • setVelocityZero

      public ConeLightComponent setVelocityZero()
    • setVelocity

      public ConeLightComponent setVelocity(com.badlogic.gdx.math.Vector2 v)
    • setAngularVelocityDeg

      public ConeLightComponent setAngularVelocityDeg(float w)
    • setFollowEntity

      public ConeLightComponent setFollowEntity(boolean f)
    • setColor

      public ConeLightComponent setColor(com.badlogic.gdx.graphics.Color c)
    • setDistance

      public ConeLightComponent setDistance(float d)
    • setDirectionDeg

      public ConeLightComponent setDirectionDeg(float dirDeg)
    • setConeDegree

      public ConeLightComponent setConeDegree(float coneDeg)
    • setSoftnessLength

      public ConeLightComponent setSoftnessLength(float softness)
    • getLight

      public box2dLight.ConeLight getLight()