Public Member Functions

distance_joint Class Reference

iphy2d模块——距离关节类 More...

List of all members.

Public Member Functions

def __init__
def destroy
 销毁.

Detailed Description

iphy2d模块——距离关节类


Constructor & Destructor Documentation

def __init__ (   self,
  body_a,
  body_b,
  collide = True,
  anchor_a = math3d.vector2(0.0, 0.0,
  anchor_b = math3d.vector2(0.0, 0.0,
  len = 1.0,
  fre = 0.0,
  damp = 0.0 
)
创建一个距离关节,例如用于钟摆
必须保持引用,所属场景删除后就会无效
关节两端的任一body删除,也会无效

参数:
        body_a 类型 iphy2d.body,关节要连接的对象1
        body_b 类型 iphy2d.body,关节要连接的对象2
        collide bool 2个对象是否相互碰撞
        anchor_a math3d.vector2 锚点A,默认原点在对象1中心,是相对对象1的局部坐标系
        anchor_b math3d.vector2 锚点B,默认原点在对象2中心,是相对对象2的局部坐标系
        len float 两者保持的距离。
        fre float 质量-弹簧-阻尼系统,每帧的频率(此值如果大于物理系统的fps,会无效),用于距离节点作用时的效果更平滑
        damp float 阻尼系数,在[0,1]中, 0表示没有阻尼,1表示阻尼最大(振幅会消失)。实际上可以更大。

Member Function Documentation

def destroy (   self )

销毁.


此函数不会即时生效,将会在下一次update时把对象真正清除

 All Classes Namespaces Functions Variables Properties