cocos2d-x  3.3
 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
 
void setAnchr1 (const Vec2 &anchr1)
 
Vec2 getAnchr2 () const
 
void setAnchr2 (const Vec2 &anchr2)
 
float getRestLength () const
 
void setRestLength (float restLength)
 
float getStiffness () const
 
void setStiffness (float stiffness)
 
float getDamping () const
 
void setDamping (float damping)
 
- Public Member Functions inherited from PhysicsJoint
PhysicsBodygetBodyA () const
 
PhysicsBodygetBodyB () const
 
PhysicsWorldgetWorld () const
 
int getTag () const
 
void setTag (int tag)
 
bool isEnabled () const
 
void setEnable (bool enable)
 Enable/Disable the joint. More...
 
bool isCollisionEnabled () const
 
void setCollisionEnable (bool enable)
 Enable/disable the collision between two bodies. More...
 
void removeFormWorld ()
 Remove the joint from the world. More...
 
void setMaxForce (float 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)
 
- Static Public Member Functions inherited from PhysicsJoint
static void destroy (PhysicsJoint *joint)
 Distory the joint. More...
 

Protected Member Functions

bool init (PhysicsBody *a, PhysicsBody *b, const Vec2 &anchr1, const Vec2 &anchr2, float stiffness, float damping)
 
 PhysicsJointSpring ()
 
virtual ~PhysicsJointSpring ()
 
- Protected Member Functions inherited from PhysicsJoint
 PhysicsJoint ()
 
virtual ~PhysicsJoint ()=0
 
bool init (PhysicsBody *a, PhysicsBody *b)
 
PhysicsBodyInfogetBodyInfo (PhysicsBody *body) const
 PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More...
 
NodegetBodyNode (PhysicsBody *body) const
 

Additional Inherited Members

- Protected Attributes inherited from PhysicsJoint
PhysicsBody_bodyA
 
PhysicsBody_bodyB
 
PhysicsWorld_world
 
PhysicsJointInfo_info
 
bool _enable
 
bool _collisionEnable
 
bool _destoryMark
 
int _tag
 

Detailed Description

Connecting two physics bodies together with a spring.

Constructor & Destructor Documentation

PhysicsJointSpring ( )
inlineprotected
virtual ~PhysicsJointSpring ( )
inlineprotectedvirtual

Member Function Documentation

static PhysicsJointSpring* construct ( PhysicsBody a,
PhysicsBody b,
const Vec2 anchr1,
const Vec2 anchr2,
float  stiffness,
float  damping 
)
static
Vec2 getAnchr1 ( ) const
Vec2 getAnchr2 ( ) const
float getDamping ( ) const
float getRestLength ( ) const
float getStiffness ( ) const
bool init ( PhysicsBody a,
PhysicsBody b,
const Vec2 anchr1,
const Vec2 anchr2,
float  stiffness,
float  damping 
)
protected
void setAnchr1 ( const Vec2 anchr1)
void setAnchr2 ( const Vec2 anchr2)
void setDamping ( float  damping)
void setRestLength ( float  restLength)
void setStiffness ( float  stiffness)

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