cocos2d-x  3.0alpha1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EventListenerPhysicsContactWithShapes Class Reference

this event listener only be called when shapeA and shapeB have contacts More...

#include <CCPhysicsContact.h>

Inheritance diagram for EventListenerPhysicsContactWithShapes:
EventListenerPhysicsContact EventListenerCustom EventListener Object

Public Member Functions

virtual bool hitTest (PhysicsShape *shapeA, PhysicsShape *shapeB) override
 it will be call when two body have contact. More...
 
virtual
EventListenerPhysicsContactWithShapes
clone () override
 Clones the listener, its subclasses have to override this method. More...
 
- Public Member Functions inherited from EventListenerPhysicsContact
virtual bool checkAvailable () override
 Overrides. More...
 

Static Public Member Functions

static
EventListenerPhysicsContactWithShapes
create (PhysicsShape *shapeA, PhysicsShape *shapeB)
var create ( var shapeA, var shapeB)
local create ( local shapeA, local shapeB)
- Static Public Member Functions inherited from EventListenerPhysicsContact
static
EventListenerPhysicsContact
create ()
 create the listener More...
 
- Static Public Member Functions inherited from EventListenerCustom
static EventListenerCustomcreate (const std::string &eventName, std::function< void(EventCustom *)> callback)
 Creates an event listener with type and callback. More...
 
local create ( local eventName, local callback)
 Creates an event listener with type and callback. More...
 

Protected Member Functions

 EventListenerPhysicsContactWithShapes ()
virtual ~EventListenerPhysicsContactWithShapes ()
- Protected Member Functions inherited from EventListenerPhysicsContact
bool init ()
void onEvent (EventCustom *event)
 EventListenerPhysicsContact ()
virtual ~EventListenerPhysicsContact ()
- Protected Member Functions inherited from EventListenerCustom
 EventListenerCustom ()
 Constructor. More...
 
bool init (ListenerID listenerId, std::function< void(EventCustom *)> callback)
 Initializes event with type and callback function. More...
 
- Protected Member Functions inherited from EventListener
 EventListener ()
 Constructor. More...
 
bool init (Type t, ListenerID listenerID, std::function< void(Event *)>callback)
 Initializes event with type and callback function. More...
 
local init ( local t, local listenerID, local callback)
 Initializes event with type and callback function. More...
 
void setPaused (bool paused)
local setPaused ( local paused)
bool isPaused () const
void setRegistered (bool registered)
local setRegistered ( local registered)
bool isRegistered () const
Type getType () const
ListenerID getListenerID () const
local getListenerID ()
void setFixedPriority (int fixedPriority)
int getFixedPriority () const
void setSceneGraphPriority (Node *node)
NodegetSceneGraphPriority () const

Protected Attributes

PhysicsShape_a
PhysicsShape_b
var _b
local _b

Additional Inherited Members

- Public Types inherited from EventListener
enum  Type {
  UNKNOWN, TOUCH_ONE_BY_ONE, TOUCH_ALL_AT_ONCE, KEYBOARD,
  MOUSE, ACCELERATION, CUSTOM
}
 
typedef std::size_t ListenerID
- Public Attributes inherited from EventListenerPhysicsContact
std::function< bool(EventCustom
*event, const PhysicsContact
&contact)> 
onContactBegin
std::function< bool(EventCustom
*event, const PhysicsContact
&contact, const
PhysicsContactPreSolve &solve)> 
onContactPreSolve
std::function< void(EventCustom
*event, const PhysicsContact
&contact, const
PhysicsContactPostSolve &solve)> 
onContactPostSolve
std::function< void(EventCustom
*event, const PhysicsContact
&contact)> 
onContactSeperate

Detailed Description

this event listener only be called when shapeA and shapeB have contacts

Constructor & Destructor Documentation

virtual
~EventListenerPhysicsContactWithShapes
( )
protectedvirtual
var
~EventListenerPhysicsContactWithShapes
( )
protectedvirtual
local
~EventListenerPhysicsContactWithShapes
( )
protectedvirtual

Member Function Documentation

virtual
EventListenerPhysicsContactWithShapes*
clone
( )
overridevirtual

Clones the listener, its subclasses have to override this method.

Reimplemented from EventListenerPhysicsContact.

var clone ( )
overridevirtual

Clones the listener, its subclasses have to override this method.

Reimplemented from EventListenerPhysicsContact.

local clone ( )
overridevirtual

Clones the listener, its subclasses have to override this method.

Reimplemented from EventListenerPhysicsContact.

static
EventListenerPhysicsContactWithShapes*
create
( PhysicsShape shapeA,
PhysicsShape shapeB 
)
static
var create ( var  shapeA,
var  shapeB 
)
static
local create ( local  shapeA,
local  shapeB 
)
static
virtual bool hitTest ( PhysicsShape shapeA,
PhysicsShape shapeB 
)
overridevirtual

it will be call when two body have contact.

if return false, it will not invoke callbacks

Reimplemented from EventListenerPhysicsContact.

var hitTest ( var  shapeA,
var  shapeB 
)
overridevirtual

it will be call when two body have contact.

if return false, it will not invoke callbacks

Reimplemented from EventListenerPhysicsContact.

local hitTest ( local  shapeA,
local  shapeB 
)
overridevirtual

it will be call when two body have contact.

if return false, it will not invoke callbacks

Reimplemented from EventListenerPhysicsContact.

Member Data Documentation

PhysicsShape* _a
protected
var _a
protected
local _a
protected
PhysicsShape* _b
protected
var _b
protected
local _b
protected

The documentation for this class was generated from the following file: