Commit Graph
100 Commits
Author SHA1 Message Date
Thomas Geymayer c96d7ae226 Use simulation time for spin and timed animations 2013-05-10 01:11:46 +02:00
Thomas Geymayer 9535aef59b Extend SGPickCallback to allow passing more information to callbacks 2013-05-09 21:31:27 +02:00
Thomas Geymayer 82f6fca06f Add (optional) uv coordinates to SGPickCallback 2013-05-09 12:40:59 +02:00
Thomas Geymayer 627b36a53b Prevent timer endless loops 2013-05-06 23:26:45 +02:00
Thomas Geymayer 2af78a3874 Allow adding a contition to locked-track animation 2013-05-02 00:47:51 +02:00
Thomas Geymayer 0fa23b83e6 Extend locked-track animation to support a slave element.
This allows tracking elements while at the same time changing the
rotation of both animated elements to fill the available distance
to the target element. This allows for example animating gear
scissors or other connected objects like gear doors and their
actuators/arms (possibly connected to the gear strut).
2013-04-28 23:46:25 +02:00
Thomas Geymayer e53c71543a Move and rework pow to math/SGMisc 2013-04-28 15:43:02 +02:00
Thomas Geymayer fa64f7b6aa Work around MSVC linker bug with classes derived from i/ofstream 2013-04-27 23:44:32 +02:00
Thomas Geymayer eaac3a64f8 Fix linker error for test 2013-04-26 23:48:25 +02:00
Thomas Geymayer 4eabc45dfc Fix animation tests for low precision floating point 2013-04-26 00:19:00 +02:00
Thomas Geymayer 5c5e2a0f2f Remove debug output (and shorten test names) 2013-04-26 00:13:35 +02:00
Thomas Geymayer 559a5d146a Add trackTo (locked-track) animation 2013-04-25 23:23:16 +02:00
Thomas Geymayer 1f43132363 Canvas: rework style setter system.
Style setters are now only setup once for each element type and
not for each element instance as before. A static map holds the
setters for each element type. Also an animation type is stored
which will later allow to animate properties of Canvas elements
without specifying and animation type.
2013-04-20 00:22:37 +02:00
Thomas Geymayer 17369a20de CanvaImage: Enable texture repeat for images 2013-04-15 21:09:41 +02:00
Thomas Geymayer c83dae4c70 Comparison operators for SGSharedPtr 2013-04-13 16:21:04 +02:00
Thomas Geymayer 3da44d1215 Nasal: add naVec_removelast. (Thanks to Philosopher) 2013-04-12 12:32:03 +02:00
Thomas Geymayer 198c5d23fd nasal::Ghost tweaking to allow using with osg::oberser_ptr. 2013-04-01 13:35:41 +02:00
Thomas Geymayer c41caeaf64 Ensure every scenery model has own SGModelData.
This makes Nasal unload hooks of scenery objects working again.
Previously the same SGModelData instance was used for all objects
which never got destroyed and therefore was not able to call any
unload callback.
2013-04-01 13:22:28 +02:00
Thomas Geymayer b6c542b0e7 nasal::Ghost tweaking and to_nasal_helper for SGGeod. 2013-03-23 12:47:06 +01:00
Thomas Geymayer 2d62275a08 Fix uninitialized member.
Thanks to Chris for the catch.
2013-03-20 23:44:26 +01:00
Thomas Geymayer 971ea81861 cppbind: add from_nasal_helper to convert Nasal ghosts to C++ shared pointer 2013-03-19 18:36:55 +01:00
Thomas Geymayer 9e9cc7859c Interpolation system tweaking and add helpers to SGPropertyNode to interpolate its value 2013-03-17 23:48:01 +01:00
Thomas Geymayer 8898f5fe52 Tweak interpolator and allow passing list of interpolation steps 2013-03-16 16:36:20 +01:00
Thomas Geymayer 40be69ae8e Remove unecessary dependency from libSimGearCore on libSimGearScene. 2013-03-16 12:19:23 +01:00
Thomas Geymayer 17eec81071 Fix headless build 2013-03-16 10:35:30 +01:00
Thomas Geymayer c9bbbd18ec New interpolation/animation system.
Inspired by jQuery.animate() properties can be interpolated using
different easing functions and specifying an animation duration.
Additionally animations can be chained to get table-based
animations like with the current SGInterpolator, or also create
looped animations or other more complicated curves.

Currently this system is not used yet, but it is intended to
replace SGInterpolator and allow more advanced animations of
eg. also colors, for example, for the canvas.
2013-03-15 23:37:17 +01:00
Thomas Geymayer e08eda18d5 CMake: Create list of libs for testing only once 2013-03-15 23:21:38 +01:00
Thomas Geymayer 0a1e920659 Ensure canvas is updated before displaying image containing a canvas 2013-03-11 21:22:43 +01:00
Thomas Geymayer 0dcb64dca3 slider - fix shifted check while dragging 2013-03-10 23:10:26 +01:00
Thomas Geymayer 79ae0da927 Fix some warnings 2013-03-07 00:17:45 +01:00
Thomas Geymayer e179bda57a add static_pointer_cast for SGSharedPtr 2013-03-06 23:17:02 +01:00
Thomas Geymayer 8e0c15e32e cppbind: allow adding free functions accepting nasal::CallContext and do some cleanup 2013-03-06 17:00:38 +01:00
Thomas Geymayer ff844f6760 May MSVC likes this more... 2013-03-05 18:12:17 +01:00
Thomas Geymayer bc96ac85f4 cppbind: Add some methods to nasal::CallContext 2013-03-05 17:27:49 +01:00
Thomas Geymayer 2db8859076 cppbind: Tweak from_nasal error reporting 2013-03-04 23:15:13 +01:00
Thomas Geymayer 6eff167a28 Silence MSVC 2013-03-04 18:42:32 +01:00
Thomas Geymayer 9fecb69b84 cppbind: tweaking from_nasal/to_nasal. 2013-03-04 16:26:28 +01:00
Thomas Geymayer 0539aa38e5 cppbind: faster from_nasal for bool and fix VS warning. 2013-03-04 00:30:30 +01:00
Thomas Geymayer ceae2928aa cppbind: refactor to_nasal for better name lookup.
Using template parameter dependent name lookup it is
now possible to create to_nasal_helper overloads
for custom types and having them used for automatic
type conversion with binding methods/member on
nasal::Ghost objects.
2013-03-03 23:42:40 +01:00
Thomas Geymayer a2e7c92f99 cppbind: Allow getter without from_nasal defined and setter without to_nasal. 2013-03-03 20:55:57 +01:00
Thomas Geymayer 643a8717b4 Make old gcc happy 2013-03-03 20:16:21 +01:00
Thomas Geymayer f21127fd4a cppbind: rework to allow binding nearly everything.
It is now possible to register all types of member function
and free functions as methods for nasal::Ghost objects.
The return value and arguments are converte automatically
to the required types.

Also usage is simplified by removing replacing the old
method and method_func with a single method function
which only needs a name for the method and something
callable.
2013-03-03 19:28:39 +01:00
Thomas Geymayer c414242f13 sg_netChat: let getTerminator return const char* for compatiblity with FlightGear 2013-03-03 01:19:35 +01:00
Thomas Geymayer 33e60725b1 sg_netChat: Use std::string to prevent crash with old strdup.
Thanks to Godspeed for noticing this code crashing with MSVC.
Using std::string should fix this.
2013-03-03 01:12:01 +01:00
Thomas Geymayer 530de4d809 cppbind: Prepare for improved bindings.
- Improved Nasal/C++ bindings will follow. For now just test if
   all compilers are happy with intended approach.
 - Add to_nasal overload for std::map<std::string, T>.
2013-03-02 00:13:48 +01:00
Thomas Geymayer 5e45bdeeda Add optional user_data to Nasal C functions.
A user_data pointer and another pointer to an optional
deleter function is stored in unused parts of the naPtr
union. The previous behavior of extension functions does
not change. Only one additional boolean comparison is
required upon each function call to check whether user
data is available.
2013-03-01 12:22:51 +01:00
Thomas Geymayer 081eba903f Visual Studio fix 2013-03-01 00:33:47 +01:00
Thomas Geymayer 0def045611 cppbind: Fix SGPath from_nasal_helper 2013-02-28 23:46:55 +01:00
Thomas Geymayer e20cc6a90f Nasal cppbind: support more member function types 2013-02-28 23:43:42 +01:00
Thomas Geymayer 7dd83dd2d1 Fix boolean conversion 2013-02-28 22:23:30 +01:00
Thomas Geymayer 1240807b9f ODGauge/Canvas: add option "additive-blend" to use additive alpha blending 2013-02-28 22:04:16 +01:00
Thomas Geymayer e1302bcf17 CanvasImage: Fix border abs/rel calculations; add slice-width property 2013-02-28 01:09:27 +01:00
Thomas Geymayer cfdc7db79a sgstream_test needs linking with zlib 2013-02-26 12:53:56 +01:00
Thomas Geymayer 50de873453 Canvas: ensure z-index is updated on adding new child. 2013-02-26 12:49:04 +01:00
Thomas Geymayer 328e6b3e28 Update bounding box if calling update() on canvas elements 2013-02-24 20:44:02 +01:00
Thomas Geymayer 5441db9b18 Support image slice/scale-9 for CanvasImage. 2013-02-24 17:57:19 +01:00
Thomas Geymayer 06bfa4f1a1 Fix package management compiling with linux 2013-02-21 14:03:08 +01:00
Thomas Geymayer 1784327c47 CanvasImage: Use image/canvas size rather than texture size 2013-02-15 12:32:31 +01:00
Thomas Geymayer a63ec83d5f CanvasImage: Use normalized coordinates by default.
Using absolute sizes by default lead to problems,
as while creating the image the size of the later
texture is not available.
2013-02-14 17:32:19 +01:00
Thomas Geymayer d661516b02 Expose whether CanvasElement is visible 2013-02-13 12:09:15 +01:00
Thomas Geymayer 632abdd87b Fix CanvasText horizontal alignment.
Don't reduce width of bounding box below character width
even if outline of rendered character is smaller. This
prevents trailing spaces from being ignored and also
fixes continuously chaging alignment (especially with
monospace fonts).
2013-02-09 12:17:45 +01:00
Thomas Geymayer 979aea5212 Add SGMisc::seek helper 2013-02-08 12:12:15 +01:00
Thomas Geymayer 4bef2c48eb Remove debug output 2013-02-07 10:10:38 +01:00
Thomas Geymayer 21e2a769eb Fix PropertyObject bug and interface improvements.
- Fix overwriting of parent node if PropertyObject::node() is
   called for a non-existing node.
 - Prevent implicit conversion from const char* and
   SGPropertyNode*
2013-02-07 01:25:55 +01:00
Thomas Geymayer 5dea221ad5 Expose reloading Canvas placements 2013-02-06 01:19:24 +01:00
Thomas Geymayer e7f9486aa1 Nasal String wrapper and allow adding methods to string objects.
- Add nasal::String for wrapping Nasal string data and accessing
   string methods (which eg. could be exposed to Nasal)
 - Allow adding functions from C/C++ which are callable on
   Nasal strings.
2013-01-31 19:07:33 +01:00
Thomas Geymayer 47b02c0480 Missing include 2013-01-22 19:20:41 +01:00
Thomas Geymayer ea8023e51f Canvas: Provide sane default bounding box (For Image & Text) 2013-01-09 12:11:19 +01:00
Thomas Geymayer 8a9693a28e Fix canvas mouse intersection test
Bounding box of drawables use other coordinate frame
then bounding sphere of MatrixTransform...
2013-01-05 00:44:19 +01:00
Thomas Geymayer 724fba4af9 canvas::Element: parse full 3x3 matrix
This doesn't change any existing behaviour but allows specifying
full 3x3 matrix to eg. perform a perspective transform needed
for some HUDs.
2013-01-01 14:18:39 +01:00
Thomas Geymayer beca1cbf96 Allow nasal::Ghost to only wrap classes by their shared pointers
This removes support for exposing and managing classes by just
raw pointers as this made lifetime management of instances
from C++ to Nasal and especially the other way round nearly
impossible. Always using smart pointers saves us from a lot
of headaches.
2012-12-29 17:49:22 +01:00
Thomas Geymayer 0423aedffc Revert to old way of including everything from SGMath.hxx 2012-12-23 01:30:41 +01:00
Thomas Geymayer bc3dd06b26 Missing file... 2012-12-17 10:53:52 +01:00
Thomas Geymayer fd39808ed8 Nasal cppbindings: automatic conversion of vec2 to/from Nasal 2012-12-17 00:29:14 +01:00
Thomas Geymayer a1b7cb5330 Fix memory leak if nasal::Ghost creation fails 2012-12-16 21:31:19 +01:00
Thomas Geymayer ac27fae712 Canvas: Remove old event handling code 2012-12-16 19:02:21 +01:00
Thomas Geymayer f6270ec395 Canvas: create mouseover/mouseout events 2012-12-16 18:52:32 +01:00
Thomas Geymayer 50688e1159 Rename simgear::Rect to SGRect and make interface more similar to SGBox 2012-12-13 23:37:21 +01:00
Thomas Geymayer 8417fea3bf Overload Rect::contains and add compound assignment operators to PropertyObject 2012-12-13 00:30:11 +01:00
Thomas Geymayer 2263823f75 Create new FBO if Canvas render target size chanages
As doesnt seem to work to just resize the texture, if changing
the size of the Canvas render target a new FBO is created and
placed on all active placements.
2012-12-09 23:08:07 +01:00
Thomas Geymayer a882263033 Canvas: MouseEvent now contains screen and client pos 2012-12-08 15:01:01 +01:00
Thomas Geymayer fd27e7bd43 Canvas: basic support for rectangular clipping (like CSS clip property) 2012-12-07 18:36:37 +01:00
Thomas Geymayer 4dfe36cdc1 Canvas: Fix handling drag events and some cleanup. 2012-12-07 18:35:20 +01:00
Thomas Geymayer fc49be1e05 Implement Canvas single/double/tripple click handling.
- Implement click event creation like specified in
   DOM Level 3:
   * Check for max move distance between mousedown/up
     and clicks
   * Check for click timeout
   * Count clicks and report double clicks
2012-12-06 23:16:36 +01:00
Thomas Geymayer d06d94c767 Canvas: Propagate style changes on groups to children 2012-12-06 11:33:51 +01:00
Thomas Geymayer e9b499b82d Extend Canvas to retrieve bounding box of groups 2012-12-04 23:58:08 +01:00
Thomas Geymayer e6e3e686c6 canvas::Element: print warning instead of crash on removing unknown transform 2012-12-02 23:55:34 +01:00
Thomas Geymayer 46442ef50c First working version of DOM like Canvas event handling
- Now it is possible to attach listeners to canvas
   elements and also the canvas itself, which get
   called upon different mouse events (Currently
   only basic mouse events supported. click/dblclick
   etc. are missing)
2012-12-02 13:22:37 +01:00
Thomas Geymayer 8816d0a9ac Add method canvas::Group::getElementById
- canvas::Group: New method to get a (possibly
   nested) child by its id.
 - nasal::Ghost: Also support recursive parent
   hashes.
2012-11-30 00:06:17 +01:00
Thomas Geymayer 229837b14c Fix some compiler warnings. size_t/int/unsigned conversions and extra ';' 2012-11-29 20:20:40 +01:00
Thomas Geymayer 94b068a40f Use better method names and add comments 2012-11-29 17:52:52 +01:00
Thomas Geymayer 2f0dfc4d74 Add methods to get arguments passed to function from Nasal 2012-11-29 01:23:15 +01:00
Thomas Geymayer c19585e22a Simplify/Make VS happy 2012-11-27 15:14:54 +01:00
Thomas Geymayer 77946585b1 Canvas: Prepare for DOM Level 2 like event model. 2012-11-27 13:51:00 +01:00
Thomas Geymayer 88a35fd162 cppbind: Automatic conversion of derived ghosts and some cleanup/fixes 2012-11-27 13:02:36 +01:00
Thomas Geymayer 767184cf3c Extend CanvasSystemAdapter to provide access to Nasal gcSave and gcRelease 2012-11-22 00:54:56 +01:00
Thomas Geymayer 9be53e746f Allow canvas::Placements to have own properties 2012-11-21 13:05:19 +01:00
Thomas Geymayer 8b6f50d0cc SGPropertyNode::fireCreatedRecursive: don't fire for node itself by default 2012-11-21 11:58:07 +01:00
Thomas Geymayer 904d714d6d Get Canvas/PropertyBasedElement by name 2012-11-18 16:27:05 +01:00
Thomas Geymayer 9f31addfa5 Fix for old gcc which got broken by fix for VS 2012-11-16 16:49:35 +01:00