diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index 4d554551666c..1959e035f311 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -739,7 +739,7 @@ Vector Geometry3D::build_box_planes(const Vector3 &p_extents) { return planes; } -Vector Geometry3D::build_cylinder_planes(real_t p_radius, real_t p_height, int p_sides, Vector3::Axis p_axis) { +Vector Geometry3D::build_cylinder_planes(real_t p_radius, real_t p_height, int p_sides, int p_axis) { ERR_FAIL_INDEX_V(p_axis, 3, Vector()); Vector planes; @@ -793,7 +793,7 @@ Vector Geometry3D::build_sphere_planes(real_t p_radius, int p_lats, int p return planes; } -Vector Geometry3D::build_capsule_planes(real_t p_radius, real_t p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { +Vector Geometry3D::build_capsule_planes(real_t p_radius, real_t p_height, int p_sides, int p_lats, int p_axis) { ERR_FAIL_INDEX_V(p_axis, 3, Vector()); Vector planes; diff --git a/core/math/geometry_3d.h b/core/math/geometry_3d.h index ff39d825958b..bff9eaa05481 100644 --- a/core/math/geometry_3d.h +++ b/core/math/geometry_3d.h @@ -574,8 +574,8 @@ class Geometry3D { static MeshData build_convex_mesh(const Vector &p_planes); static Vector build_sphere_planes(real_t p_radius, int p_lats, int p_lons, Vector3::Axis p_axis = Vector3::AXIS_Z); static Vector build_box_planes(const Vector3 &p_extents); - static Vector build_cylinder_planes(real_t p_radius, real_t p_height, int p_sides, Vector3::Axis p_axis = Vector3::AXIS_Z); - static Vector build_capsule_planes(real_t p_radius, real_t p_height, int p_sides, int p_lats, Vector3::Axis p_axis = Vector3::AXIS_Z); + static Vector build_cylinder_planes(real_t p_radius, real_t p_height, int p_sides, int p_axis = Vector3::AXIS_Z); + static Vector build_capsule_planes(real_t p_radius, real_t p_height, int p_sides, int p_lats, int p_axis = Vector3::AXIS_Z); static Vector compute_convex_mesh_points(const Plane *p_planes, int p_plane_count); diff --git a/doc/classes/Geometry3D.xml b/doc/classes/Geometry3D.xml index 9f876829830a..c4840e167af1 100644 --- a/doc/classes/Geometry3D.xml +++ b/doc/classes/Geometry3D.xml @@ -22,9 +22,9 @@ - + - Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the side part of the capsule, whereas [param lats] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [param axis] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). + Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the side part of the capsule, whereas [param lats] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [param axis] describes the index of the axis along which the capsule is oriented (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). @@ -32,9 +32,9 @@ - + - Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the round part of the cylinder. The parameter [param axis] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). + Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the round part of the cylinder. The parameter [param axis] describes the index of the axis along which the cylinder is oriented (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). diff --git a/doc/classes/LookAtModifier3D.xml b/doc/classes/LookAtModifier3D.xml index e85da06c3af9..432094832703 100644 --- a/doc/classes/LookAtModifier3D.xml +++ b/doc/classes/LookAtModifier3D.xml @@ -82,8 +82,8 @@ The limit angle of positive side of the primary rotation when [member symmetry_limitation] is [code]false[/code]. - - The axis of the first rotation. This [SkeletonModifier3D] works by compositing the rotation by Euler angles to prevent to rotate the [member forward_axis]. + + The index of the axis of the first rotation. This [SkeletonModifier3D] works by compositing the rotation by Euler angles to prevent to rotate the [member forward_axis] (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). The threshold to start damping for [member secondary_limit_angle]. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index f87d6342c79d..a1935caef90b 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -755,7 +755,7 @@ - + Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. @@ -764,7 +764,7 @@ - + Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. @@ -773,7 +773,7 @@ - + @@ -783,7 +783,7 @@ - + diff --git a/doc/classes/PhysicsServer3DExtension.xml b/doc/classes/PhysicsServer3DExtension.xml index e58a7ff9a8aa..c86785521949 100644 --- a/doc/classes/PhysicsServer3DExtension.xml +++ b/doc/classes/PhysicsServer3DExtension.xml @@ -683,7 +683,7 @@ - + @@ -691,7 +691,7 @@ - + @@ -699,7 +699,7 @@ - + @@ -708,7 +708,7 @@ - + diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index d6f8a519db76..5730730398b9 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -53,8 +53,8 @@ Threshold at which the alpha scissor will discard values. - - The direction in which the front of the texture faces. + + The index of the axis in which the front of the texture faces (see [constant Vector3.AXIS_X], [constant Vector3.AXIS_Y], and [constant Vector3.AXIS_Z]). The billboard mode to use for the sprite. See [enum BaseMaterial3D.BillboardMode] for possible values. diff --git a/modules/godot_physics_3d/godot_physics_server_3d.cpp b/modules/godot_physics_3d/godot_physics_server_3d.cpp index ad55e415e62b..4d67ab6c50b6 100644 --- a/modules/godot_physics_3d/godot_physics_server_3d.cpp +++ b/modules/godot_physics_3d/godot_physics_server_3d.cpp @@ -1521,7 +1521,7 @@ void GodotPhysicsServer3D::joint_make_generic_6dof(RID p_joint, RID p_body_A, co memdelete(prev_joint); } -void GodotPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, real_t p_value) { +void GodotPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, int p_axis, G6DOFJointAxisParam p_param, real_t p_value) { GodotJoint3D *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_NULL(joint); ERR_FAIL_COND(joint->get_type() != JOINT_TYPE_6DOF); @@ -1529,7 +1529,7 @@ void GodotPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::Ax generic_6dof_joint->set_param(p_axis, p_param, p_value); } -real_t GodotPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) const { +real_t GodotPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, int p_axis, G6DOFJointAxisParam p_param) const { GodotJoint3D *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_NULL_V(joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_TYPE_6DOF, 0); @@ -1537,7 +1537,7 @@ real_t GodotPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3:: return generic_6dof_joint->get_param(p_axis, p_param); } -void GodotPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) { +void GodotPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, int p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) { GodotJoint3D *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_NULL(joint); ERR_FAIL_COND(joint->get_type() != JOINT_TYPE_6DOF); @@ -1545,7 +1545,7 @@ void GodotPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axi generic_6dof_joint->set_flag(p_axis, p_flag, p_enable); } -bool GodotPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) const { +bool GodotPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, int p_axis, G6DOFJointAxisFlag p_flag) const { GodotJoint3D *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_NULL_V(joint, false); ERR_FAIL_COND_V(joint->get_type() != JOINT_TYPE_6DOF, false); diff --git a/modules/godot_physics_3d/godot_physics_server_3d.h b/modules/godot_physics_3d/godot_physics_server_3d.h index 040e673dcd82..f67160a6f3c3 100644 --- a/modules/godot_physics_3d/godot_physics_server_3d.h +++ b/modules/godot_physics_3d/godot_physics_server_3d.h @@ -348,11 +348,11 @@ class GodotPhysicsServer3D : public PhysicsServer3D { virtual void joint_make_generic_6dof(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) override; //reference frame is A - virtual void generic_6dof_joint_set_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param, real_t p_value) override; - virtual real_t generic_6dof_joint_get_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param) const override; + virtual void generic_6dof_joint_set_param(RID p_joint, int, G6DOFJointAxisParam p_param, real_t p_value) override; + virtual real_t generic_6dof_joint_get_param(RID p_joint, int, G6DOFJointAxisParam p_param) const override; - virtual void generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag, bool p_enable) override; - virtual bool generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag) const override; + virtual void generic_6dof_joint_set_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag, bool p_enable) override; + virtual bool generic_6dof_joint_get_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag) const override; virtual JointType joint_get_type(RID p_joint) const override; diff --git a/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.cpp b/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.cpp index 5f9cf9de49e2..ddc657a168be 100644 --- a/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.cpp +++ b/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.cpp @@ -444,7 +444,7 @@ void GodotGeneric6DOFJoint3D::calcAnchorPos() { m_AnchorPos = pA * weight + pB * (real_t(1.0) - weight); } -void GodotGeneric6DOFJoint3D::set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value) { +void GodotGeneric6DOFJoint3D::set_param(int p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value) { ERR_FAIL_INDEX(p_axis, 3); switch (p_param) { case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT: { @@ -531,7 +531,7 @@ void GodotGeneric6DOFJoint3D::set_param(Vector3::Axis p_axis, PhysicsServer3D::G } } -real_t GodotGeneric6DOFJoint3D::get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const { +real_t GodotGeneric6DOFJoint3D::get_param(int p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const { ERR_FAIL_INDEX_V(p_axis, 3, 0); switch (p_param) { case PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT: { @@ -619,7 +619,7 @@ real_t GodotGeneric6DOFJoint3D::get_param(Vector3::Axis p_axis, PhysicsServer3D: return 0; } -void GodotGeneric6DOFJoint3D::set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value) { +void GodotGeneric6DOFJoint3D::set_flag(int p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value) { ERR_FAIL_INDEX(p_axis, 3); switch (p_flag) { @@ -646,7 +646,7 @@ void GodotGeneric6DOFJoint3D::set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6 } } -bool GodotGeneric6DOFJoint3D::get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const { +bool GodotGeneric6DOFJoint3D::get_flag(int p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const { ERR_FAIL_INDEX_V(p_axis, 3, false); switch (p_flag) { case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: { diff --git a/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.h b/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.h index 9ee6dd279176..c3b95e19ce46 100644 --- a/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.h +++ b/modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.h @@ -312,11 +312,11 @@ class GodotGeneric6DOFJoint3D : public GodotJoint3D { virtual void calcAnchorPos(); // overridable - void set_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value); - real_t get_param(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const; + void set_param(int p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param, real_t p_value); + real_t get_param(int p_axis, PhysicsServer3D::G6DOFJointAxisParam p_param) const; - void set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value); - bool get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const; + void set_flag(int p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag, bool p_value); + bool get_flag(int p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const; }; #endif // GODOT_GENERIC_6DOF_JOINT_3D_H diff --git a/scene/3d/look_at_modifier_3d.cpp b/scene/3d/look_at_modifier_3d.cpp index ad33cd420a0b..9939ec46a5bb 100644 --- a/scene/3d/look_at_modifier_3d.cpp +++ b/scene/3d/look_at_modifier_3d.cpp @@ -92,12 +92,12 @@ LookAtModifier3D::BoneAxis LookAtModifier3D::get_forward_axis() const { return forward_axis; } -void LookAtModifier3D::set_primary_rotation_axis(Vector3::Axis p_axis) { +void LookAtModifier3D::set_primary_rotation_axis(int p_axis) { primary_rotation_axis = p_axis; update_configuration_warnings(); } -Vector3::Axis LookAtModifier3D::get_primary_rotation_axis() const { +int LookAtModifier3D::get_primary_rotation_axis() const { return primary_rotation_axis; } @@ -542,7 +542,7 @@ void LookAtModifier3D::_process_modification() { prev_q = destination; } -bool LookAtModifier3D::is_intersecting_axis(const Vector3 &p_prev, const Vector3 &p_current, Vector3::Axis p_flipping_axis, Vector3::Axis p_check_axis, bool p_check_plane) const { +bool LookAtModifier3D::is_intersecting_axis(const Vector3 &p_prev, const Vector3 &p_current, int p_flipping_axis, int p_check_axis, bool p_check_plane) const { // Prevent that the angular velocity does not become too large. // Check that is p_flipping_axis flipped nearby p_check_axis (close than origin_safe_margin) or not. If p_check_plane is true, check two axes of crossed plane. if (p_check_plane) { @@ -606,7 +606,7 @@ Vector3 LookAtModifier3D::get_vector_from_bone_axis(const LookAtModifier3D::Bone return ret; } -Vector3 LookAtModifier3D::get_vector_from_axis(const Vector3::Axis &p_axis) const { +Vector3 LookAtModifier3D::get_vector_from_axis(const int &p_axis) const { Vector3 ret; switch (p_axis) { case Vector3::AXIS_X: { @@ -641,7 +641,7 @@ Vector3::Axis LookAtModifier3D::get_axis_from_bone_axis(BoneAxis p_axis) const { return ret; } -Vector2 LookAtModifier3D::get_projection_vector(const Vector3 &p_vector, Vector3::Axis p_axis) const { +Vector2 LookAtModifier3D::get_projection_vector(const Vector3 &p_vector, int p_axis) const { // NOTE: axis is swapped between 2D and 3D. Vector2 ret; switch (p_axis) { diff --git a/scene/3d/look_at_modifier_3d.h b/scene/3d/look_at_modifier_3d.h index 5f3c4e8b1c2d..0077039c4f80 100644 --- a/scene/3d/look_at_modifier_3d.h +++ b/scene/3d/look_at_modifier_3d.h @@ -59,7 +59,7 @@ class LookAtModifier3D : public SkeletonModifier3D { Vector3 forward_vector; Vector3 forward_vector_nrm; BoneAxis forward_axis = BONE_AXIS_PLUS_Z; - Vector3::Axis primary_rotation_axis = Vector3::AXIS_Y; + int primary_rotation_axis = Vector3::AXIS_Y; Vector3::Axis secondary_rotation_axis = Vector3::AXIS_X; bool use_secondary_rotation = true; @@ -104,12 +104,12 @@ class LookAtModifier3D : public SkeletonModifier3D { Vector3 get_basis_vector_from_bone_axis(const Basis &p_basis, BoneAxis p_axis) const; Vector3 get_vector_from_bone_axis(const BoneAxis &p_axis) const; - Vector3 get_vector_from_axis(const Vector3::Axis &p_axis) const; + Vector3 get_vector_from_axis(const int &p_axis) const; Vector3::Axis get_axis_from_bone_axis(BoneAxis p_axis) const; - Vector2 get_projection_vector(const Vector3 &p_vector, Vector3::Axis p_axis) const; + Vector2 get_projection_vector(const Vector3 &p_vector, int p_axis) const; float remap_damped(float p_from, float p_to, float p_damp_threshold, float p_value) const; double get_bspline_y(const Vector2 &p_from, const Vector2 &p_control, const Vector2 &p_to, double p_x) const; - bool is_intersecting_axis(const Vector3 &p_prev, const Vector3 &p_current, Vector3::Axis p_flipping_axis, Vector3::Axis p_check_axis, bool p_check_plane = false) const; + bool is_intersecting_axis(const Vector3 &p_prev, const Vector3 &p_current, int p_flipping_axis, int p_check_axis, bool p_check_plane = false) const; Transform3D look_at_with_axes(const Transform3D &p_rest); void init_transition(); @@ -128,8 +128,8 @@ class LookAtModifier3D : public SkeletonModifier3D { void set_forward_axis(BoneAxis p_axis); BoneAxis get_forward_axis() const; - void set_primary_rotation_axis(Vector3::Axis p_axis); - Vector3::Axis get_primary_rotation_axis() const; + void set_primary_rotation_axis(int p_axis); + int get_primary_rotation_axis() const; void set_use_secondary_rotation(bool p_enabled); bool is_using_secondary_rotation() const; diff --git a/scene/3d/physics/physical_bone_3d.cpp b/scene/3d/physics/physical_bone_3d.cpp index 294690a89a03..10dcdc4db0cd 100644 --- a/scene/3d/physics/physical_bone_3d.cpp +++ b/scene/3d/physics/physical_bone_3d.cpp @@ -998,27 +998,27 @@ void PhysicalBone3D::_reload_joint() { PhysicsServer3D::get_singleton()->joint_make_generic_6dof(joint, body_a->get_rid(), local_a, get_rid(), joint_offset); const SixDOFJointData *g6dofjd(static_cast(joint_data)); for (int axis = 0; axis < 3; ++axis) { - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, g6dofjd->axis_data[axis].linear_limit_enabled); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT, g6dofjd->axis_data[axis].linear_limit_upper); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT, g6dofjd->axis_data[axis].linear_limit_lower); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].linear_limit_softness); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, g6dofjd->axis_data[axis].linear_spring_enabled); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].linear_spring_stiffness); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING, g6dofjd->axis_data[axis].linear_spring_damping); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].linear_equilibrium_point); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION, g6dofjd->axis_data[axis].linear_restitution); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING, g6dofjd->axis_data[axis].linear_damping); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, g6dofjd->axis_data[axis].angular_limit_enabled); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, g6dofjd->axis_data[axis].angular_limit_upper); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, g6dofjd->axis_data[axis].angular_limit_lower); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].angular_limit_softness); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION, g6dofjd->axis_data[axis].angular_restitution); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING, g6dofjd->axis_data[axis].angular_damping); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP, g6dofjd->axis_data[axis].erp); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, g6dofjd->axis_data[axis].angular_spring_enabled); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].angular_spring_stiffness); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, g6dofjd->axis_data[axis].angular_spring_damping); - PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, static_cast(axis), PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].angular_equilibrium_point); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, g6dofjd->axis_data[axis].linear_limit_enabled); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_UPPER_LIMIT, g6dofjd->axis_data[axis].linear_limit_upper); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_LOWER_LIMIT, g6dofjd->axis_data[axis].linear_limit_lower); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].linear_limit_softness); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING, g6dofjd->axis_data[axis].linear_spring_enabled); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].linear_spring_stiffness); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_DAMPING, g6dofjd->axis_data[axis].linear_spring_damping); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].linear_equilibrium_point); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_RESTITUTION, g6dofjd->axis_data[axis].linear_restitution); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_LINEAR_DAMPING, g6dofjd->axis_data[axis].linear_damping); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, g6dofjd->axis_data[axis].angular_limit_enabled); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, g6dofjd->axis_data[axis].angular_limit_upper); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, g6dofjd->axis_data[axis].angular_limit_lower); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].angular_limit_softness); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_RESTITUTION, g6dofjd->axis_data[axis].angular_restitution); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_DAMPING, g6dofjd->axis_data[axis].angular_damping); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_ERP, g6dofjd->axis_data[axis].erp); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(joint, axis, PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING, g6dofjd->axis_data[axis].angular_spring_enabled); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS, g6dofjd->axis_data[axis].angular_spring_stiffness); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_DAMPING, g6dofjd->axis_data[axis].angular_spring_damping); + PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(joint, axis, PhysicsServer3D::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT, g6dofjd->axis_data[axis].angular_equilibrium_point); } } break; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 6e3ada83adda..4b8a3a8da1d6 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -378,7 +378,7 @@ real_t SpriteBase3D::get_pixel_size() const { return pixel_size; } -void SpriteBase3D::set_axis(Vector3::Axis p_axis) { +void SpriteBase3D::set_axis(int p_axis) { ERR_FAIL_INDEX(p_axis, 3); if (axis == p_axis) { @@ -389,7 +389,7 @@ void SpriteBase3D::set_axis(Vector3::Axis p_axis) { _queue_redraw(); } -Vector3::Axis SpriteBase3D::get_axis() const { +int SpriteBase3D::get_axis() const { return axis; } diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 8f50a528ccfe..541575da7078 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -75,7 +75,7 @@ class SpriteBase3D : public GeometryInstance3D { Color modulate = Color(1, 1, 1, 1); int render_priority = 0; - Vector3::Axis axis = Vector3::AXIS_Z; + int axis = Vector3::AXIS_Z; real_t pixel_size = 0.01; AABB aabb; @@ -141,8 +141,10 @@ class SpriteBase3D : public GeometryInstance3D { void set_pixel_size(real_t p_amount); real_t get_pixel_size() const; - void set_axis(Vector3::Axis p_axis); - Vector3::Axis get_axis() const; + // void set_axis(Vector3::Axis p_axis); + // Vector3::Axis get_axis() const; + void set_axis(int p_axis); + int get_axis() const; void set_draw_flag(DrawFlags p_flag, bool p_enable); bool get_draw_flag(DrawFlags p_flag) const; diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index 33def7cf8d44..277bf989051a 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -777,11 +777,11 @@ class PhysicsServer3D : public Object { virtual void joint_make_generic_6dof(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) = 0; //reference frame is A - virtual void generic_6dof_joint_set_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param, real_t p_value) = 0; - virtual real_t generic_6dof_joint_get_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param) const = 0; + virtual void generic_6dof_joint_set_param(RID p_joint, int, G6DOFJointAxisParam p_param, real_t p_value) = 0; + virtual real_t generic_6dof_joint_get_param(RID p_joint, int, G6DOFJointAxisParam p_param) const = 0; - virtual void generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag, bool p_enable) = 0; - virtual bool generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag) const = 0; + virtual void generic_6dof_joint_set_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag, bool p_enable) = 0; + virtual bool generic_6dof_joint_get_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag) const = 0; /* QUERY API */ diff --git a/servers/physics_server_3d_dummy.h b/servers/physics_server_3d_dummy.h index 209a541fea01..48f5a1ed8068 100644 --- a/servers/physics_server_3d_dummy.h +++ b/servers/physics_server_3d_dummy.h @@ -404,11 +404,11 @@ class PhysicsServer3DDummy : public PhysicsServer3D { virtual void joint_make_generic_6dof(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) override {} - virtual void generic_6dof_joint_set_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param, real_t p_value) override {} - virtual real_t generic_6dof_joint_get_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param) const override { return 0; } + virtual void generic_6dof_joint_set_param(RID p_joint, int, G6DOFJointAxisParam p_param, real_t p_value) override {} + virtual real_t generic_6dof_joint_get_param(RID p_joint, int, G6DOFJointAxisParam p_param) const override { return 0; } - virtual void generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag, bool p_enable) override {} - virtual bool generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag) const override { return false; } + virtual void generic_6dof_joint_set_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag, bool p_enable) override {} + virtual bool generic_6dof_joint_get_flag(RID p_joint, int, G6DOFJointAxisFlag p_flag) const override { return false; } /* MISC */ diff --git a/servers/physics_server_3d_wrap_mt.h b/servers/physics_server_3d_wrap_mt.h index 2fd39546a59e..bba21491ea70 100644 --- a/servers/physics_server_3d_wrap_mt.h +++ b/servers/physics_server_3d_wrap_mt.h @@ -363,11 +363,11 @@ class PhysicsServer3DWrapMT : public PhysicsServer3D { FUNC5(joint_make_generic_6dof, RID, RID, const Transform3D &, RID, const Transform3D &) - FUNC4(generic_6dof_joint_set_param, RID, Vector3::Axis, G6DOFJointAxisParam, real_t) - FUNC3RC(real_t, generic_6dof_joint_get_param, RID, Vector3::Axis, G6DOFJointAxisParam) + FUNC4(generic_6dof_joint_set_param, RID, int, G6DOFJointAxisParam, real_t) + FUNC3RC(real_t, generic_6dof_joint_get_param, RID, int, G6DOFJointAxisParam) - FUNC4(generic_6dof_joint_set_flag, RID, Vector3::Axis, G6DOFJointAxisFlag, bool) - FUNC3RC(bool, generic_6dof_joint_get_flag, RID, Vector3::Axis, G6DOFJointAxisFlag) + FUNC4(generic_6dof_joint_set_flag, RID, int, G6DOFJointAxisFlag, bool) + FUNC3RC(bool, generic_6dof_joint_get_flag, RID, int, G6DOFJointAxisFlag) FUNC1RC(JointType, joint_get_type, RID);