示例#1
0
文件: box_shape.cpp 项目: a12n/godot
void BoxShape::set_extents(const Vector3& p_extents) {

	extents=p_extents;
	_update_shape();
	notify_change_to_owners();
	_change_notify("extents");
}
示例#2
0
void PlaneShape::set_plane(Plane p_plane) {

	plane=p_plane;
	_update_shape();
	notify_change_to_owners();
	_change_notify("plane");
}
示例#3
0
void SphereShape::set_radius(float p_radius) {

	radius = p_radius;
	_update_shape();
	notify_change_to_owners();
	_change_notify("radius");
}
示例#4
0
CapsuleShape2D::CapsuleShape2D()
	: Shape2D(Physics2DServer::get_singleton()->capsule_shape_create()) {

	radius = 10;
	height = 20;
	_update_shape();
}
示例#5
0
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();
}
示例#7
0
void RayShape::set_length(float p_length) {

	length = p_length;
	_update_shape();
	notify_change_to_owners();
}
示例#8
0
CircleShape2D::CircleShape2D()
	: Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_CIRCLE)) {

	radius = 10;
	_update_shape();
}
示例#9
0
void CircleShape2D::set_radius(real_t p_radius) {

	radius = p_radius;
	_update_shape();
}
示例#10
0
void LineShape2D::set_d(real_t p_d) {

	d = p_d;
	_update_shape();
}
示例#11
0
void LineShape2D::set_normal(const Vector2 &p_normal) {

	normal = p_normal;
	_update_shape();
}
示例#12
0
void ConvexPolygonShape::set_points(const PoolVector<Vector3> &p_points) {

	points = p_points;
	_update_shape();
	notify_change_to_owners();
}
示例#13
0
CircleShape2D::CircleShape2D() :
		Shape2D(Physics2DServer::get_singleton()->circle_shape_create()) {

	radius = 10;
	_update_shape();
}
示例#14
0
void CapsuleShape2D::set_height(real_t p_height) {

	height = p_height;
	_update_shape();
}
示例#15
0
RectangleShape2D::RectangleShape2D()
	: Shape2D(Physics2DServer::get_singleton()->shape_create(Physics2DServer::SHAPE_RECTANGLE)) {

	extents = Vector2(10, 10);
	_update_shape();
}
示例#16
0
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();
}