1 //MagnetismCanvas.h file
5 #include "TimeTracker.h"
8 using namespace System
;
9 using namespace System::Windows
;
10 using namespace System::Windows::Media
;
11 using namespace System::Windows::Media::Animation
;
12 using namespace System::Windows::Controls
;
13 using namespace System::Collections::Generic
;
14 using namespace System::Windows::Input
;
18 namespace PerFrameAnimations
{
19 public ref
class MagnitismCanvas
: Canvas
{
25 property
double BorderForce
{
27 void set (double value
) ;
30 property
double ChildForce
{
32 void set (double value
) ;
35 property
double Drag
{
37 void set (double value
) ;
41 TimeTracker
^ _timeTracker
;
42 System::Collections::Generic::Dictionary
<System::Windows::UIElement
^,System::Windows::Vector
>^ _childrenVelocities
;
49 void UpdateChildren (System::Object
^ sender
, System::EventArgs
^ e
) ;
53 bool AreRectsOverlapping (System::Windows::Rect r1
, System::Windows::Rect r2
) ;
54 System::Windows::Point
IntersectInsideRect (System::Windows::Rect r
, System::Windows::Point raystart
, System::Windows::Vector raydir
) ;
55 System::Windows::Vector
VectorBetweenRects (System::Windows::Rect r1
, System::Windows::Rect r2
) ;
56 System::Windows::Point
GetRenderTransformOffset (System::Windows::UIElement
^ e
) ;
57 void SetRenderTransformOffset (System::Windows::UIElement
^ e
, System::Windows::Point offset
) ;
58 System::Windows::Point
GetTruePosition (System::Windows::UIElement
^ e
) ;
59 void SetTruePosition (System::Windows::UIElement
^ e
, System::Windows::Point p
) ;
60 System::Windows::Point
GetCenter (System::Windows::Rect r
) ;