{"action":"created","issue":{"url":"https://api.github.com/repos/leezer3/OpenBVE/issues/118","repository_url":"https://api.github.com/repos/leezer3/OpenBVE","labels_url":"https://api.github.com/repos/leezer3/OpenBVE/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/leezer3/OpenBVE/issues/118/comments","events_url":"https://api.github.com/repos/leezer3/OpenBVE/issues/118/events","html_url":"https://github.com/leezer3/OpenBVE/issues/118","id":193292170,"number":118,"title":"Animated object visibility with RotateFunction not updated correctly using free camera","user":{"login":"leezer3","id":7688245,"avatar_url":"https://avatars.githubusercontent.com/u/7688245?v=3","gravatar_id":"","url":"https://api.github.com/users/leezer3","html_url":"https://github.com/leezer3","followers_url":"https://api.github.com/users/leezer3/followers","following_url":"https://api.github.com/users/leezer3/following{/other_user}","gists_url":"https://api.github.com/users/leezer3/gists{/gist_id}","starred_url":"https://api.github.com/users/leezer3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leezer3/subscriptions","organizations_url":"https://api.github.com/users/leezer3/orgs","repos_url":"https://api.github.com/users/leezer3/repos","events_url":"https://api.github.com/users/leezer3/events{/privacy}","received_events_url":"https://api.github.com/users/leezer3/received_events","type":"User","site_admin":false},"labels":[{"id":493769018,"url":"https://api.github.com/repos/leezer3/OpenBVE/labels/Animated%20Objects","name":"Animated Objects","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-03T15:05:54Z","updated_at":"2016-12-05T14:52:27Z","closed_at":null,"body":"**Note:** Bug exists in 1.4.3 also.\r\n\r\nAnimated objects (Not using any distance statements) are not updated correctly when using the free camera.\r\nConsider the following abbreviated routefile code:\r\n```\r\n\t.freeobj(45).Load(TestRoute\\loco.animated)\r\nWith Track\r\n0\r\n\t.Back(1)\r\n\t.Height(0.5)\r\n\t.Sta(Station A; 09.5955; D)\r\n25\r\n\t.Stop(1)\r\n175\r\n\t.Curve(329;750)\r\n200\r\n\t.Freeobj(0;45)\r\n200\r\n\t.Curve(0)\r\n225\r\n\t.Curve(-329)\r\n250\r\n\t.Curve(0)\r\n825\r\n\t.Curve(329)\r\n\t.RailType(0; 2)\r\n850\r\n.Freeobj(0;45)\r\n```\r\n\r\nUsing the default viewing distance of 500m, start the simulation. Our first train placed at 200m will be visible.\r\nSwitch to free camera, and move to ~800m- The object does not appear.\r\n\r\nAnimated file:\r\n```\r\n[Object]\r\nStates=221-0.csv\r\nPosition=0,0,0\r\nRotateYDirection = 0,1,0\r\nRotateYFunction=180*3.14159/180\r\n```\r\n\r\nTests:\r\n* Deleting the RotateYDirection statement does nothing.\r\n* Deleting the RotateYFunction makes the object appear.\r\n* Using an alternative function ( _RotateXFunction_ ) has no effect.\r\n* Routeviewer displays correctly. (IIRC this is using a variant on the track camera)\r\n* Using **_3.14159_** as the RotateYFunction works correctly in current builds, as this is optimized into a static rotation.\r\n* Bug exists with the _Translate_ functions also\r\n"},"comment":{"url":"https://api.github.com/repos/leezer3/OpenBVE/issues/comments/264873628","html_url":"https://github.com/leezer3/OpenBVE/issues/118#issuecomment-264873628","issue_url":"https://api.github.com/repos/leezer3/OpenBVE/issues/118","id":264873628,"user":{"login":"leezer3","id":7688245,"avatar_url":"https://avatars.githubusercontent.com/u/7688245?v=3","gravatar_id":"","url":"https://api.github.com/users/leezer3","html_url":"https://github.com/leezer3","followers_url":"https://api.github.com/users/leezer3/followers","following_url":"https://api.github.com/users/leezer3/following{/other_user}","gists_url":"https://api.github.com/users/leezer3/gists{/gist_id}","starred_url":"https://api.github.com/users/leezer3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leezer3/subscriptions","organizations_url":"https://api.github.com/users/leezer3/orgs","repos_url":"https://api.github.com/users/leezer3/repos","events_url":"https://api.github.com/users/leezer3/events{/privacy}","received_events_url":"https://api.github.com/users/leezer3/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T14:52:27Z","updated_at":"2016-12-05T14:52:27Z","body":"OK, so the bug would appear to be related to the _**ObjectManager.UpdateAnimatedWorldObjects**_ function.\r\n\r\nVisibility is calculated using the _World.CameraTrackFollower.TrackPosition_\r\n\r\nThe viewing distance for an animated object is calculated as a radius of the viewing distance plus **50m** (Why 50m???) from the _World.CameraTrackFollower.TrackPosition_\r\n\r\nNeed to check how the free camera introduces objects, as this clearly doesn't rely on the _World.CameraTrackFollower.TrackPosition_\r\nAlso need to check if there is a reason for doing it this way?\r\nCould potentially break existing routes, if they're using this as an animation trick (YUCK....)"}}
{"actor":{"display_login":"leezer3"}}