Connecting two physics bodies together with a spring.
More...
#include <CCPhysicsJoint.h>
|
static PhysicsJointSpring * | construct (PhysicsBody *a, PhysicsBody *b, const Vec2 &anchr1, const Vec2 &anchr2, float stiffness, float damping) |
| Create a fixed distance joint. More...
|
|
local | construct ( local a, local b, local anchr1, local anchr2, local stiffness, local damping) |
| Create a fixed distance joint. More...
|
|
Connecting two physics bodies together with a spring.
Create a fixed distance joint.
- Parameters
-
a | A is the body to connect. |
b | B is the body to connect. |
anchr1 | Anchr1 is the anchor point on body a. |
anchr2 | Anchr2 is the anchor point on body b. |
stiffness | It's the spring constant. |
damping | It's how soft to make the damping of the spring. |
- Returns
- A object pointer.
var construct |
( |
var |
a, |
|
|
var |
b, |
|
|
var |
anchr1, |
|
|
var |
anchr2, |
|
|
var |
stiffness, |
|
|
var |
damping |
|
) |
| |
|
static |
Create a fixed distance joint.
- Parameters
-
a | A is the body to connect. |
b | B is the body to connect. |
anchr1 | Anchr1 is the anchor point on body a. |
anchr2 | Anchr2 is the anchor point on body b. |
stiffness | It's the spring constant. |
damping | It's how soft to make the damping of the spring. |
- Returns
- A object pointer.
local construct |
( |
local |
a, |
|
|
local |
b, |
|
|
local |
anchr1, |
|
|
local |
anchr2, |
|
|
local |
stiffness, |
|
|
local |
damping |
|
) |
| |
|
static |
Create a fixed distance joint.
- Parameters
-
a | A is the body to connect. |
b | B is the body to connect. |
anchr1 | Anchr1 is the anchor point on body a. |
anchr2 | Anchr2 is the anchor point on body b. |
stiffness | It's the spring constant. |
damping | It's how soft to make the damping of the spring. |
- Returns
- A object pointer.
virtual bool createConstraints |
( |
| ) |
|
|
overridevirtual |
Create constraints for this type joint.
Reimplemented from PhysicsJoint.
var createConstraints |
( |
| ) |
|
|
overridevirtual |
Create constraints for this type joint.
Reimplemented from PhysicsJoint.
local createConstraints |
( |
| ) |
|
|
overridevirtual |
Create constraints for this type joint.
Reimplemented from PhysicsJoint.
Get the anchor point on body a.
Get the anchor point on body a.
Get the anchor point on body a.
Get the anchor point on body b.
Get the anchor point on body b.
Get the anchor point on body b.
float getDamping |
( |
| ) |
const |
Get the spring soft constant.
Get the spring soft constant.
Get the spring soft constant.
float getRestLength |
( |
| ) |
const |
Get the distance of the anchor points.
Get the distance of the anchor points.
Get the distance of the anchor points.
float getStiffness |
( |
| ) |
const |
void setAnchr1 |
( |
const Vec2 & |
anchr1 | ) |
|
Set the anchor point on body a.
var setAnchr1 |
( |
var |
anchr1 | ) |
|
Set the anchor point on body a.
local setAnchr1 |
( |
local |
anchr1 | ) |
|
Set the anchor point on body a.
void setAnchr2 |
( |
const Vec2 & |
anchr2 | ) |
|
Set the anchor point on body b.
var setAnchr2 |
( |
var |
anchr2 | ) |
|
Set the anchor point on body b.
local setAnchr2 |
( |
local |
anchr2 | ) |
|
Set the anchor point on body b.
void setDamping |
( |
float |
damping | ) |
|
Set the spring soft constant.
var setDamping |
( |
var |
damping | ) |
|
Set the spring soft constant.
local setDamping |
( |
local |
damping | ) |
|
Set the spring soft constant.
void setRestLength |
( |
float |
restLength | ) |
|
Set the distance of the anchor points.
var setRestLength |
( |
var |
restLength | ) |
|
Set the distance of the anchor points.
local setRestLength |
( |
local |
restLength | ) |
|
Set the distance of the anchor points.
void setStiffness |
( |
float |
stiffness | ) |
|
var setStiffness |
( |
var |
stiffness | ) |
|
local setStiffness |
( |
local |
stiffness | ) |
|
The documentation for this class was generated from the following file: