VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
ContactListener.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CONTACTLISTENER_H
18 #define CONTACTLISTENER_H
19 
20 #include <Box2D/Box2D.h>
21 
22 class Body;
23 class ContactTrigger;
24 
29 class ContactListener : public b2ContactListener {
30 public:
35  virtual void BeginContact(b2Contact* contact) override;
40  virtual void EndContact(b2Contact* contact) override;
41 
42 private:
43  static Body* getBodyFromFixture(const b2Fixture* fixture);
44 };
45 
46 #endif // CONTACTLISTENER_H
A QObject container for a Box2D b2Body.
Definition: Body.h:57
virtual void EndContact(b2Contact *contact) override
Notifies both Bodys involved that they are no longer contacting.
Handler for notifications of ContactEvents from the b2World.
Definition: ContactListener.h:29
virtual void BeginContact(b2Contact *contact) override
Notifies both Bodys involved that they have contacted.
Listens to ContactEvents between the parent Actor's Body and another body of the specified ActorType...
Definition: ContactTrigger.h:30