Class ConeDetectorComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.lighting.ConeDetectorComponent
Component that is responsible for detecting if a target entity is within the light cone.
It also detects whether the target entity is hidden behind another entity with a specified
physics layer.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConeDetectorComponent
(Entity target, short occluderMask, String id) ConeDetectorComponent
(Entity target, String id) Constructor for the ConeDetector. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.boolean
setDebug
(boolean enabled) setOccluderMask
(short mask) 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
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ConeDetectorComponent
Constructor for the ConeDetector. The occluder mask is set to "PhysicsLayer.OBSTACLE" by default.- Parameters:
target
- the target entity to be detected
-
ConeDetectorComponent
-
-
Method Details
-
setDebug
-
setOccluderMask
-
getTarget
-
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. -
isDetected
public boolean isDetected()
-