Commit Graph

188 Commits (master)

Author SHA1 Message Date
Webster Sheets aeb5d906bb Fix GasGiant clipping, fix bright spots on models 2021-03-26 22:42:06 -04:00
Karl F 9e44b09314 Happy new year!
HAPPY MERRY 2021!
2021-01-03 19:40:16 +01:00
Webster Sheets 37c96041e1
Refactor Body inheritance tree to remove Object and CityOnPlanet (#4995)
* Remove CityOnPlanet from Object hierarchy

* Remove Object from the inheritance hierarchy

* Rename Object -> ObjectType
2020-11-11 19:33:04 -05:00
Webster Sheets a51ee57a09 Refactor view control API
- Rename InteractionController->ViewController
- Use Body's flag mechanism to exclude bodies from drawing
- Pave the way for non-ShipView ViewControllers via SetViewController()
2020-09-07 22:17:41 +01:00
Webster Sheets e83dd6c887 Matrix state must(did!) die
Remove all OpenGL 2.x like methods from the renderer API, now the matrix state
is the responsibility of the caller via MatrixTicket / StateTicket.

Still TODO is improving the viewport state tracking, although that should be
rather simple to fix.
2020-09-07 15:31:15 -04:00
Webster Sheets b71787c942 Major changes to WorldView screen functions
- Body::GetTargetIndicatorPosition now returns local-space coordinates
- CameraContext has a getter for parent frame, renamed GetCamFrame to GetTempFrame, added GetCameraOrient/Position
- Implemented matrix4x4 utilities to construct from orient+pos, fast inverse transform for position vectors
- Fixed bug where mouse would be locked if held while docking
- Preliminary work on ShipViewController, made WorldView::shipView an unique_ptr (why didn't I do it that way in the first place?)
- Cleaned up some cruft from WorldView and moved to appropriate locations
- Completely changed the way WorldSpaceToScreenSpace etc. works, now no longer requires camera frame
- Added WorldView::RelSpaceToScreenSpace, meant for pigui to use for displaying e.g. body:GetPositionRelTo(player)
- WorldSpaceToScreenSpace now operates on frame-relative coordinates, use RelSpaceToScreenSpace for player-relative coordinates
2020-08-02 17:35:09 -04:00
Karl F 436db08636 Happy new decade!
May you live long and prosper!
2020-01-01 10:47:46 +01:00
Webster Sheets 2e8376523e Promote FrameId to wrapper and fix crash, remove unused test (#4745)
* Make FrameId a wrapper over an int, fix crashes

- Cleanup some of the tests, use <cstddef>.
- Fixed a crash in Frame::DeleteCameraFrame()
- Made CameraContext::GetCamFrame() return the invalid frame index when there
  is no camera frame
- Fixed a typo related to autosave
2019-11-26 09:26:59 +01:00
mike-f1 bcb249c075 Use a vector to store Frames, provide move ctor and assignement;
Use a dedicated CreateCameraFrame/DeleteCameraFrame for Camera;
Avoid ShipCockpit trying use a CollisionSpace;
Avoid some bugs during creation/deletion of Space;
Remove obsolete code from Pi.cpp;
UpdateOrbitRails is made 'static' and applied on all Frames;
CollideFrame is now part of Frame and applied on all Frames;
CollisionSpace is stored contiguosly and called directly
2019-11-16 17:54:14 +01:00
mike-f1 4f1eaa41d3 Update all files to store and use FrameId instead of raw pointers 2019-11-16 17:54:14 +01:00
mike-f1 5ae777d862 Rework a little Frame class (use factory methods; improve ctors) 2019-11-16 17:54:14 +01:00
mike-f1 e6403fc1ad Decouple includes; Remove some unused variable; Fix an equation in Space.cpp 2019-10-20 11:19:45 +02:00
mike-f1 50aa4bd913 Add namespaces names and reorder some includes 2019-01-22 22:05:08 +01:00
mike-f1 bcb31c6e28 Clean includes in Body 2019-01-22 20:08:25 +01:00
mike-f1 b4f6547c1f Clean includes in Camera; avoid direct usage of Player 2019-01-22 20:08:25 +01:00
Webster Sheets 5cdaefad6a Run clang-format over the entire code base.
Fix hidden header-inclusion-order dependency errors.
Update .clang-format for v7.0.1.
2019-01-05 17:09:05 -05:00
Karl F d2ab921b62 Happy New Year!
Awesome sauce (for next year):
find . -type f -exec sed -i 's/2008-2018 Pioneer Developers'/'2008-2019 Pioneer Developers/g' {} \;

closes #4507
2019-01-03 15:28:42 +01:00
Andrew Copland 68d83385d1 Use the billboard shader and the onscreen pixel size for it. 2018-06-26 22:01:54 +01:00
Karl F 7225e9c723 Happy New Year!
Ten years in the making now, but how can we improve upon perfection
for ten more years?
2018-01-01 21:22:12 +01:00
Andrew Copland 8cb1555f67 Eliminate the evil trailing whitespace 2017-03-05 13:15:55 +00:00
Andrew Copland 74d50958fe MERRY HAPPY 2017 2017-01-04 15:11:15 +00:00
Andrew Copland aa5994162d planet_billboard pre-converted to dds 2016-12-01 19:52:53 +00:00
John Jordan 22c80a015c Use interpolated coords in camera code, fixes rendering jitter and frame transition glitches for stations and small planets 2016-11-19 00:13:01 +00:00
Andrew Copland e510b239c1 Construct a temporary light object to pass as a parameter for gcc 2016-09-24 10:20:04 +01:00
Andrew Copland df6a61205c Remove the occultedLight parameter and fixup the std::min casting issues 2016-06-18 12:19:31 +01:00
Andrew Copland a02e33b884 Rewrite Sfx to split into manager and instances. 2016-05-10 14:52:46 +01:00
Andrew Copland fea5ac26b2 MERRY HAPPY 2016 2016-01-29 11:31:54 +00:00
Andrew Copland d5570df283 Added ability to set color from Hex (32-bit int) value. Sets RGBA.
Removed ability to set Color4ub from single Uint8.
2015-11-22 19:02:20 +00:00
Andrew Copland a0bf43fe07 Force a minimum size for the billboard standins 2015-07-22 20:43:51 +01:00
Andrew Copland 1b7d68b49b Warnings fix and cleanup 2015-07-22 20:34:48 +01:00
Andrew Copland d33edd6c40 Render planets that are far away, but using billboards instead of just, stopping. 2015-07-22 20:25:27 +01:00
Robert Norris 9f95339a9d MERRY HAPPY 2014-12-31 23:05:37 +11:00
Andrew Copland 9d623f6bc8 Change the Star Color structures to use Color instead of Uint8 2014-12-28 16:44:43 +00:00
Andrew Copland 7d09909e4b Implement zugz suggestion of multiplying the angle, renamed intensity, by the ShadowedIntensity. Much nicer result. 2014-09-09 14:44:08 +01:00
Andrew Copland 6fa9d2f286 Not convinced this is correct yet but ok for first pass. 2014-09-09 09:38:16 +01:00
Andrew Copland 2d79452db0 Changed calculation so that it uses either the angle or the eclipsed intensity to set the bgIntensity. 2014-09-08 12:38:28 +01:00
Andrew Copland 9513f7f188 Clamp the intensity to safe range. 2014-09-07 21:32:19 +01:00
Andrew Copland 29f383625a Account for eclipse in the bgIntensity calculation. 2014-07-30 23:17:17 +01:00
Andrew Copland e9d9ceefa6 Implement most of the warning & performance points from my annual CppCheck run.
Most of these are functionally equivalent but are slightly more optimal, most are just a recommended way of doing things.
2014-04-16 18:09:40 +01:00
John Bartholomew 0a1fdcc585 reduce system-body billboard size threshold to 8 pixels (diameter) 2014-03-24 19:58:17 +00:00
John Bartholomew c82ed25cf6 use body 'albedo' colour rather than atmosphere colour for its billboard 2014-03-24 19:54:59 +00:00
John Bartholomew b084066c8a directly use the explicit vector3d->vector3f conversion 2014-03-24 19:54:59 +00:00
John Bartholomew 0bd1a071cf take FOV into account when determining screen size of planets/stars 2014-03-24 19:54:59 +00:00
lwho 47685c1c9a Make static data tables in StarSystem const. 2014-02-24 18:32:46 +01:00
lwho b88d4c9e7c Switch access to Frame::m_children to IterationProxy interface. 2014-02-22 17:54:57 +01:00
lwho 7cfcd02478 Switch access to Space::m_bodies to IterationProxy interface. 2014-02-22 17:43:11 +01:00
lwho b32021bd7c Make SystemBody attributes private. 2014-02-20 22:40:31 +01:00
lwho 5dfc8a593b Give all non-static members of SystemBody an m_ prefix. 2014-02-20 20:05:57 +01:00
Robert Norris 327bfe3f76 draw billboards for distant terrain objects instead of spikes 2014-02-03 09:37:46 +11:00
Robert Norris 934181ae20 lift draw transform setup up to the context 2014-02-03 09:37:46 +11:00