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
06265086
Unverified
Commit
06265086
authored
Oct 11, 2019
by
Rémi Verschelde
Committed by
GitHub
Oct 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #32731 from codecustard/fix_concaveshape_not_selecting
Fixes concaveshape not selecting in viewport
parents
aad4d864
29690f6a
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
31 additions
and
26 deletions
+31
-26
spatial_editor_gizmos.cpp
editor/spatial_editor_gizmos.cpp
+1
-0
box_shape.cpp
scene/resources/box_shape.cpp
+1
-1
box_shape.h
scene/resources/box_shape.h
+2
-1
capsule_shape.cpp
scene/resources/capsule_shape.cpp
+1
-1
capsule_shape.h
scene/resources/capsule_shape.h
+2
-2
concave_polygon_shape.cpp
scene/resources/concave_polygon_shape.cpp
+1
-1
concave_polygon_shape.h
scene/resources/concave_polygon_shape.h
+2
-1
convex_polygon_shape.cpp
scene/resources/convex_polygon_shape.cpp
+1
-1
convex_polygon_shape.h
scene/resources/convex_polygon_shape.h
+2
-2
cylinder_shape.cpp
scene/resources/cylinder_shape.cpp
+1
-1
cylinder_shape.h
scene/resources/cylinder_shape.h
+2
-2
height_map_shape.cpp
scene/resources/height_map_shape.cpp
+1
-1
height_map_shape.h
scene/resources/height_map_shape.h
+2
-2
plane_shape.cpp
scene/resources/plane_shape.cpp
+1
-1
plane_shape.h
scene/resources/plane_shape.h
+2
-2
ray_shape.cpp
scene/resources/ray_shape.cpp
+1
-1
ray_shape.h
scene/resources/ray_shape.h
+2
-1
shape.cpp
scene/resources/shape.cpp
+2
-2
shape.h
scene/resources/shape.h
+1
-1
sphere_shape.cpp
scene/resources/sphere_shape.cpp
+1
-1
sphere_shape.h
scene/resources/sphere_shape.h
+2
-1
No files found.
editor/spatial_editor_gizmos.cpp
View file @
06265086
...
...
@@ -3730,6 +3730,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
Ref
<
ConcavePolygonShape
>
cs2
=
s
;
Ref
<
ArrayMesh
>
mesh
=
cs2
->
get_debug_mesh
();
p_gizmo
->
add_mesh
(
mesh
,
false
,
Ref
<
SkinReference
>
(),
material
);
p_gizmo
->
add_collision_segments
(
cs2
->
get_debug_mesh_lines
());
}
if
(
Object
::
cast_to
<
RayShape
>
(
*
s
))
{
...
...
scene/resources/box_shape.cpp
View file @
06265086
...
...
@@ -31,7 +31,7 @@
#include "box_shape.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
BoxShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
BoxShape
::
get
_debug_mesh_lines
()
{
Vector
<
Vector3
>
lines
;
AABB
aabb
;
...
...
scene/resources/box_shape.h
View file @
06265086
...
...
@@ -42,12 +42,13 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_extents
(
const
Vector3
&
p_extents
);
Vector3
get_extents
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
BoxShape
();
};
...
...
scene/resources/capsule_shape.cpp
View file @
06265086
...
...
@@ -31,7 +31,7 @@
#include "capsule_shape.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
CapsuleShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
CapsuleShape
::
get
_debug_mesh_lines
()
{
float
radius
=
get_radius
();
float
height
=
get_height
();
...
...
scene/resources/capsule_shape.h
View file @
06265086
...
...
@@ -44,14 +44,14 @@ protected:
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_radius
(
float
p_radius
);
float
get_radius
()
const
;
void
set_height
(
float
p_height
);
float
get_height
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
CapsuleShape
();
};
...
...
scene/resources/concave_polygon_shape.cpp
View file @
06265086
...
...
@@ -32,7 +32,7 @@
#include "servers/physics_server.h"
Vector
<
Vector3
>
ConcavePolygonShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
ConcavePolygonShape
::
get
_debug_mesh_lines
()
{
Set
<
DrawEdge
>
edges
;
...
...
scene/resources/concave_polygon_shape.h
View file @
06265086
...
...
@@ -61,12 +61,13 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_faces
(
const
PoolVector
<
Vector3
>
&
p_faces
);
PoolVector
<
Vector3
>
get_faces
()
const
;
Vector
<
Vector3
>
get_debug_mesh_lines
();
ConcavePolygonShape
();
};
...
...
scene/resources/convex_polygon_shape.cpp
View file @
06265086
...
...
@@ -32,7 +32,7 @@
#include "core/math/quick_hull.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
ConvexPolygonShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
ConvexPolygonShape
::
get
_debug_mesh_lines
()
{
PoolVector
<
Vector3
>
points
=
get_points
();
...
...
scene/resources/convex_polygon_shape.h
View file @
06265086
...
...
@@ -43,12 +43,12 @@ protected:
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_points
(
const
PoolVector
<
Vector3
>
&
p_points
);
PoolVector
<
Vector3
>
get_points
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
ConvexPolygonShape
();
};
...
...
scene/resources/cylinder_shape.cpp
View file @
06265086
...
...
@@ -31,7 +31,7 @@
#include "cylinder_shape.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
CylinderShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
CylinderShape
::
get
_debug_mesh_lines
()
{
float
radius
=
get_radius
();
float
height
=
get_height
();
...
...
scene/resources/cylinder_shape.h
View file @
06265086
...
...
@@ -43,14 +43,14 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_radius
(
float
p_radius
);
float
get_radius
()
const
;
void
set_height
(
float
p_height
);
float
get_height
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
CylinderShape
();
};
...
...
scene/resources/height_map_shape.cpp
View file @
06265086
...
...
@@ -31,7 +31,7 @@
#include "height_map_shape.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
HeightMapShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
HeightMapShape
::
get
_debug_mesh_lines
()
{
Vector
<
Vector3
>
points
;
if
((
map_width
!=
0
)
&&
(
map_depth
!=
0
))
{
...
...
scene/resources/height_map_shape.h
View file @
06265086
...
...
@@ -46,8 +46,6 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_map_width
(
int
p_new
);
int
get_map_width
()
const
;
...
...
@@ -56,6 +54,8 @@ public:
void
set_map_data
(
PoolRealArray
p_new
);
PoolRealArray
get_map_data
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
HeightMapShape
();
};
...
...
scene/resources/plane_shape.cpp
View file @
06265086
...
...
@@ -32,7 +32,7 @@
#include "servers/physics_server.h"
Vector
<
Vector3
>
PlaneShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
PlaneShape
::
get
_debug_mesh_lines
()
{
Plane
p
=
get_plane
();
Vector
<
Vector3
>
points
;
...
...
scene/resources/plane_shape.h
View file @
06265086
...
...
@@ -42,12 +42,12 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_plane
(
Plane
p_plane
);
Plane
get_plane
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
PlaneShape
();
};
#endif // PLANE_SHAPE_H
scene/resources/ray_shape.cpp
View file @
06265086
...
...
@@ -32,7 +32,7 @@
#include "servers/physics_server.h"
Vector
<
Vector3
>
RayShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
RayShape
::
get
_debug_mesh_lines
()
{
Vector
<
Vector3
>
points
;
points
.
push_back
(
Vector3
());
...
...
scene/resources/ray_shape.h
View file @
06265086
...
...
@@ -41,7 +41,6 @@ class RayShape : public Shape {
protected
:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_length
(
float
p_length
);
...
...
@@ -50,6 +49,8 @@ public:
void
set_slips_on_slope
(
bool
p_active
);
bool
get_slips_on_slope
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
RayShape
();
};
#endif // RAY_SHAPE_H
scene/resources/shape.cpp
View file @
06265086
...
...
@@ -37,7 +37,7 @@
void
Shape
::
add_vertices_to_array
(
PoolVector
<
Vector3
>
&
array
,
const
Transform
&
p_xform
)
{
Vector
<
Vector3
>
toadd
=
_gen
_debug_mesh_lines
();
Vector
<
Vector3
>
toadd
=
get
_debug_mesh_lines
();
if
(
toadd
.
size
())
{
...
...
@@ -64,7 +64,7 @@ Ref<ArrayMesh> Shape::get_debug_mesh() {
if
(
debug_mesh_cache
.
is_valid
())
return
debug_mesh_cache
;
Vector
<
Vector3
>
lines
=
_gen
_debug_mesh_lines
();
Vector
<
Vector3
>
lines
=
get
_debug_mesh_lines
();
debug_mesh_cache
=
Ref
<
ArrayMesh
>
(
memnew
(
ArrayMesh
));
...
...
scene/resources/shape.h
View file @
06265086
...
...
@@ -50,13 +50,13 @@ protected:
_FORCE_INLINE_
RID
get_shape
()
const
{
return
shape
;
}
Shape
(
RID
p_shape
);
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
()
=
0
;
// { return Vector<Vector3>(); }
virtual
void
_update_shape
();
public
:
virtual
RID
get_rid
()
const
{
return
shape
;
}
Ref
<
ArrayMesh
>
get_debug_mesh
();
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
()
=
0
;
// { return Vector<Vector3>(); }
void
add_vertices_to_array
(
PoolVector
<
Vector3
>
&
array
,
const
Transform
&
p_xform
);
...
...
scene/resources/sphere_shape.cpp
View file @
06265086
...
...
@@ -31,7 +31,7 @@
#include "sphere_shape.h"
#include "servers/physics_server.h"
Vector
<
Vector3
>
SphereShape
::
_gen
_debug_mesh_lines
()
{
Vector
<
Vector3
>
SphereShape
::
get
_debug_mesh_lines
()
{
float
r
=
get_radius
();
...
...
scene/resources/sphere_shape.h
View file @
06265086
...
...
@@ -42,12 +42,13 @@ protected:
static
void
_bind_methods
();
virtual
void
_update_shape
();
virtual
Vector
<
Vector3
>
_gen_debug_mesh_lines
();
public
:
void
set_radius
(
float
p_radius
);
float
get_radius
()
const
;
virtual
Vector
<
Vector3
>
get_debug_mesh_lines
();
SphereShape
();
};
...
...
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