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
a2903fc5
Commit
a2903fc5
authored
Jan 12, 2017
by
Juan Linietsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Must now register with set_transform_notify() to get NOTIFICATION_TRANSFORM_CHANGED
parent
da477b76
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
65 additions
and
7 deletions
+65
-7
grid_map.cpp
modules/gridmap/grid_map.cpp
+1
-0
camera_2d.cpp
scene/2d/camera_2d.cpp
+1
-0
canvas_item.cpp
scene/2d/canvas_item.cpp
+18
-2
canvas_item.h
scene/2d/canvas_item.h
+4
-0
collision_object_2d.cpp
scene/2d/collision_object_2d.cpp
+1
-0
light_2d.cpp
scene/2d/light_2d.cpp
+1
-0
light_occluder_2d.cpp
scene/2d/light_occluder_2d.cpp
+1
-0
navigation_polygon.cpp
scene/2d/navigation_polygon.cpp
+1
-0
remote_transform_2d.cpp
scene/2d/remote_transform_2d.cpp
+1
-1
sound_player_2d.cpp
scene/2d/sound_player_2d.cpp
+1
-1
tile_map.cpp
scene/2d/tile_map.cpp
+1
-0
visibility_notifier_2d.cpp
scene/2d/visibility_notifier_2d.cpp
+1
-0
camera.cpp
scene/3d/camera.cpp
+1
-0
collision_object.cpp
scene/3d/collision_object.cpp
+1
-1
listener.cpp
scene/3d/listener.cpp
+1
-0
navigation_mesh.cpp
scene/3d/navigation_mesh.cpp
+1
-0
physics_joint.cpp
scene/3d/physics_joint.cpp
+1
-0
proximity_group.cpp
scene/3d/proximity_group.cpp
+1
-0
remote_transform.cpp
scene/3d/remote_transform.cpp
+1
-0
room_instance.cpp
scene/3d/room_instance.cpp
+1
-0
spatial.cpp
scene/3d/spatial.cpp
+15
-2
spatial.h
scene/3d/spatial.h
+4
-0
spatial_player.cpp
scene/3d/spatial_player.cpp
+1
-0
visibility_notifier.cpp
scene/3d/visibility_notifier.cpp
+1
-0
visual_instance.cpp
scene/3d/visual_instance.cpp
+1
-0
node.cpp
scene/main/node.cpp
+3
-0
No files found.
modules/gridmap/grid_map.cpp
View file @
a2903fc5
...
...
@@ -1831,6 +1831,7 @@ GridMap::GridMap() {
use_baked_light
=
false
;
navigation
=
NULL
;
set_notify_transform
(
true
);
}
...
...
scene/2d/camera_2d.cpp
View file @
a2903fc5
...
...
@@ -713,5 +713,6 @@ Camera2D::Camera2D() {
v_drag_enabled
=
true
;
h_ofs
=
0
;
v_ofs
=
0
;
set_notify_transform
(
true
);
}
scene/2d/canvas_item.cpp
View file @
a2903fc5
...
...
@@ -769,7 +769,7 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) {
p_node
->
global_invalid
=
true
;
if
(
!
p_node
->
xform_change
.
in_list
())
{
if
(
notify_transform
&&
!
p_node
->
xform_change
.
in_list
())
{
if
(
!
p_node
->
block_transform_notify
)
{
if
(
p_node
->
is_inside_tree
())
get_tree
()
->
xform_change_list
.
add
(
&
p_node
->
xform_change
);
...
...
@@ -997,6 +997,12 @@ void CanvasItem::_bind_methods() {
ClassDB
::
bind_method
(
_MD
(
"set_use_parent_material"
,
"enable"
),
&
CanvasItem
::
set_use_parent_material
);
ClassDB
::
bind_method
(
_MD
(
"get_use_parent_material"
),
&
CanvasItem
::
get_use_parent_material
);
ClassDB
::
bind_method
(
_MD
(
"set_notify_local_transform"
,
"enable"
),
&
CanvasItem
::
set_notify_local_transform
);
ClassDB
::
bind_method
(
_MD
(
"is_local_transform_notification_enabled"
),
&
CanvasItem
::
is_local_transform_notification_enabled
);
ClassDB
::
bind_method
(
_MD
(
"set_notify_transform"
,
"enable"
),
&
CanvasItem
::
set_notify_transform
);
ClassDB
::
bind_method
(
_MD
(
"is_transform_notification_enabled"
),
&
CanvasItem
::
is_transform_notification_enabled
);
ClassDB
::
bind_method
(
_MD
(
"make_canvas_pos_local"
,
"screen_point"
),
&
CanvasItem
::
make_canvas_pos_local
);
ClassDB
::
bind_method
(
_MD
(
"make_input_local"
,
"event"
),
&
CanvasItem
::
make_input_local
);
...
...
@@ -1081,6 +1087,15 @@ bool CanvasItem::is_local_transform_notification_enabled() const {
return
notify_local_transform
;
}
void
CanvasItem
::
set_notify_transform
(
bool
p_enable
)
{
notify_transform
=
p_enable
;
}
bool
CanvasItem
::
is_transform_notification_enabled
()
const
{
return
notify_transform
;
}
int
CanvasItem
::
get_canvas_layer
()
const
{
if
(
canvas_layer
)
...
...
@@ -1118,12 +1133,13 @@ CanvasItem::CanvasItem() : xform_change(this) {
first_draw
=
false
;
drawing
=
false
;
behind
=
false
;
block_transform_notify
=
false
;
block_transform_notify
=
false
;
// viewport=NULL;
canvas_layer
=
NULL
;
use_parent_material
=
false
;
global_invalid
=
true
;
notify_local_transform
=
false
;
notify_transform
=
false
;
light_mask
=
1
;
C
=
NULL
;
...
...
scene/2d/canvas_item.h
View file @
a2903fc5
...
...
@@ -117,6 +117,7 @@ private:
bool
behind
;
bool
use_parent_material
;
bool
notify_local_transform
;
bool
notify_transform
;
Ref
<
CanvasItemMaterial
>
material
;
...
...
@@ -256,6 +257,9 @@ public:
void
set_notify_local_transform
(
bool
p_enable
);
bool
is_local_transform_notification_enabled
()
const
;
void
set_notify_transform
(
bool
p_enable
);
bool
is_transform_notification_enabled
()
const
;
int
get_canvas_layer
()
const
;
CanvasItem
();
...
...
scene/2d/collision_object_2d.cpp
View file @
a2903fc5
...
...
@@ -363,6 +363,7 @@ CollisionObject2D::CollisionObject2D() {
//owner=
set_notify_transform
(
true
);
}
...
...
scene/2d/light_2d.cpp
View file @
a2903fc5
...
...
@@ -482,6 +482,7 @@ Light2D::Light2D() {
shadow_color
=
Color
(
0
,
0
,
0
,
0
);
shadow_filter
=
SHADOW_FILTER_NONE
;
set_notify_transform
(
true
);
}
Light2D
::~
Light2D
()
{
...
...
scene/2d/light_occluder_2d.cpp
View file @
a2903fc5
...
...
@@ -242,6 +242,7 @@ LightOccluder2D::LightOccluder2D() {
occluder
=
VS
::
get_singleton
()
->
canvas_light_occluder_create
();
mask
=
1
;
set_notify_transform
(
true
);
}
LightOccluder2D
::~
LightOccluder2D
()
{
...
...
scene/2d/navigation_polygon.cpp
View file @
a2903fc5
...
...
@@ -497,5 +497,6 @@ NavigationPolygonInstance::NavigationPolygonInstance() {
navigation
=
NULL
;
nav_id
=-
1
;
enabled
=
true
;
set_notify_transform
(
true
);
}
scene/2d/remote_transform_2d.cpp
View file @
a2903fc5
...
...
@@ -127,7 +127,7 @@ void RemoteTransform2D::_bind_methods() {
RemoteTransform2D
::
RemoteTransform2D
()
{
cache
=
0
;
set_notify_transform
(
true
);
}
scene/2d/sound_player_2d.cpp
View file @
a2903fc5
...
...
@@ -116,7 +116,7 @@ SoundPlayer2D::SoundPlayer2D() {
params
[
PARAM_ATTENUATION_MAX_DISTANCE
]
=
2048
;
params
[
PARAM_ATTENUATION_DISTANCE_EXP
]
=
1.0
;
//linear (and not really good)
set_notify_transform
(
true
);
}
SoundPlayer2D
::~
SoundPlayer2D
()
{
...
...
scene/2d/tile_map.cpp
View file @
a2903fc5
...
...
@@ -1321,6 +1321,7 @@ TileMap::TileMap() {
fp_adjust
=
0.00001
;
tile_origin
=
TILE_ORIGIN_TOP_LEFT
;
set_notify_transform
(
true
);
}
TileMap
::~
TileMap
()
{
...
...
scene/2d/visibility_notifier_2d.cpp
View file @
a2903fc5
...
...
@@ -145,6 +145,7 @@ void VisibilityNotifier2D::_bind_methods(){
VisibilityNotifier2D
::
VisibilityNotifier2D
()
{
rect
=
Rect2
(
-
10
,
-
10
,
20
,
20
);
set_notify_transform
(
true
);
}
...
...
scene/3d/camera.cpp
View file @
a2903fc5
...
...
@@ -678,6 +678,7 @@ Camera::Camera() {
h_offset
=
0
;
VisualServer
::
get_singleton
()
->
camera_set_cull_mask
(
camera
,
layers
);
//active=false;
set_notify_transform
(
true
);
}
...
...
scene/3d/collision_object.cpp
View file @
a2903fc5
...
...
@@ -360,7 +360,7 @@ CollisionObject::CollisionObject() {
capture_input_on_drag
=
false
;
ray_pickable
=
true
;
set_notify_transform
(
true
);
//owner=
//set_transform_notify(true);
...
...
scene/3d/listener.cpp
View file @
a2903fc5
...
...
@@ -156,6 +156,7 @@ Listener::Listener() {
current
=
false
;
force_change
=
false
;
set_notify_transform
(
true
);
//active=false;
}
...
...
scene/3d/navigation_mesh.cpp
View file @
a2903fc5
...
...
@@ -410,5 +410,6 @@ NavigationMeshInstance::NavigationMeshInstance() {
navigation
=
NULL
;
nav_id
=-
1
;
enabled
=
true
;
set_notify_transform
(
true
);
}
scene/3d/physics_joint.cpp
View file @
a2903fc5
...
...
@@ -195,6 +195,7 @@ Joint::Joint() {
exclude_from_collision
=
true
;
solver_priority
=
1
;
set_notify_transform
(
true
);
}
...
...
scene/3d/proximity_group.cpp
View file @
a2903fc5
...
...
@@ -190,6 +190,7 @@ ProximityGroup::ProximityGroup() {
dispatch_mode
=
MODE_PROXY
;
grid_radius
=
Vector3
(
1
,
1
,
1
);
set_notify_transform
(
true
);
};
...
...
scene/3d/remote_transform.cpp
View file @
a2903fc5
...
...
@@ -127,6 +127,7 @@ void RemoteTransform::_bind_methods() {
RemoteTransform
::
RemoteTransform
()
{
cache
=
0
;
set_notify_transform
(
true
);
}
scene/3d/room_instance.cpp
View file @
a2903fc5
...
...
@@ -216,6 +216,7 @@ Room::Room() {
level
=
0
;
}
...
...
scene/3d/spatial.cpp
View file @
a2903fc5
...
...
@@ -74,7 +74,7 @@ SpatialGizmo::SpatialGizmo() {
void
Spatial
::
_notify_dirty
()
{
if
(
!
data
.
ignore_notification
&&
!
xform_change
.
in_list
())
{
if
(
data
.
notify_transform
&&
!
data
.
ignore_notification
&&
!
xform_change
.
in_list
())
{
get_tree
()
->
xform_change_list
.
add
(
&
xform_change
);
}
...
...
@@ -108,7 +108,7 @@ void Spatial::_propagate_transform_changed(Spatial *p_origin) {
}
if
(
!
data
.
ignore_notification
&&
!
xform_change
.
in_list
())
{
if
(
data
.
notify_transform
&&
!
data
.
ignore_notification
&&
!
xform_change
.
in_list
())
{
get_tree
()
->
xform_change_list
.
add
(
&
xform_change
);
...
...
@@ -736,6 +736,14 @@ void Spatial::look_at_from_pos(const Vector3& p_pos,const Vector3& p_target, con
}
void
Spatial
::
set_notify_transform
(
bool
p_enable
)
{
data
.
notify_transform
=
p_enable
;
}
bool
Spatial
::
is_transform_notification_enabled
()
const
{
return
data
.
notify_transform
;
}
void
Spatial
::
set_notify_local_transform
(
bool
p_enable
)
{
data
.
notify_local_transform
=
p_enable
;
}
...
...
@@ -791,6 +799,9 @@ void Spatial::_bind_methods() {
ClassDB
::
bind_method
(
_MD
(
"set_notify_local_transform"
,
"enable"
),
&
Spatial
::
set_notify_local_transform
);
ClassDB
::
bind_method
(
_MD
(
"is_local_transform_notification_enabled"
),
&
Spatial
::
is_local_transform_notification_enabled
);
ClassDB
::
bind_method
(
_MD
(
"set_notify_transform"
,
"enable"
),
&
Spatial
::
set_notify_transform
);
ClassDB
::
bind_method
(
_MD
(
"is_transform_notification_enabled"
),
&
Spatial
::
is_transform_notification_enabled
);
void
rotate
(
const
Vector3
&
p_normal
,
float
p_radians
);
void
rotate_x
(
float
p_radians
);
void
rotate_y
(
float
p_radians
);
...
...
@@ -848,11 +859,13 @@ Spatial::Spatial() : xform_change(this)
data
.
viewport
=
NULL
;
data
.
inside_world
=
false
;
data
.
visible
=
true
;
#ifdef TOOLS_ENABLED
data
.
gizmo_disabled
=
false
;
data
.
gizmo_dirty
=
false
;
#endif
data
.
notify_local_transform
=
false
;
data
.
notify_transform
=
false
;
data
.
parent
=
NULL
;
data
.
C
=
NULL
;
...
...
scene/3d/spatial.h
View file @
a2903fc5
...
...
@@ -92,6 +92,7 @@ class Spatial : public Node {
bool
ignore_notification
;
bool
notify_local_transform
;
bool
notify_transform
;
bool
visible
;
...
...
@@ -184,6 +185,9 @@ public:
void
look_at
(
const
Vector3
&
p_target
,
const
Vector3
&
p_up_normal
);
void
look_at_from_pos
(
const
Vector3
&
p_pos
,
const
Vector3
&
p_target
,
const
Vector3
&
p_up_normal
);
void
set_notify_transform
(
bool
p_enable
);
bool
is_transform_notification_enabled
()
const
;
void
set_notify_local_transform
(
bool
p_enable
);
bool
is_local_transform_notification_enabled
()
const
;
...
...
scene/3d/spatial_player.cpp
View file @
a2903fc5
...
...
@@ -125,6 +125,7 @@ SpatialPlayer::SpatialPlayer() {
params
[
PARAM_ATTENUATION_DISTANCE_EXP
]
=
1.0
;
//linear (and not really good)
params
[
PARAM_EMISSION_CONE_DEGREES
]
=
180.0
;
//cone disabled
params
[
PARAM_EMISSION_CONE_ATTENUATION_DB
]
=-
6.0
;
//minus 6 db attenuation
set_notify_transform
(
true
);
}
...
...
scene/3d/visibility_notifier.cpp
View file @
a2903fc5
...
...
@@ -125,6 +125,7 @@ void VisibilityNotifier::_bind_methods(){
VisibilityNotifier
::
VisibilityNotifier
()
{
aabb
=
Rect3
(
Vector3
(
-
1
,
-
1
,
-
1
),
Vector3
(
2
,
2
,
2
));
set_notify_transform
(
true
);
}
...
...
scene/3d/visual_instance.cpp
View file @
a2903fc5
...
...
@@ -162,6 +162,7 @@ VisualInstance::VisualInstance()
instance
=
VisualServer
::
get_singleton
()
->
instance_create
();
VisualServer
::
get_singleton
()
->
instance_attach_object_instance_ID
(
instance
,
get_instance_ID
()
);
layers
=
1
;
set_notify_transform
(
true
);
}
...
...
scene/main/node.cpp
View file @
a2903fc5
...
...
@@ -1384,6 +1384,8 @@ String Node::_generate_serial_child_name(Node *p_child) {
if
(
name
==
""
)
{
name
=
p_child
->
get_class
();
/* this is probably too slow to use here, should check alternatives
*
// Adjust casing according to project setting. The current type name is expected to be in PascalCase.
switch (Globals::get_singleton()->get("node/name_casing").operator int()) {
case NAME_CASING_PASCAL_CASE:
...
...
@@ -1395,6 +1397,7 @@ String Node::_generate_serial_child_name(Node *p_child) {
name = name.camelcase_to_underscore(true);
break;
}
*/
}
// Extract trailing number
...
...
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