本文整理汇总了C++中JointSW::set_self方法的典型用法代码示例。如果您正苦于以下问题:C++ JointSW::set_self方法的具体用法?C++ JointSW::set_self怎么用?C++ JointSW::set_self使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JointSW
的用法示例。
在下文中一共展示了JointSW::set_self方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: damped_spring_joint_create
RID PhysicsServerSW::damped_spring_joint_create(const Vector3& p_anchor_a,const Vector3& p_anchor_b,RID p_body_a,RID p_body_b) {
BodySW *A=body_owner.get(p_body_a);
ERR_FAIL_COND_V(!A,RID());
BodySW *B=body_owner.get(p_body_b);
ERR_FAIL_COND_V(!B,RID());
JointSW *joint = memnew( DampedSpringJointSW(p_anchor_a,p_anchor_b,A,B) );
RID self = joint_owner.make_rid(joint);
joint->set_self(self);
return self;
}
示例2: pin_joint_create
RID PhysicsServerSW::pin_joint_create(const Vector3& p_pos,RID p_body_a,RID p_body_b) {
BodySW *A=body_owner.get(p_body_a);
ERR_FAIL_COND_V(!A,RID());
BodySW *B=NULL;
if (body_owner.owns(p_body_b)) {
B=body_owner.get(p_body_b);
ERR_FAIL_COND_V(!B,RID());
}
JointSW *joint = memnew( PinJointSW(p_pos,A,B) );
RID self = joint_owner.make_rid(joint);
joint->set_self(self);
return self;
}
示例3: groove_joint_create
RID PhysicsServerSW::groove_joint_create(const Vector3& p_a_groove1,const Vector3& p_a_groove2, const Vector3& p_b_anchor, RID p_body_a,RID p_body_b) {
BodySW *A=body_owner.get(p_body_a);
ERR_FAIL_COND_V(!A,RID());
BodySW *B=body_owner.get(p_body_b);
ERR_FAIL_COND_V(!B,RID());
JointSW *joint = memnew( GrooveJointSW(p_a_groove1,p_a_groove2,p_b_anchor,A,B) );
RID self = joint_owner.make_rid(joint);
joint->set_self(self);
return self;
}
示例4: joint_create_pin
RID PhysicsServerSW::joint_create_pin(RID p_body_A,const Vector3& p_local_A,RID p_body_B,const Vector3& p_local_B) {
BodySW *body_A = body_owner.get(p_body_A);
ERR_FAIL_COND_V(!body_A,RID());
if (!p_body_B.is_valid()) {
ERR_FAIL_COND_V(!body_A->get_space(),RID());
p_body_B=body_A->get_space()->get_static_global_body();
}
BodySW *body_B = body_owner.get(p_body_B);
ERR_FAIL_COND_V(!body_B,RID());
ERR_FAIL_COND_V(body_A==body_B,RID());
JointSW *joint = memnew( PinJointSW(body_A,p_local_A,body_B,p_local_B) );
RID rid = joint_owner.make_rid(joint);
joint->set_self(rid);
return rid;
}
示例5: memnew
RID PhysicsServerSW::joint_create_generic_6dof(RID p_body_A,const Transform& p_local_frame_A,RID p_body_B,const Transform& p_local_frame_B) {
BodySW *body_A = body_owner.get(p_body_A);
ERR_FAIL_COND_V(!body_A,RID());
if (!p_body_B.is_valid()) {
ERR_FAIL_COND_V(!body_A->get_space(),RID());
p_body_B=body_A->get_space()->get_static_global_body();
}
BodySW *body_B = body_owner.get(p_body_B);
ERR_FAIL_COND_V(!body_B,RID());
ERR_FAIL_COND_V(body_A==body_B,RID());
JointSW *joint = memnew( Generic6DOFJointSW(body_A,body_B,p_local_frame_A,p_local_frame_B,true) );
RID rid = joint_owner.make_rid(joint);
joint->set_self(rid);
return rid;
}