You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Merge branch 'master' of https://github.com/okamstudio/godot
This commit is contained in:
@@ -194,7 +194,6 @@ bool BodyPairSW::_test_ccd(float p_step,BodySW *p_A, int p_shape_A,const Transfo
|
||||
|
||||
//cast a segment from support in motion normal, in the same direction of motion by motion length
|
||||
//support is the worst case collision point, so real collision happened before
|
||||
int a;
|
||||
Vector3 s=p_A->get_shape(p_shape_A)->get_support(p_xform_A.basis.xform(mnormal).normalized());
|
||||
Vector3 from = p_xform_A.xform(s);
|
||||
Vector3 to = from + motion;
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
|
||||
_FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, uint32_t p_layer_mask, uint32_t p_type_mask) {
|
||||
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
if (p_object->get_type()==CollisionObjectSW::TYPE_AREA)
|
||||
return p_type_mask&PhysicsDirectSpaceState::TYPE_MASK_AREA;
|
||||
|
||||
if (p_object->get_type()==CollisionObjectSW::TYPE_AREA && !(p_type_mask&PhysicsDirectSpaceState::TYPE_MASK_AREA))
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
|
||||
BodySW *body = static_cast<BodySW*>(p_object);
|
||||
|
||||
@@ -279,6 +279,18 @@ void PinJoint2DSW::solve(float p_step){
|
||||
P += impulse;
|
||||
}
|
||||
|
||||
void PinJoint2DSW::set_param(Physics2DServer::PinJointParam p_param, real_t p_value) {
|
||||
|
||||
if(p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
|
||||
softness = p_value;
|
||||
}
|
||||
|
||||
real_t PinJoint2DSW::get_param(Physics2DServer::PinJointParam p_param) const {
|
||||
|
||||
if(p_param == Physics2DServer::PIN_JOINT_SOFTNESS)
|
||||
return softness;
|
||||
ERR_FAIL_V(0);
|
||||
}
|
||||
|
||||
PinJoint2DSW::PinJoint2DSW(const Vector2& p_pos,Body2DSW* p_body_a,Body2DSW* p_body_b) : Joint2DSW(_arr,p_body_b?2:1) {
|
||||
|
||||
|
||||
@@ -121,6 +121,8 @@ public:
|
||||
virtual bool setup(float p_step);
|
||||
virtual void solve(float p_step);
|
||||
|
||||
void set_param(Physics2DServer::PinJointParam p_param, real_t p_value);
|
||||
real_t get_param(Physics2DServer::PinJointParam p_param) const;
|
||||
|
||||
PinJoint2DSW(const Vector2& p_pos,Body2DSW* p_body_a,Body2DSW* p_body_b=NULL);
|
||||
~PinJoint2DSW();
|
||||
|
||||
@@ -1096,6 +1096,25 @@ RID Physics2DServerSW::damped_spring_joint_create(const Vector2& p_anchor_a,cons
|
||||
|
||||
}
|
||||
|
||||
void Physics2DServerSW::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) {
|
||||
|
||||
Joint2DSW *j = joint_owner.get(p_joint);
|
||||
ERR_FAIL_COND(!j);
|
||||
ERR_FAIL_COND(j->get_type()!=JOINT_PIN);
|
||||
|
||||
PinJoint2DSW *pin_joint = static_cast<PinJoint2DSW*>(j);
|
||||
pin_joint->set_param(p_param, p_value);
|
||||
}
|
||||
|
||||
real_t Physics2DServerSW::pin_joint_get_param(RID p_joint, PinJointParam p_param) const {
|
||||
Joint2DSW *j = joint_owner.get(p_joint);
|
||||
ERR_FAIL_COND_V(!j,0);
|
||||
ERR_FAIL_COND_V(j->get_type()!=JOINT_PIN,0);
|
||||
|
||||
PinJoint2DSW *pin_joint = static_cast<PinJoint2DSW*>(j);
|
||||
return pin_joint->get_param(p_param);
|
||||
}
|
||||
|
||||
void Physics2DServerSW::damped_string_joint_set_param(RID p_joint, DampedStringParam p_param, real_t p_value) {
|
||||
|
||||
|
||||
|
||||
@@ -243,6 +243,8 @@ public:
|
||||
virtual RID pin_joint_create(const Vector2& p_pos,RID p_body_a,RID p_body_b=RID());
|
||||
virtual RID groove_joint_create(const Vector2& p_a_groove1,const Vector2& p_a_groove2, const Vector2& p_b_anchor, RID p_body_a,RID p_body_b);
|
||||
virtual RID damped_spring_joint_create(const Vector2& p_anchor_a,const Vector2& p_anchor_b,RID p_body_a,RID p_body_b=RID());
|
||||
virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value);
|
||||
virtual real_t pin_joint_get_param(RID p_joint, PinJointParam p_param) const;
|
||||
virtual void damped_string_joint_set_param(RID p_joint, DampedStringParam p_param, real_t p_value);
|
||||
virtual real_t damped_string_joint_get_param(RID p_joint, DampedStringParam p_param) const;
|
||||
|
||||
|
||||
@@ -258,6 +258,9 @@ public:
|
||||
FUNC5R(RID,groove_joint_create,const Vector2&,const Vector2&,const Vector2&,RID,RID);
|
||||
FUNC4R(RID,damped_spring_joint_create,const Vector2&,const Vector2&,RID,RID);
|
||||
|
||||
FUNC3(pin_joint_set_param,RID,PinJointParam,real_t);
|
||||
FUNC2RC(real_t,pin_joint_get_param,RID,PinJointParam);
|
||||
|
||||
FUNC3(damped_string_joint_set_param,RID,DampedStringParam,real_t);
|
||||
FUNC2RC(real_t,damped_string_joint_get_param,RID,DampedStringParam);
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObject2DSW *p_objec
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
|
||||
if (p_object->get_type()==CollisionObject2DSW::TYPE_AREA && !(p_type_mask&Physics2DDirectSpaceState::TYPE_MASK_AREA))
|
||||
return false;
|
||||
if (p_object->get_type()==CollisionObject2DSW::TYPE_AREA)
|
||||
return p_type_mask&Physics2DDirectSpaceState::TYPE_MASK_AREA;
|
||||
|
||||
Body2DSW *body = static_cast<Body2DSW*>(p_object);
|
||||
|
||||
|
||||
@@ -516,6 +516,13 @@ public:
|
||||
virtual RID groove_joint_create(const Vector2& p_a_groove1,const Vector2& p_a_groove2, const Vector2& p_b_anchor, RID p_body_a,RID p_body_b)=0;
|
||||
virtual RID damped_spring_joint_create(const Vector2& p_anchor_a,const Vector2& p_anchor_b,RID p_body_a,RID p_body_b=RID())=0;
|
||||
|
||||
enum PinJointParam {
|
||||
PIN_JOINT_SOFTNESS
|
||||
};
|
||||
|
||||
virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value)=0;
|
||||
virtual real_t pin_joint_get_param(RID p_joint, PinJointParam p_param) const=0;
|
||||
|
||||
enum DampedStringParam {
|
||||
DAMPED_STRING_REST_LENGTH,
|
||||
DAMPED_STRING_STIFFNESS,
|
||||
|
||||
@@ -5219,7 +5219,6 @@ void VisualServerRaster::_light_instance_update_lispsm_shadow(Instance *p_light,
|
||||
|
||||
|
||||
AABB proj_space_aabb;
|
||||
float max_d,min_d;
|
||||
|
||||
{
|
||||
|
||||
@@ -6824,7 +6823,11 @@ void VisualServerRaster::_render_canvas_item(CanvasItem *p_canvas_item,const Mat
|
||||
copymem(child_items,ci->child_items.ptr(),child_item_count*sizeof(CanvasItem*));
|
||||
|
||||
if (ci->clip) {
|
||||
ci->final_clip_rect=global_rect;
|
||||
if (p_canvas_clip != NULL) {
|
||||
ci->final_clip_rect=p_canvas_clip->final_clip_rect.clip(global_rect);
|
||||
} else {
|
||||
ci->final_clip_rect=global_rect;
|
||||
}
|
||||
ci->final_clip_owner=ci;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user