Jump to content

panamd

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by panamd

  1. Hi, I'm having some issues detecting the collisions between entities, I created my own object that inherits from Leadwerks::Model and overloads the method "OnCollision", but the method does not seem to be called. here is my code: class Player : public Leadwerks::Model { private: bool grounded; Model* model; public: Player() : Model::Model() { grounded = true; model = Model::Box(2, this); model->SetPosition(0, 1, 0); } void OnCollision(Entity* other, const Vec3& position, const Vec3& normal, float speed) override { if (reinterpret_cast<Terrain*>(other)) { grounded = false; } std::cout << "EwE" << std::endl; } void setGrounded() { grounded = true; } bool isGrounded() { return grounded; } }; Player* playerDummy = new Player(); playerDummy->SetPhysicsMode(Leadwerks::Entity::CharacterPhysics); playerDummy->SetPosition(0, 4, 0); playerDummy->SetMass(1); playerDummy->SetKeyValue("Name", "Player"); Leadwerks::Map::Load("Maps/temp.map");
×
×
  • Create New...