/*
 * Jump180PhysicsComponent.cpp
 *
 *  Created on: Aug 14, 2020
 *      Author: fredrick
 */

#include "Jump180PhysicsComponent.h"

namespace JamSpook {

Jump180PhysicsComponent::Jump180PhysicsComponent(mat4 transform,
                                                 shared_ptr<BroadcastObservable<shared_ptr<Message> > > entity,
                                                 weak_ptr<BroadcastObservable<const milliseconds> > physicsSystem,
                                                 weak_ptr<BroadcastObservable<shared_ptr<CollisionStateChangeMessage> > > physicsCollisionSubSystem,
                                                 weak_ptr<BroadcastObservable<shared_ptr<ColliderQueryMessage> > > physicsColliderQuerySubSystem,
                                                 shared_ptr<Collider> collider):
        PhysicsComponent(transform,
                         entity,
                         physicsSystem,
                         physicsCollisionSubSystem,
                         physicsColliderQuerySubSystem,
                         collider)
{}

Jump180PhysicsComponent::~Jump180PhysicsComponent()
{}

void Jump180PhysicsComponent::update(const milliseconds dtms)
{
//    Log::write(LogLevel::trace, "CollectablePhysicsComponent - update");
    PhysicsComponent::update(dtms);
}

void Jump180PhysicsComponent::onICCMessage(shared_ptr<Message> message)
{
    PhysicsComponent::onICCMessage(message);
}

void Jump180PhysicsComponent::onCollision(const string& tag)
{
//    if (tag == "ground-plane")
//    {
//        vec3 position = getPosition();
//        setPosition(vec3(position.x, 10.0f, position.z));
//        ICCBroadcast(make_shared<Message>(IDCache::get("GroundContactMessage")));
//    }
}

} // namespace JamSpook
