mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 11:12:19 +00:00
setting bound as public and add velocity with a if instead of a try/catch
This commit is contained in:
@@ -17,61 +17,26 @@ namespace BBM
|
||||
}
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> callback, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(callback), _bound(bound)
|
||||
: WAL::Component(entity), onCollide(callback), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> callback, float boundSize)
|
||||
: WAL::Component(entity), onCollide(callback), _bound({boundSize, boundSize, boundSize})
|
||||
: WAL::Component(entity), onCollide(callback), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> callback, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(callback), _bound(bound)
|
||||
: WAL::Component(entity), onCollide(callback), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> callback, float boundSize)
|
||||
: WAL::Component(entity), onCollide(callback), _bound({boundSize, boundSize, boundSize})
|
||||
: WAL::Component(entity), onCollide(callback), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(), _bound(bound)
|
||||
: WAL::Component(entity), onCollide(), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, float boundSize)
|
||||
: WAL::Component(entity), onCollide(), _bound({boundSize, boundSize, boundSize})
|
||||
: WAL::Component(entity), onCollide(), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
Vector3f CollisionComponent::getBounds(void) const
|
||||
{
|
||||
return _bound;
|
||||
}
|
||||
|
||||
float CollisionComponent::getBoundX(void) const
|
||||
{
|
||||
return _bound.x;
|
||||
}
|
||||
|
||||
float CollisionComponent::getBoundY(void) const
|
||||
{
|
||||
return _bound.y;
|
||||
}
|
||||
|
||||
float CollisionComponent::getBoundZ(void) const
|
||||
{
|
||||
return _bound.z;
|
||||
}
|
||||
|
||||
void CollisionComponent::setBoundX(float value)
|
||||
{
|
||||
_bound.x = value;
|
||||
}
|
||||
|
||||
void CollisionComponent::setBoundY(float value)
|
||||
{
|
||||
_bound.y = value;
|
||||
}
|
||||
|
||||
void CollisionComponent::setBoundZ(float value)
|
||||
{
|
||||
_bound.z = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user