void BoxShape::set_extents(const Vector3& p_extents) { extents=p_extents; _update_shape(); notify_change_to_owners(); _change_notify("extents"); }
void PlaneShape::set_plane(Plane p_plane) { plane=p_plane; _update_shape(); notify_change_to_owners(); _change_notify("plane"); }
void SphereShape::set_radius(float p_radius) { radius = p_radius; _update_shape(); notify_change_to_owners(); _change_notify("radius"); }
CapsuleShape2D::CapsuleShape2D() : Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) { radius = 10; height = 20; _update_shape(); }
LineShape2D::LineShape2D() : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_LINE)) { normal = Vector2(0, -1); d = 0; _update_shape(); }
ConvexPolygonShape2D::ConvexPolygonShape2D() : Shape2D( Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CONVEX_POLYGON)) { int pcount =3; for(int i=0;i<pcount;i++) points.push_back(Vector2(Math::sin(i*Math_PI*2/pcount),-Math::cos(i*Math_PI*2/pcount))*10); _update_shape(); }
void RayShape::set_length(float p_length) { length = p_length; _update_shape(); notify_change_to_owners(); }
CircleShape2D::CircleShape2D() : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CIRCLE)) { radius = 10; _update_shape(); }
void CircleShape2D::set_radius(real_t p_radius) { radius = p_radius; _update_shape(); }
void LineShape2D::set_d(real_t p_d) { d = p_d; _update_shape(); }
void LineShape2D::set_normal(const Vector2 &p_normal) { normal = p_normal; _update_shape(); }
void ConvexPolygonShape::set_points(const PoolVector<Vector3> &p_points) { points = p_points; _update_shape(); notify_change_to_owners(); }
CircleShape2D::CircleShape2D() : Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) { radius = 10; _update_shape(); }
void CapsuleShape2D::set_height(real_t p_height) { height = p_height; _update_shape(); }
RectangleShape2D::RectangleShape2D() : Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RECTANGLE)) { extents = Vector2(10, 10); _update_shape(); }
void RectangleShape2D::set_extents(const Vector2 &p_extents) { extents = p_extents; _update_shape(); }
void ConvexPolygonShape2D::set_points(const Vector<Vector2>& p_points) { points=p_points; _update_shape(); }