public Vector3I TransformThrustData(Vector3I originalData) { Vector3I newThrustData = new Vector3I(); _referenceOrientation = Behavior.Settings.BlockOrientation; if (originalData.X != 0) { var axisDir = originalData.X == 1 ? _referenceOrientation.TransformDirection(Base6Directions.Direction.Right) : _referenceOrientation.TransformDirection(Base6Directions.Direction.Left); DirectionToVector(axisDir, ref newThrustData); } if (originalData.Y != 0) { var axisDir = originalData.Y == 1 ? _referenceOrientation.TransformDirection(Base6Directions.Direction.Up) : _referenceOrientation.TransformDirection(Base6Directions.Direction.Down); DirectionToVector(axisDir, ref newThrustData); } if (originalData.Z != 0) { var axisDir = originalData.Z == 1 ? _referenceOrientation.TransformDirection(Base6Directions.Direction.Forward) : _referenceOrientation.TransformDirection(Base6Directions.Direction.Backward); DirectionToVector(axisDir, ref newThrustData); } return(newThrustData); }
public Base6Directions.Direction GetTransformedBaseDirection(Direction direction, MyBlockOrientation orientation) { var baseDir = new Base6Directions.Direction(); if (direction == Direction.Right) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Right); } if (direction == Direction.Left) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Left); } if (direction == Direction.Up) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Up); } if (direction == Direction.Down) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Down); } if (direction == Direction.Forward) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Forward); } if (direction == Direction.Backward) { baseDir = orientation.TransformDirection(Base6Directions.Direction.Backward); } return(baseDir); }
public void SetZ(bool enable, bool invert, float strength, MyBlockOrientation orientation) { var axisDir = !invert?orientation.TransformDirection(Base6Directions.Direction.Forward) : orientation.TransformDirection(Base6Directions.Direction.Backward); SetTransformedThrustData(axisDir, enable, strength); }
//New public void SetBaseDirection(MyBlockOrientation orientation) { _activeDirection = orientation.TransformDirection(_realDirection); }