public SimulationVisualMovable3D(IMovableObjectInfo moveableObject) : base(moveableObject) { // Store object _moveableObject = moveableObject; // Calculate height if (this is SimulationVisualPod3D) { _height = _moveableObject.GetInfoRadius() * 4; } else if (this is SimulationVisualBot3D) { _height = _moveableObject.GetInfoRadius() * 0.9; } else { throw new ArgumentException("Unknown visual: " + this.GetType().ToString()); } // Add transforms Transform3DGroup tg = new Transform3DGroup(); tg.Children.Add(new TranslateTransform3D( _moveableObject.GetInfoCurrentTier().GetInfoTLX() + _moveableObject.GetInfoCenterX(), _moveableObject.GetInfoCurrentTier().GetInfoTLY() + _moveableObject.GetInfoCenterY(), _moveableObject.GetInfoCurrentTier().GetInfoZ() + GetZ())); tg.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), moveableObject.GetInfoOrientation() / (2 * Math.PI) * 360))); Transform = tg; }
public SimulationVisualMovable2D( IMovableObjectInfo moveableObject, DetailLevel detailLevel, Transformation2D transformer, double strokeThickness, MouseButtonEventHandler elementClickAction, SimulationAnimation2D controller) : base(detailLevel, transformer, strokeThickness, elementClickAction, controller) { _moveableObject = moveableObject; }