mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Little Bits
-=-=-=-=-=- -fix duplicate function bug when creating script callback in editor -fix bug where hiding lights does not work -fix 2D audio listener bug (romulox_x reported) -fix exported properties with inheritance bug -fix timer autostart (make it not work on editor) -reactivate first camara found if viewport runs out of active camera -option to hide gizmos in viewport -changed skeleton gizmo because it sucks -Make convex shapes using CollisionShape visible (use quickhull class) -fix up menu when editing a mesh, to export collision, navmesh, convex, etc. from it. -make a menu option to show SRGB in 3D editor views by default -make option to edit default light direction in viewport settings -make option to edit default ambient light in viewport settings -make software conversion of linear->RGB if hardware support not found
This commit is contained in:
parent
37354da5b0
commit
948fd83cdd
30 changed files with 1063 additions and 86 deletions
|
|
@ -219,11 +219,14 @@ void Camera::_notification(int p_what) {
|
|||
|
||||
}
|
||||
|
||||
camera_group = "_vp_cameras"+itos(get_viewport()->get_instance_ID());
|
||||
add_to_group(camera_group);
|
||||
if (viewport_ptr)
|
||||
viewport_ptr->cameras.insert(this);
|
||||
if (current)
|
||||
make_current();
|
||||
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||
|
||||
|
|
@ -241,6 +244,8 @@ void Camera::_notification(int p_what) {
|
|||
if (viewport_ptr)
|
||||
viewport_ptr->cameras.erase(this);
|
||||
viewport_ptr=NULL;
|
||||
remove_from_group(camera_group);
|
||||
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_BECAME_CURRENT: {
|
||||
|
|
@ -314,6 +319,20 @@ void Camera::make_current() {
|
|||
//get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_current",this);
|
||||
}
|
||||
|
||||
|
||||
void Camera::_camera_make_next_current(Node *p_exclude) {
|
||||
|
||||
if (this==p_exclude)
|
||||
return;
|
||||
if (!is_inside_scene())
|
||||
return;
|
||||
if (get_viewport()->get_camera()!=NULL)
|
||||
return;
|
||||
|
||||
make_current();
|
||||
}
|
||||
|
||||
|
||||
void Camera::clear_current() {
|
||||
|
||||
current=false;
|
||||
|
|
@ -321,8 +340,12 @@ void Camera::clear_current() {
|
|||
return;
|
||||
|
||||
if (viewport_ptr) {
|
||||
if (viewport_ptr->get_camera()==this)
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -636,6 +659,7 @@ void Camera::_bind_methods() {
|
|||
ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&Camera::get_environment);
|
||||
ObjectTypeDB::bind_method(_MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode);
|
||||
ObjectTypeDB::bind_method(_MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode);
|
||||
ObjectTypeDB::bind_method(_MD("_camera_make_next_current"),&Camera::_camera_make_next_current);
|
||||
//ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current );
|
||||
|
||||
BIND_CONSTANT( PROJECTION_PERSPECTIVE );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue