Beispiel #1
0
        protected override void OnAttached()
        {
            base.OnAttached();

            _fluidContainerMain.VisualElement = this.AssociatedObject;
            FluidContainerMain.SetFluidContainer(this.AssociatedObject, _fluidContainerMain);

            this.AssociatedObject.Loaded += new RoutedEventHandler(AssociatedObject_Loaded);
        }
Beispiel #2
0
        void _physicsController_TimerLoop(object source)
        {
            // here you can handle logic per "frame"

            // NOTE that you can get a reference to the Fluid Container like so:
            FluidContainerMain fluidContainerMain = rectWater.GetValue(FluidContainerMain.FluidControllerProperty) as FluidContainerMain;

            // NOTE that you can get references to "sprite" objects in the simulation like so:
            PhysicsSprite astronaut      = _physicsController.PhysicsObjects["spaceSuit"];
            float         mass           = astronaut.BodyObject.Mass;
            int           collisionGroup = astronaut.GeometryObject.CollisionGroup;
        }