Bandidos
Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.engine.entities.components.collision.CollisionComponent Class Reference
Inheritance diagram for com.mygdx.game.engine.entities.components.collision.CollisionComponent:
com.mygdx.game.engine.entities.components.BaseEntityComponent com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

Body getBody ()
 
void setBody (Body body)
 
void createFixture (FixtureDef fixDef, short _type)
 
Vector2 getVelocity ()
 
void setVelocity (float xVelocity, float yVelocity)
 
void stopVelocity ()
 
void awake ()
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
EngineTween startTweenOnComponent (Tween tween, TweenStartType tweenStartType)
 
Timeline startTimelineOnComponent (Timeline timeline, boolean updateInGameTime)
 
EngineTween doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType)
 
void stopAllComponentTweens ()
 
void initialize (BaseEntity parentEntity)
 
BaseEntity getParentOfComponent ()
 
boolean isActive ()
 
boolean isDestroyed ()
 
void setActiveState (boolean activeState)
 
void destroy ()
 
void update (float deltaTime)
 
abstract void awake ()
 
- Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher
void addEventListener (String type, IEventReceiver listeningClass)
 
void dispatchEvent (Event event)
 
void removeEventListener (String type, IEventReceiver listener)
 
boolean hasEventListener (String type)
 
ArrayList< ListenerItemgetAllListeners ()
 
void destroyAllListeners ()
 
void clean ()
 

Protected Member Functions

void updated (float deltaTime)
 
void destroyed ()
 
void activeStateChanged ()
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
abstract void updated (float deltaTime)
 
abstract void destroyed ()
 
abstract void activeStateChanged ()
 

Detailed Description

This component contains information on what collision category the entity has and with what the entity can collide with.

Author
Djamali Jones

Member Function Documentation

◆ activeStateChanged()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.activeStateChanged ( )
protected

◆ awake()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.awake ( )

◆ createFixture()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.createFixture ( FixtureDef  fixDef,
short  _type 
)

Creates and adds a fixture for this entity. A FixtureDef must be given so that multiple fixtures can be added to the entity. NOTE: A shape must be created first. This has to be given to the fixDef parameter.

Parameters
fixDef

◆ destroyed()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.destroyed ( )
protected

◆ getBody()

Body com.mygdx.game.engine.entities.components.collision.CollisionComponent.getBody ( )

Returns the _body for this entity

Returns
the '_body' for the world.

◆ getVelocity()

Vector2 com.mygdx.game.engine.entities.components.collision.CollisionComponent.getVelocity ( )

Returns the velocity set with the setVelocity method. If both values are zero, no velocity was set.

Returns

◆ setBody()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.setBody ( Body  body)

Sets the current body and puts the given fixtures to it.

Parameters
body

◆ setVelocity()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.setVelocity ( float  xVelocity,
float  yVelocity 
)

Sets the physics velocity of this object. (Should not be called in an update to work) This will turn off all set position handing and force its own position on rotation on the entity To regain control, the 'stopVelocity' method should be called

Parameters
xVelocityto give the entity
yVelocityto give the entity

◆ stopVelocity()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.stopVelocity ( )

This stops the entity of having physics velocity and gives it its control over its own position and rotation back.

◆ updated()

void com.mygdx.game.engine.entities.components.collision.CollisionComponent.updated ( float  deltaTime)
protected

The documentation for this class was generated from the following file: