diff options
Diffstat (limited to 'servers/physics_2d_server.h')
-rw-r--r-- | servers/physics_2d_server.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h index 4b6e6584e6..424d2fa7ce 100644 --- a/servers/physics_2d_server.h +++ b/servers/physics_2d_server.h @@ -55,8 +55,8 @@ public: virtual void set_angular_velocity(real_t p_velocity)=0; virtual real_t get_angular_velocity() const=0; - virtual void set_transform(const Matrix32& p_transform)=0; - virtual Matrix32 get_transform() const=0; + virtual void set_transform(const Transform2D& p_transform)=0; + virtual Transform2D get_transform() const=0; virtual void set_sleep_state(bool p_enable)=0; virtual bool is_sleeping() const=0; @@ -93,7 +93,7 @@ class Physics2DShapeQueryParameters : public Reference { GDCLASS(Physics2DShapeQueryParameters, Reference); friend class Physics2DDirectSpaceState; RID shape; - Matrix32 transform; + Transform2D transform; Vector2 motion; float margin; Set<RID> exclude; @@ -108,8 +108,8 @@ public: void set_shape_rid(const RID& p_shape); RID get_shape_rid() const; - void set_transform(const Matrix32& p_transform); - Matrix32 get_transform() const; + void set_transform(const Transform2D& p_transform); + Transform2D get_transform() const; void set_motion(const Vector2& p_motion); Vector2 get_motion() const; @@ -184,11 +184,11 @@ public: virtual int intersect_point(const Vector2& p_point,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_point=false)=0; - virtual int intersect_shape(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual int intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; - virtual bool cast_motion(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; - virtual bool collide_shape(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; struct ShapeRestInfo { @@ -202,7 +202,7 @@ public: }; - virtual bool rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; Physics2DDirectSpaceState(); @@ -238,7 +238,7 @@ class Physics2DServer : public Object { static Physics2DServer * singleton; - virtual bool _body_test_motion(RID p_body, const Matrix32 &p_from, const Vector2& p_motion, float p_margin=0.08, const Ref<Physics2DTestMotionResult>& p_result=Ref<Physics2DTestMotionResult>()); + virtual bool _body_test_motion(RID p_body, const Transform2D &p_from, const Vector2& p_motion, float p_margin=0.08, const Ref<Physics2DTestMotionResult>& p_result=Ref<Physics2DTestMotionResult>()); protected: static void _bind_methods(); @@ -268,7 +268,7 @@ public: virtual real_t shape_get_custom_solver_bias(RID p_shape) const=0; //these work well, but should be used from the main thread only - virtual bool shape_collide(RID p_shape_A, const Matrix32& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Matrix32& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count)=0; + virtual bool shape_collide(RID p_shape_A, const Transform2D& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Transform2D& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count)=0; /* SPACE API */ @@ -333,13 +333,13 @@ public: virtual void area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode)=0; virtual AreaSpaceOverrideMode area_get_space_override_mode(RID p_area) const=0; - virtual void area_add_shape(RID p_area, RID p_shape, const Matrix32& p_transform=Matrix32())=0; + virtual void area_add_shape(RID p_area, RID p_shape, const Transform2D& p_transform=Transform2D())=0; virtual void area_set_shape(RID p_area, int p_shape_idx,RID p_shape)=0; - virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Matrix32& p_transform)=0; + virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D& p_transform)=0; virtual int area_get_shape_count(RID p_area) const=0; virtual RID area_get_shape(RID p_area, int p_shape_idx) const=0; - virtual Matrix32 area_get_shape_transform(RID p_area, int p_shape_idx) const=0; + virtual Transform2D area_get_shape_transform(RID p_area, int p_shape_idx) const=0; virtual void area_remove_shape(RID p_area, int p_shape_idx)=0; virtual void area_clear_shapes(RID p_area)=0; @@ -348,10 +348,10 @@ public: virtual ObjectID area_get_object_instance_ID(RID p_area) const=0; virtual void area_set_param(RID p_area,AreaParameter p_param,const Variant& p_value)=0; - virtual void area_set_transform(RID p_area, const Matrix32& p_transform)=0; + virtual void area_set_transform(RID p_area, const Transform2D& p_transform)=0; virtual Variant area_get_param(RID p_parea,AreaParameter p_param) const=0; - virtual Matrix32 area_get_transform(RID p_area) const=0; + virtual Transform2D area_get_transform(RID p_area) const=0; virtual void area_set_collision_mask(RID p_area,uint32_t p_mask)=0; virtual void area_set_layer_mask(RID p_area,uint32_t p_mask)=0; @@ -382,14 +382,14 @@ public: virtual void body_set_mode(RID p_body, BodyMode p_mode)=0; virtual BodyMode body_get_mode(RID p_body) const=0; - virtual void body_add_shape(RID p_body, RID p_shape, const Matrix32& p_transform=Matrix32())=0; + virtual void body_add_shape(RID p_body, RID p_shape, const Transform2D& p_transform=Transform2D())=0; virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape)=0; - virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Matrix32& p_transform)=0; + virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D& p_transform)=0; virtual void body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant& p_metadata)=0; virtual int body_get_shape_count(RID p_body) const=0; virtual RID body_get_shape(RID p_body, int p_shape_idx) const=0; - virtual Matrix32 body_get_shape_transform(RID p_body, int p_shape_idx) const=0; + virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const=0; virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const=0; virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx,bool p_enable)=0; @@ -479,7 +479,7 @@ public: virtual void body_set_force_integration_callback(RID p_body,Object *p_receiver,const StringName& p_method,const Variant& p_udata=Variant())=0; - virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count)=0; + virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count)=0; virtual void body_set_pickable(RID p_body,bool p_pickable)=0; @@ -497,7 +497,7 @@ public: Variant collider_metadata; }; - virtual bool body_test_motion(RID p_body,const Matrix32& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL)=0; + virtual bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL)=0; /* JOINT API */ |