|
Jagguar Game Engine
|
#include <IPhysicsComponent.hpp>


Public Member Functions | |
| IPhysicsComponent (TransformComponent *pos, Vec2D dim) | |
| ~IPhysicsComponent () | |
| bool | IsColliding (IPhysicsComponent *other) |
| virtual void | ApplyForce (Vec2D force) |
| virtual void | ApplyAcceleration (Vec2D acceleration) |
| virtual void | ApplyVelocity () |
| virtual void | SetVelocity (Vec2D vel) |
| virtual bool | IsKinematic () |
| virtual bool | IsElastic () |
| virtual bool | UsesGravity () |
| Vec2D | GetPosition () |
| Vec2D | GetDimensions () |
| virtual Vec2D | GetVelocity () |
| virtual float | GetMass () |
Public Member Functions inherited from Component | |
| Component () | |
| ~Component () | |
| virtual void | Update (SDL_Event e, int frame, std::vector< std::string > broadcastList) |
| virtual void | Render (SDL_Renderer *ren) |
| virtual void | ShowComponentEditor (bool *showEditor) |
| virtual bool | HasTag (ComponentTag t) |
| virtual const char * | ComponentTypeName () |
| void | ParseAndUpdateBroadcast (std::vector< std::string > broadcastList) |
Protected Attributes | |
| TransformComponent * | m_position |
| Vec2D | dimensions |
| std::vector< ComponentTag > | tags = {ComponentTag::Physics} |
Protected Attributes inherited from Component | |
| std::vector< ComponentTag > | tags |
| std::vector< std::string > | previousBroadcasts |
| std::vector< std::string > | pendingBroadcasts |
An interface for all components that will be interacting with the PhysicEngine
| IPhysicsComponent::IPhysicsComponent | ( | TransformComponent * | pos, |
| Vec2D | dim | ||
| ) |
Construct a new IPhysicsComponent object
| pos | the position of the GameObject the Component is attached to |
| dim | the dimensions (width, height) of the GameObject the Component is attached to |
| IPhysicsComponent::~IPhysicsComponent | ( | ) |
Destroy the IPhysicsComponent object
|
virtual |
Change the velocity of the Component. Adds the acceleration value to the current velocity.
Reimplemented in RigidbodyComponent.
|
virtual |
Apply a force to the Component. Handles forces outside of collisions (such as from scripts).
| force | the force to be applied to the IPhysicsComponent |
Reimplemented in RigidbodyComponent.
|
virtual |
Moves the Component. The IPhysicsComponent will not move until this is called.
Reimplemented in RigidbodyComponent.
| Vec2D IPhysicsComponent::GetDimensions | ( | ) |
Get the dimensions of the IPhysicsComponent.

|
virtual |
Get the mass of the IPhysicsComponent.
Reimplemented in RigidbodyComponent.

| Vec2D IPhysicsComponent::GetPosition | ( | ) |
Get the position of the IPhysicsComponent.


|
virtual |
Get the velocity of the IPhysicsComponent.
Reimplemented in RigidbodyComponent.
| bool IPhysicsComponent::IsColliding | ( | IPhysicsComponent * | other | ) |
Check for a collision with the given IPhysicsComponent.
| other | the Component to check for collisions |


|
virtual |
Get whether the IPhysicsComponent bounces or just stops on collision.
Reimplemented in RigidbodyComponent.

|
virtual |
Get whether the IPhysicsComponent is kinematic. Allows for Colliders to only get collision data, without applying forces to other Components
Reimplemented in RigidbodyComponent.

|
virtual |
Set the velocity of the IPhysicsComponent.
| vel | the new velocity |
Reimplemented in RigidbodyComponent.
|
virtual |
Get whether the PhysicsEngine will apply gravity forces to the IPhysicsComponent.
Reimplemented in RigidbodyComponent.
|
protected |
pointer to the TransformComponent used by the shared parent GameObject