cocos2d-x  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PhysicsJointSpring Class Reference

Connecting two physics bodies together with a spring. More...

#include <CCPhysicsJoint.h>

Inheritance diagram for PhysicsJointSpring:
PhysicsJoint

Public Member Functions

Vec2 getAnchr1 () const
local getAnchr1 ()
void setAnchr1 (const Vec2 &anchr1)
local setAnchr1 ( local anchr1)
Vec2 getAnchr2 () const
var getAnchr2 ()
local getAnchr2 ()
void setAnchr2 (const Vec2 &anchr2)
local setAnchr2 ( local anchr2)
float getRestLength () const
var getRestLength ()
local getRestLength ()
void setRestLength (float restLength)
local setRestLength ( local restLength)
float getStiffness () const
void setStiffness (float stiffness)
local setStiffness ( local stiffness)
float getDamping () const
void setDamping (float damping)
local setDamping ( local damping)
virtual bool createConstraints () override
var createConstraints ()
local createConstraints ()
- Public Member Functions inherited from PhysicsJoint
PhysicsBodygetBodyA () const
var getBodyA ()
local getBodyA ()
PhysicsBodygetBodyB () const
var getBodyB ()
local getBodyB ()
PhysicsWorldgetWorld () const
var getWorld ()
local getWorld ()
int getTag () const
var getTag ()
local getTag ()
void setTag (int tag)
local setTag ( local tag)
bool isEnabled () const
local isEnabled ()
void setEnable (bool enable)
 Enable/Disable the joint. More...
 
var setEnable ( var enable)
 Enable/Disable the joint. More...
 
local setEnable ( local enable)
 Enable/Disable the joint. More...
 
bool isCollisionEnabled () const
void setCollisionEnable (bool enable)
 Enable/disable the collision between two bodies. More...
 
var setCollisionEnable ( var enable)
 Enable/disable the collision between two bodies. More...
 
local setCollisionEnable ( local enable)
 Enable/disable the collision between two bodies. More...
 
void removeFormWorld ()
 Remove the joint from the world. More...
 
local removeFormWorld ()
 Remove the joint from the world. More...
 
void setMaxForce (float force)
 Set the max force between two bodies. More...
 
var setMaxForce ( var force)
 Set the max force between two bodies. More...
 
local setMaxForce ( local force)
 Set the max force between two bodies. More...
 
float getMaxForce () const
 Get the max force setting. More...
 

Static Public Member Functions

static PhysicsJointSpringconstruct (PhysicsBody *a, PhysicsBody *b, const Vec2 &anchr1, const Vec2 &anchr2, float stiffness, float damping)
var construct ( var a, var b, var anchr1, var anchr2, var stiffness, var damping)
local construct ( local a, local b, local anchr1, local anchr2, local stiffness, local damping)

Protected Member Functions

 PhysicsJointSpring ()
 PhysicsJointSpring ()
virtual ~PhysicsJointSpring ()
var ~PhysicsJointSpring ()
local ~PhysicsJointSpring ()
- Protected Member Functions inherited from PhysicsJoint
 PhysicsJoint ()
 PhysicsJoint ()
virtual ~PhysicsJoint ()=0
local ~PhysicsJoint ()
bool init (PhysicsBody *a, PhysicsBody *b)
local init ( local a, local b)
bool initJoint ()
local initJoint ()

Protected Attributes

Vec2 _anchr1
Vec2 _anchr2
var _anchr2
local _anchr2
float _stiffness
var _stiffness
local _stiffness
float _damping
var _damping
local _damping
- Protected Attributes inherited from PhysicsJoint
std::vector< cpConstraint * > _cpConstraints
var _cpConstraints
local _cpConstraints
PhysicsBody_bodyA
var _bodyA
local _bodyA
PhysicsBody_bodyB
var _bodyB
local _bodyB
PhysicsWorld_world
var _world
local _world
bool _enable
var _enable
local _enable
bool _collisionEnable
var _collisionEnable
local _collisionEnable
bool _destoryMark
var _destoryMark
local _destoryMark
int _tag
var _tag
local _tag
float _maxForce
var _maxForce
local _maxForce
bool _initDirty
var _initDirty
local _initDirty

Detailed Description

Connecting two physics bodies together with a spring.

Constructor & Destructor Documentation

PhysicsJointSpring ( )
inlineprotected
var PhysicsJointSpring ( )
inlineprotected
local PhysicsJointSpring ( )
inlineprotected
virtual ~PhysicsJointSpring ( )
inlineprotectedvirtual
var ~PhysicsJointSpring ( )
inlineprotectedvirtual
local ~PhysicsJointSpring ( )
inlineprotectedvirtual

Member Function Documentation

static PhysicsJointSpring*
construct
( PhysicsBody a,
PhysicsBody b,
const Vec2 anchr1,
const Vec2 anchr2,
float  stiffness,
float  damping 
)
static
var construct ( var  a,
var  b,
var  anchr1,
var  anchr2,
var  stiffness,
var  damping 
)
static
local construct ( local  a,
local  b,
local  anchr1,
local  anchr2,
local  stiffness,
local  damping 
)
static
virtual bool createConstraints ( )
overridevirtual

Reimplemented from PhysicsJoint.

var createConstraints ( )
overridevirtual

Reimplemented from PhysicsJoint.

local createConstraints ( )
overridevirtual

Reimplemented from PhysicsJoint.

Vec2 getAnchr1 ( ) const
var getAnchr1 ( )
local getAnchr1 ( )
Vec2 getAnchr2 ( ) const
var getAnchr2 ( )
local getAnchr2 ( )
float getDamping ( ) const
var getDamping ( )
local getDamping ( )
float getRestLength ( ) const
var getRestLength ( )
local getRestLength ( )
float getStiffness ( ) const
var getStiffness ( )
local getStiffness ( )
void setAnchr1 ( const Vec2 anchr1)
var setAnchr1 ( var  anchr1)
local setAnchr1 ( local  anchr1)
void setAnchr2 ( const Vec2 anchr2)
var setAnchr2 ( var  anchr2)
local setAnchr2 ( local  anchr2)
void setDamping ( float  damping)
var setDamping ( var  damping)
local setDamping ( local  damping)
void setRestLength ( float  restLength)
var setRestLength ( var  restLength)
local setRestLength ( local  restLength)
void setStiffness ( float  stiffness)
var setStiffness ( var  stiffness)
local setStiffness ( local  stiffness)

Member Data Documentation

Vec2 _anchr1
protected
var _anchr1
protected
local _anchr1
protected
Vec2 _anchr2
protected
var _anchr2
protected
local _anchr2
protected
float _damping
protected
var _damping
protected
local _damping
protected
float _stiffness
protected
var _stiffness
protected
local _stiffness
protected

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