mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
SceneMainLoop -> SceneTree
-=-=-=-=-=-=-=-=-=-=-=-=-=- *YOUR SOURCE MIGHT NOT WORK* For mor information on fix: https://github.com/okamstudio/godot/wiki/devel_scene_tree Other stuff: -Shower of bullets demo -Fixes all around
This commit is contained in:
parent
d14baf6e41
commit
0dbedd18fc
168 changed files with 1534 additions and 1310 deletions
|
|
@ -121,7 +121,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const {
|
|||
r_ret= int(keep_aspect);
|
||||
else if (p_name=="current") {
|
||||
|
||||
if (is_inside_scene() && get_scene()->is_editor_hint()) {
|
||||
if (is_inside_tree() && get_tree()->is_editor_hint()) {
|
||||
r_ret=current;
|
||||
} else {
|
||||
r_ret=is_current();
|
||||
|
|
@ -182,7 +182,7 @@ void Camera::_update_camera() {
|
|||
// if (viewport_ptr && is_inside_scene() && is_current())
|
||||
// viewport_ptr->_camera_transform_changed_notify();
|
||||
|
||||
if (is_inside_scene() && is_current()) {
|
||||
if (is_inside_tree() && is_current()) {
|
||||
if (viewport_ptr) {
|
||||
viewport_ptr->_camera_transform_changed_notify();
|
||||
}
|
||||
|
|
@ -309,7 +309,7 @@ void Camera::make_current() {
|
|||
|
||||
current=true;
|
||||
|
||||
if (!is_inside_scene())
|
||||
if (!is_inside_tree())
|
||||
return;
|
||||
|
||||
if (viewport_ptr) {
|
||||
|
|
@ -324,7 +324,7 @@ void Camera::_camera_make_next_current(Node *p_exclude) {
|
|||
|
||||
if (this==p_exclude)
|
||||
return;
|
||||
if (!is_inside_scene())
|
||||
if (!is_inside_tree())
|
||||
return;
|
||||
if (get_viewport()->get_camera()!=NULL)
|
||||
return;
|
||||
|
|
@ -336,14 +336,14 @@ void Camera::_camera_make_next_current(Node *p_exclude) {
|
|||
void Camera::clear_current() {
|
||||
|
||||
current=false;
|
||||
if (!is_inside_scene())
|
||||
if (!is_inside_tree())
|
||||
return;
|
||||
|
||||
if (viewport_ptr) {
|
||||
if (viewport_ptr->get_camera()==this) {
|
||||
viewport_ptr->_set_camera(NULL);
|
||||
//a group is used beause this needs to be in order to be deterministic
|
||||
get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
|
||||
get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -352,7 +352,7 @@ void Camera::clear_current() {
|
|||
|
||||
bool Camera::is_current() const {
|
||||
|
||||
if (is_inside_scene()) {
|
||||
if (is_inside_tree()) {
|
||||
if (viewport_ptr)
|
||||
return viewport_ptr->get_camera()==this;
|
||||
} else
|
||||
|
|
@ -462,9 +462,9 @@ Vector3 Camera::project_ray_normal(const Point2& p_pos) const {
|
|||
|
||||
Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
|
||||
|
||||
if (!is_inside_scene()) {
|
||||
if (!is_inside_tree()) {
|
||||
ERR_EXPLAIN("Camera is not inside scene.");
|
||||
ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
|
||||
ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -496,9 +496,9 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
|
|||
|
||||
Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
|
||||
|
||||
if (!is_inside_scene()) {
|
||||
if (!is_inside_tree()) {
|
||||
ERR_EXPLAIN("Camera is not inside scene.");
|
||||
ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
|
||||
ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
@ -540,9 +540,9 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
|
|||
|
||||
Point2 Camera::unproject_position(const Vector3& p_pos) const {
|
||||
|
||||
if (!is_inside_scene()) {
|
||||
if (!is_inside_tree()) {
|
||||
ERR_EXPLAIN("Camera is not inside scene.");
|
||||
ERR_FAIL_COND_V(!is_inside_scene(),Vector2());
|
||||
ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
|
||||
}
|
||||
|
||||
Size2 viewport_size = viewport_ptr->get_visible_rect().size;
|
||||
|
|
@ -571,9 +571,9 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const {
|
|||
|
||||
Vector3 Camera::project_position(const Point2& p_point) const {
|
||||
|
||||
if (!is_inside_scene()) {
|
||||
if (!is_inside_tree()) {
|
||||
ERR_EXPLAIN("Camera is not inside scene.");
|
||||
ERR_FAIL_COND_V(!is_inside_scene(),Vector3());
|
||||
ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
|
||||
}
|
||||
|
||||
Size2 viewport_size = viewport_ptr->get_visible_rect().size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue