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
7c2794b3
Commit
7c2794b3
authored
May 19, 2020
by
Andrea Catania
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed kinematic body axis lock
parent
dee8f8db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
physics_body_3d.cpp
scene/3d/physics_body_3d.cpp
+9
-3
No files found.
scene/3d/physics_body_3d.cpp
View file @
7c2794b3
...
@@ -1135,6 +1135,11 @@ bool KinematicBody3D::separate_raycast_shapes(bool p_infinite_inertia, Collision
...
@@ -1135,6 +1135,11 @@ bool KinematicBody3D::separate_raycast_shapes(bool p_infinite_inertia, Collision
}
}
void
KinematicBody3D
::
set_axis_lock
(
PhysicsServer3D
::
BodyAxis
p_axis
,
bool
p_lock
)
{
void
KinematicBody3D
::
set_axis_lock
(
PhysicsServer3D
::
BodyAxis
p_axis
,
bool
p_lock
)
{
if
(
p_lock
)
{
locked_axis
|=
p_axis
;
}
else
{
locked_axis
&=
(
~
p_axis
);
}
PhysicsServer3D
::
get_singleton
()
->
body_set_axis_lock
(
get_rid
(),
p_axis
,
p_lock
);
PhysicsServer3D
::
get_singleton
()
->
body_set_axis_lock
(
get_rid
(),
p_axis
,
p_lock
);
}
}
...
@@ -1211,9 +1216,10 @@ void KinematicBody3D::_bind_methods() {
...
@@ -1211,9 +1216,10 @@ void KinematicBody3D::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_slide_count"
),
&
KinematicBody3D
::
get_slide_count
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_slide_count"
),
&
KinematicBody3D
::
get_slide_count
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_slide_collision"
,
"slide_idx"
),
&
KinematicBody3D
::
_get_slide_collision
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_slide_collision"
,
"slide_idx"
),
&
KinematicBody3D
::
_get_slide_collision
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"move_lock_x"
,
PROPERTY_HINT_NONE
,
""
,
PROPERTY_USAGE_NOEDITOR
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_X
);
ADD_GROUP
(
"Axis Lock"
,
"axis_lock_"
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"move_lock_y"
,
PROPERTY_HINT_NONE
,
""
,
PROPERTY_USAGE_NOEDITOR
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_Y
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"axis_lock_motion_x"
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_X
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"move_lock_z"
,
PROPERTY_HINT_NONE
,
""
,
PROPERTY_USAGE_NOEDITOR
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_Z
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"axis_lock_motion_y"
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_Y
);
ADD_PROPERTYI
(
PropertyInfo
(
Variant
::
BOOL
,
"axis_lock_motion_z"
),
"set_axis_lock"
,
"get_axis_lock"
,
PhysicsServer3D
::
BODY_AXIS_LINEAR_Z
);
ADD_PROPERTY
(
PropertyInfo
(
Variant
::
FLOAT
,
"collision/safe_margin"
,
PROPERTY_HINT_RANGE
,
"0.001,256,0.001"
),
"set_safe_margin"
,
"get_safe_margin"
);
ADD_PROPERTY
(
PropertyInfo
(
Variant
::
FLOAT
,
"collision/safe_margin"
,
PROPERTY_HINT_RANGE
,
"0.001,256,0.001"
),
"set_safe_margin"
,
"get_safe_margin"
);
}
}
...
...
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