Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
06a2fb0b
Unverified
Commit
06a2fb0b
authored
Jun 05, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 05, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39293 from madmiraal/fix-27921
Correct misspellings of damped spring.
parents
399c88dc
b5e31b70
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
45 deletions
+45
-45
PhysicsServer2D.xml
doc/classes/PhysicsServer2D.xml
+9
-9
classes.pot
doc/translations/classes.pot
+1
-1
fr.po
doc/translations/fr.po
+1
-1
joints_2d.cpp
scene/2d/joints_2d.cpp
+6
-6
joints_2d_sw.cpp
servers/physics_2d/joints_2d_sw.cpp
+8
-8
joints_2d_sw.h
servers/physics_2d/joints_2d_sw.h
+2
-2
physics_server_2d_sw.cpp
servers/physics_2d/physics_server_2d_sw.cpp
+2
-2
physics_server_2d_sw.h
servers/physics_2d/physics_server_2d_sw.h
+2
-2
physics_server_2d_wrap_mt.h
servers/physics_2d/physics_server_2d_wrap_mt.h
+2
-2
physics_server_2d.cpp
servers/physics_server_2d.cpp
+5
-5
physics_server_2d.h
servers/physics_server_2d.h
+7
-7
No files found.
doc/classes/PhysicsServer2D.xml
View file @
06a2fb0b
...
...
@@ -864,28 +864,28 @@
Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
<method
name=
"damped_s
t
ring_joint_get_param"
qualifiers=
"const"
>
<method
name=
"damped_s
p
ring_joint_get_param"
qualifiers=
"const"
>
<return
type=
"float"
>
</return>
<argument
index=
"0"
name=
"joint"
type=
"RID"
>
</argument>
<argument
index=
"1"
name=
"param"
type=
"int"
enum=
"PhysicsServer2D.DampedS
t
ringParam"
>
<argument
index=
"1"
name=
"param"
type=
"int"
enum=
"PhysicsServer2D.DampedS
p
ringParam"
>
</argument>
<description>
Returns the value of a damped spring joint parameter.
Returns the value of a damped spring joint parameter.
See [enum DampedSpringParam] for a list of available parameters.
</description>
</method>
<method
name=
"damped_s
t
ring_joint_set_param"
>
<method
name=
"damped_s
p
ring_joint_set_param"
>
<return
type=
"void"
>
</return>
<argument
index=
"0"
name=
"joint"
type=
"RID"
>
</argument>
<argument
index=
"1"
name=
"param"
type=
"int"
enum=
"PhysicsServer2D.DampedS
t
ringParam"
>
<argument
index=
"1"
name=
"param"
type=
"int"
enum=
"PhysicsServer2D.DampedS
p
ringParam"
>
</argument>
<argument
index=
"2"
name=
"value"
type=
"float"
>
</argument>
<description>
Sets a damped spring joint parameter. See [enum DampedS
t
ringParam] for a list of available parameters.
Sets a damped spring joint parameter. See [enum DampedS
p
ringParam] for a list of available parameters.
</description>
</method>
<method
name=
"free_rid"
>
...
...
@@ -1247,13 +1247,13 @@
</constant>
<constant
name=
"JOINT_PARAM_MAX_FORCE"
value=
"2"
enum=
"JointParam"
>
</constant>
<constant
name=
"DAMPED_S
TRING_REST_LENGTH"
value=
"0"
enum=
"DampedSt
ringParam"
>
<constant
name=
"DAMPED_S
PRING_REST_LENGTH"
value=
"0"
enum=
"DampedSp
ringParam"
>
Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
</constant>
<constant
name=
"DAMPED_S
TRING_STIFFNESS"
value=
"1"
enum=
"DampedSt
ringParam"
>
<constant
name=
"DAMPED_S
PRING_STIFFNESS"
value=
"1"
enum=
"DampedSp
ringParam"
>
Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
</constant>
<constant
name=
"DAMPED_S
TRING_DAMPING"
value=
"2"
enum=
"DampedSt
ringParam"
>
<constant
name=
"DAMPED_S
PRING_DAMPING"
value=
"2"
enum=
"DampedSp
ringParam"
>
Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping).
</constant>
<constant
name=
"CCD_MODE_DISABLED"
value=
"0"
enum=
"CCDMode"
>
...
...
doc/translations/classes.pot
View file @
06a2fb0b
...
...
@@ -35842,7 +35842,7 @@ msgstr ""
#: doc/classes/PhysicsServer2D.xml:888
msgid ""
"Sets a damped spring joint parameter. See [enum DampedS
t
ringParam] for a "
"Sets a damped spring joint parameter. See [enum DampedS
p
ringParam] for a "
"list of available parameters."
msgstr ""
doc/translations/fr.po
View file @
06a2fb0b
...
...
@@ -35852,7 +35852,7 @@ msgstr ""
#: doc/classes/PhysicsServer2D.xml:888
msgid ""
"Sets a damped spring joint parameter. See [enum DampedS
t
ringParam] for a "
"Sets a damped spring joint parameter. See [enum DampedS
p
ringParam] for a "
"list of available parameters."
msgstr ""
scene/2d/joints_2d.cpp
View file @
06a2fb0b
...
...
@@ -309,10 +309,10 @@ RID DampedSpringJoint2D::_configure_joint(PhysicsBody2D *body_a, PhysicsBody2D *
RID
dsj
=
PhysicsServer2D
::
get_singleton
()
->
damped_spring_joint_create
(
anchor_A
,
anchor_B
,
body_a
->
get_rid
(),
body_b
->
get_rid
());
if
(
rest_length
)
{
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_ST
RING_REST_LENGTH
,
rest_length
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_SP
RING_REST_LENGTH
,
rest_length
);
}
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_ST
RING_STIFFNESS
,
stiffness
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_ST
RING_DAMPING
,
damping
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_SP
RING_STIFFNESS
,
stiffness
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
dsj
,
PhysicsServer2D
::
DAMPED_SP
RING_DAMPING
,
damping
);
return
dsj
;
}
...
...
@@ -330,7 +330,7 @@ void DampedSpringJoint2D::set_rest_length(real_t p_rest_length) {
rest_length
=
p_rest_length
;
update
();
if
(
get_joint
().
is_valid
())
{
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_ST
RING_REST_LENGTH
,
p_rest_length
?
p_rest_length
:
length
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_SP
RING_REST_LENGTH
,
p_rest_length
?
p_rest_length
:
length
);
}
}
...
...
@@ -342,7 +342,7 @@ void DampedSpringJoint2D::set_stiffness(real_t p_stiffness) {
stiffness
=
p_stiffness
;
update
();
if
(
get_joint
().
is_valid
())
{
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_ST
RING_STIFFNESS
,
p_stiffness
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_SP
RING_STIFFNESS
,
p_stiffness
);
}
}
...
...
@@ -354,7 +354,7 @@ void DampedSpringJoint2D::set_damping(real_t p_damping) {
damping
=
p_damping
;
update
();
if
(
get_joint
().
is_valid
())
{
PhysicsServer2D
::
get_singleton
()
->
damped_s
tring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_ST
RING_DAMPING
,
p_damping
);
PhysicsServer2D
::
get_singleton
()
->
damped_s
pring_joint_set_param
(
get_joint
(),
PhysicsServer2D
::
DAMPED_SP
RING_DAMPING
,
p_damping
);
}
}
...
...
servers/physics_2d/joints_2d_sw.cpp
View file @
06a2fb0b
...
...
@@ -390,29 +390,29 @@ void DampedSpringJoint2DSW::solve(real_t p_step) {
B
->
apply_impulse
(
rB
,
j
);
}
void
DampedSpringJoint2DSW
::
set_param
(
PhysicsServer2D
::
DampedS
t
ringParam
p_param
,
real_t
p_value
)
{
void
DampedSpringJoint2DSW
::
set_param
(
PhysicsServer2D
::
DampedS
p
ringParam
p_param
,
real_t
p_value
)
{
switch
(
p_param
)
{
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_REST_LENGTH
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_REST_LENGTH
:
{
rest_length
=
p_value
;
}
break
;
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_DAMPING
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_DAMPING
:
{
damping
=
p_value
;
}
break
;
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_STIFFNESS
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_STIFFNESS
:
{
stiffness
=
p_value
;
}
break
;
}
}
real_t
DampedSpringJoint2DSW
::
get_param
(
PhysicsServer2D
::
DampedS
t
ringParam
p_param
)
const
{
real_t
DampedSpringJoint2DSW
::
get_param
(
PhysicsServer2D
::
DampedS
p
ringParam
p_param
)
const
{
switch
(
p_param
)
{
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_REST_LENGTH
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_REST_LENGTH
:
{
return
rest_length
;
}
break
;
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_DAMPING
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_DAMPING
:
{
return
damping
;
}
break
;
case
PhysicsServer2D
:
:
DAMPED_S
T
RING_STIFFNESS
:
{
case
PhysicsServer2D
:
:
DAMPED_S
P
RING_STIFFNESS
:
{
return
stiffness
;
}
break
;
}
...
...
servers/physics_2d/joints_2d_sw.h
View file @
06a2fb0b
...
...
@@ -151,8 +151,8 @@ public:
virtual
bool
setup
(
real_t
p_step
);
virtual
void
solve
(
real_t
p_step
);
void
set_param
(
PhysicsServer2D
::
DampedS
t
ringParam
p_param
,
real_t
p_value
);
real_t
get_param
(
PhysicsServer2D
::
DampedS
t
ringParam
p_param
)
const
;
void
set_param
(
PhysicsServer2D
::
DampedS
p
ringParam
p_param
,
real_t
p_value
);
real_t
get_param
(
PhysicsServer2D
::
DampedS
p
ringParam
p_param
)
const
;
DampedSpringJoint2DSW
(
const
Vector2
&
p_anchor_a
,
const
Vector2
&
p_anchor_b
,
Body2DSW
*
p_body_a
,
Body2DSW
*
p_body_b
);
~
DampedSpringJoint2DSW
();
...
...
servers/physics_2d/physics_server_2d_sw.cpp
View file @
06a2fb0b
...
...
@@ -1113,7 +1113,7 @@ real_t PhysicsServer2DSW::pin_joint_get_param(RID p_joint, PinJointParam p_param
return
pin_joint
->
get_param
(
p_param
);
}
void
PhysicsServer2DSW
::
damped_s
tring_joint_set_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
,
real_t
p_value
)
{
void
PhysicsServer2DSW
::
damped_s
pring_joint_set_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
,
real_t
p_value
)
{
Joint2DSW
*
j
=
joint_owner
.
getornull
(
p_joint
);
ERR_FAIL_COND
(
!
j
);
ERR_FAIL_COND
(
j
->
get_type
()
!=
JOINT_DAMPED_SPRING
);
...
...
@@ -1122,7 +1122,7 @@ void PhysicsServer2DSW::damped_string_joint_set_param(RID p_joint, DampedStringP
dsj
->
set_param
(
p_param
,
p_value
);
}
real_t
PhysicsServer2DSW
::
damped_s
tring_joint_get_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
)
const
{
real_t
PhysicsServer2DSW
::
damped_s
pring_joint_get_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
)
const
{
Joint2DSW
*
j
=
joint_owner
.
getornull
(
p_joint
);
ERR_FAIL_COND_V
(
!
j
,
0
);
ERR_FAIL_COND_V
(
j
->
get_type
()
!=
JOINT_DAMPED_SPRING
,
0
);
...
...
servers/physics_2d/physics_server_2d_sw.h
View file @
06a2fb0b
...
...
@@ -266,8 +266,8 @@ public:
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_s
tring_joint_set_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
,
real_t
p_value
);
virtual
real_t
damped_s
tring_joint_get_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
)
const
;
virtual
void
damped_s
pring_joint_set_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
,
real_t
p_value
);
virtual
real_t
damped_s
pring_joint_get_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
)
const
;
virtual
JointType
joint_get_type
(
RID
p_joint
)
const
;
...
...
servers/physics_2d/physics_server_2d_wrap_mt.h
View file @
06a2fb0b
...
...
@@ -287,8 +287,8 @@ public:
FUNC3
(
pin_joint_set_param
,
RID
,
PinJointParam
,
real_t
);
FUNC2RC
(
real_t
,
pin_joint_get_param
,
RID
,
PinJointParam
);
FUNC3
(
damped_s
tring_joint_set_param
,
RID
,
DampedSt
ringParam
,
real_t
);
FUNC2RC
(
real_t
,
damped_s
tring_joint_get_param
,
RID
,
DampedSt
ringParam
);
FUNC3
(
damped_s
pring_joint_set_param
,
RID
,
DampedSp
ringParam
,
real_t
);
FUNC2RC
(
real_t
,
damped_s
pring_joint_get_param
,
RID
,
DampedSp
ringParam
);
FUNC1RC
(
JointType
,
joint_get_type
,
RID
);
...
...
servers/physics_server_2d.cpp
View file @
06a2fb0b
...
...
@@ -654,8 +654,8 @@ void PhysicsServer2D::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"groove_joint_create"
,
"groove1_a"
,
"groove2_a"
,
"anchor_b"
,
"body_a"
,
"body_b"
),
&
PhysicsServer2D
::
groove_joint_create
,
DEFVAL
(
RID
()),
DEFVAL
(
RID
()));
ClassDB
::
bind_method
(
D_METHOD
(
"damped_spring_joint_create"
,
"anchor_a"
,
"anchor_b"
,
"body_a"
,
"body_b"
),
&
PhysicsServer2D
::
damped_spring_joint_create
,
DEFVAL
(
RID
()));
ClassDB
::
bind_method
(
D_METHOD
(
"damped_s
tring_joint_set_param"
,
"joint"
,
"param"
,
"value"
),
&
PhysicsServer2D
::
damped_st
ring_joint_set_param
);
ClassDB
::
bind_method
(
D_METHOD
(
"damped_s
tring_joint_get_param"
,
"joint"
,
"param"
),
&
PhysicsServer2D
::
damped_st
ring_joint_get_param
);
ClassDB
::
bind_method
(
D_METHOD
(
"damped_s
pring_joint_set_param"
,
"joint"
,
"param"
,
"value"
),
&
PhysicsServer2D
::
damped_sp
ring_joint_set_param
);
ClassDB
::
bind_method
(
D_METHOD
(
"damped_s
pring_joint_get_param"
,
"joint"
,
"param"
),
&
PhysicsServer2D
::
damped_sp
ring_joint_get_param
);
ClassDB
::
bind_method
(
D_METHOD
(
"joint_get_type"
,
"joint"
),
&
PhysicsServer2D
::
joint_get_type
);
...
...
@@ -727,9 +727,9 @@ void PhysicsServer2D::_bind_methods() {
BIND_ENUM_CONSTANT
(
JOINT_PARAM_MAX_BIAS
);
BIND_ENUM_CONSTANT
(
JOINT_PARAM_MAX_FORCE
);
BIND_ENUM_CONSTANT
(
DAMPED_S
T
RING_REST_LENGTH
);
BIND_ENUM_CONSTANT
(
DAMPED_S
T
RING_STIFFNESS
);
BIND_ENUM_CONSTANT
(
DAMPED_S
T
RING_DAMPING
);
BIND_ENUM_CONSTANT
(
DAMPED_S
P
RING_REST_LENGTH
);
BIND_ENUM_CONSTANT
(
DAMPED_S
P
RING_STIFFNESS
);
BIND_ENUM_CONSTANT
(
DAMPED_S
P
RING_DAMPING
);
BIND_ENUM_CONSTANT
(
CCD_MODE_DISABLED
);
BIND_ENUM_CONSTANT
(
CCD_MODE_CAST_RAY
);
...
...
servers/physics_server_2d.h
View file @
06a2fb0b
...
...
@@ -552,13 +552,13 @@ public:
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
DampedS
t
ringParam
{
DAMPED_S
T
RING_REST_LENGTH
,
DAMPED_S
T
RING_STIFFNESS
,
DAMPED_S
T
RING_DAMPING
enum
DampedS
p
ringParam
{
DAMPED_S
P
RING_REST_LENGTH
,
DAMPED_S
P
RING_STIFFNESS
,
DAMPED_S
P
RING_DAMPING
};
virtual
void
damped_s
tring_joint_set_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
,
real_t
p_value
)
=
0
;
virtual
real_t
damped_s
tring_joint_get_param
(
RID
p_joint
,
DampedSt
ringParam
p_param
)
const
=
0
;
virtual
void
damped_s
pring_joint_set_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
,
real_t
p_value
)
=
0
;
virtual
real_t
damped_s
pring_joint_get_param
(
RID
p_joint
,
DampedSp
ringParam
p_param
)
const
=
0
;
virtual
JointType
joint_get_type
(
RID
p_joint
)
const
=
0
;
...
...
@@ -678,7 +678,7 @@ VARIANT_ENUM_CAST(PhysicsServer2D::BodyState);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
CCDMode
);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
JointParam
);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
JointType
);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
DampedS
t
ringParam
);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
DampedS
p
ringParam
);
//VARIANT_ENUM_CAST( PhysicsServer2D::ObjectType );
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
AreaBodyStatus
);
VARIANT_ENUM_CAST
(
PhysicsServer2D
::
ProcessInfo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment