cocos2d-x  v3.6
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
PhysicsContact Class Reference

Contact infomation. More...

Inherits EventCustom.

Public Member Functions

PhysicsShapegetShapeA () const
 Get contact shape A. More...
 
PhysicsShapegetShapeB () const
 Get contact shape B. More...
 
const PhysicsContactData * getContactData () const
 Get contact data. More...
 
local getContactData ()
 Get contact data. More...
 
const PhysicsContactData * getPreContactData () const
 Get previous contact data.
 
local getPreContactData ()
 Get previous contact data.
 
void * getData () const
 Get data.
 
void setData (void *data)
 Set data to contact. More...
 
EventCode getEventCode () const
 Get the event code.
 
- Public Member Functions inherited from EventCustom
 EventCustom (const std::string &eventName)
 Constructor. More...
 
void setUserData (void *data)
 Sets user data. More...
 
var setUserData ( var data)
 Sets user data. More...
 
local setUserData ( local data)
 Sets user data. More...
 
void * getUserData () const
 Gets user data. More...
 
const std::string & getEventName () const
 Gets event name. More...
 
- Public Member Functions inherited from Event
virtual ~Event ()
 Destructor.
 
Type getType () const
 Gets the event type. More...
 
var getType ()
 Gets the event type. More...
 
local getType ()
 Gets the event type. More...
 
void stopPropagation ()
 Stops propagation for current event.
 
var stopPropagation ()
 Stops propagation for current event.
 
local stopPropagation ()
 Stops propagation for current event.
 
bool isStopped () const
 Checks whether the event has been stopped. More...
 
var isStopped ()
 Checks whether the event has been stopped. More...
 
local isStopped ()
 Checks whether the event has been stopped. More...
 
NodegetCurrentTarget ()
 Gets current target of the event. More...
 
var getCurrentTarget ()
 Gets current target of the event. More...
 
local getCurrentTarget ()
 Gets current target of the event. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from Event
enum  Type
 Type Event type. More...
 
- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
- Protected Member Functions inherited from Event
 Event (Type type)
 Constructor.
 
 Event ( var type)
 Constructor.
 
 Event ( local type)
 Constructor.
 

Detailed Description

Contact infomation.

It will created automatically when two shape contact with each other. And it will destoried automatically when two shape separated.

Member Function Documentation

PhysicsShape* getShapeA ( ) const
inline

Get contact shape A.

var getShapeA ( )
inline

Get contact shape A.

local getShapeA ( )
inline

Get contact shape A.

PhysicsShape* getShapeB ( ) const
inline

Get contact shape B.

var getShapeB ( )
inline

Get contact shape B.

local getShapeB ( )
inline

Get contact shape B.

const PhysicsContactData*
getContactData
( ) const
inline

Get contact data.

var getContactData ( )
inline

Get contact data.

local getContactData ( )
inline

Get contact data.

void setData ( void *  data)
inline

Set data to contact.

You must manage the memory yourself, Generally you can set data at contact begin, and distory it at contact seperate.

var setData ( var  data)
inline

Set data to contact.

You must manage the memory yourself, Generally you can set data at contact begin, and distory it at contact seperate.


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