/// <summary> /// Sets new values for a given Vector2 cartesian. /// </summary> public void Set(float radius, float azimuth, float height, BasePlane plane = BasePlane.XZ) { this.radius = radius; this.azimuth = azimuth; this.height = height; this.plane = plane; }
internal RobotCell(string name, Manufacturers manufacturer, List <MechanicalGroup> mechanicalGroups, IO io, Plane basePlane, Mesh?environment) : base(name, manufacturer, io, basePlane, environment, GetDefaultPose(mechanicalGroups)) { MechanicalGroups = mechanicalGroups; foreach (var group in mechanicalGroups) { var movesRobot = group.Externals.Find(m => m.MovesRobot); var robotDisplay = group.Robot.DisplayMesh; if (movesRobot is not null) { var movableBase = movesRobot.Joints.Last().Plane; movableBase.Orient(ref movesRobot.BasePlane); robotDisplay.Transform(movableBase.ToTransform()); } DisplayMesh.Append(robotDisplay); foreach (var external in group.Externals) { DisplayMesh.Append(external.DisplayMesh); } } DisplayMesh.Transform(BasePlane.ToTransform()); }
public void Start() { #if UNITY_EDITOR if (!UnityEditor.EditorApplication.isPlaying) { var editorBps = GetComponentsInParent <BasePlane>(); if (null != editorBps && editorBps.Length > 0) { bp = editorBps[editorBps.Length - 1]; } else { bp = null; } return; } #endif if (null == bp || !bp.IsRealyPlane()) { var bps = GetComponentsInParent <BasePlane>(); if (null != bps && bps.Length > 0) { for (int i = bps.Length - 1; i >= 0; --i) { if (bps[i].IsRealyPlane()) { bp = bps[i]; } } } } }
public virtual void OnHit(BasePlane _plane) { _plane.OnHit(owner.Atk * this.hitFactor); if (bStrike == false) { OnBomb(); } }
public void setXYZ(int x, int y, int z, BasePlane p) { this.x = x; this.y = y; this.z = z; this.p = p; pos = this.transform.position; }
// public URRealTime URRealTime { get; set; } internal RobotSystemUR(string name, RobotUR robot, IO io, Plane basePlane, Mesh?environment) : base(name, Manufacturers.UR, io, basePlane, environment, GetDefaultPose(robot)) { Remote = new RemoteUR(); Robot = robot; DisplayMesh.Append(robot.DisplayMesh); DisplayMesh.Transform(BasePlane.ToTransform()); }
public override void Transform(Transform x) { for (int i = 0; i < Branches.Length; ++i) { Branches[i].Transform(x); } BasePlane.Transform(x); }
/// <summary> /// Geometry is constructed with lower left corner at (0,0). Move and rotate into place. /// </summary> private TGeometryType TransformFromOrigin <TGeometryType>(TGeometryType geometry) where TGeometryType : Geometry { using (var baseSystem = CoordinateSystem.ByOrigin(Width / 2, Length / 2)) using (var targetSystem = BasePlane.ToCoordinateSystem()) { // Surface is constructed with lower left corner at (0,0). Move and rotate to given base plane. return((TGeometryType)geometry.Transform(baseSystem, targetSystem)); } }
Mesh CreateDisplayMesh() { var mesh = new Mesh(); mesh.Append(BaseMesh); foreach (var joint in Joints) mesh.Append(joint.Mesh); mesh.Transform(BasePlane.ToTransform()); return mesh; }
public bool CalculateCircle(Point3d testPoint) { var rc = false; var point = BasePlane.ClosestPoint(testPoint); var dir = point - BasePlane.Origin; if (!dir.IsTiny()) { Circle = new Circle(BasePlane, dir.Length); rc = Circle.IsValid; } return(rc); }
Mesh CreateDisplayMesh() { var mesh = new Mesh(); if (BaseMesh is null) { return(mesh); } mesh.Append(BaseMesh); foreach (var joint in Joints) { mesh.Append(joint.Mesh); } mesh.Transform(BasePlane.ToTransform()); return(mesh); }
private void CreatePlane() { bool fireState = false; if (planeActive) { fireState = planeActive.fire.onAttack; planeActive.EvDead.RemoveListener(TransferEvDead); GetHealth().EvChangeNormal.RemoveListener(ChenchHeath); Destroy(planeActive.gameObject); } planeActive = Creator.Inctance.GetGO(basePlaneLevel[level.Value].gameObject, transform.position, transform).GetComponent <BasePlane>(); planeActive.EvDead.AddListener(TransferEvDead); GetHealth().EvChangeNormal.AddListener(ChenchHeath); ChenchHeath(GetHealth().GetNormal()); planeActive.fire.Attack(fireState); }
void CreateEnemy() { int planeTypeRange = Random.Range(0, 100); BasePlane plane = null; if (planeTypeRange < 70) { plane = CreatePlane(PlaneType.enemy1); } else if (planeTypeRange < 80) { plane = CreatePlane(PlaneType.enemy2); } else { plane = CreatePlane(PlaneType.enemy3); } float x = Random.Range(-1.5f, 1.5f); plane.transform.position = new Vector2(x, transform.position.y); }
public void SetOwner(BasePlane _owner) { owner = _owner; }
/// <summary> /// Sets new values for a given Polar. /// </summary> public void Set(Vector3 cartesian, BasePlane plane = BasePlane.XZ) { this.plane = plane; ToPolar(cartesian); this.height = (plane == BasePlane.XY) ? cartesian.z : cartesian.y; }
/// <summary> /// Sets new values for a given Polar. /// </summary> public void Set(Vector2 cartesian, BasePlane plane = BasePlane.XZ) { this.plane = plane; ToPolar(cartesian); this.height = 0f; }
/// <summary> /// Constructs a new Polar, given a radius and azimuth. Angle in radians. /// </summary> public Polar(float radius, float azimuth, float height = 0f, BasePlane plane = BasePlane.XZ) : this() { Set(radius, azimuth, height, plane); }
/// <summary> /// Constructs a new Polar, given a Vector3 cartesian. Angle in radians. /// </summary> public Polar(Vector3 cartesian, BasePlane plane = BasePlane.XZ) : this() { Set(cartesian, plane); }
public static Vector2 PolarToCartesian(float radius, float azimuth, float height = 0f, BasePlane plane = BasePlane.XZ) { Polar cartesian = new Polar(radius, azimuth, height, plane); return(cartesian); }
public static Polar CartesianToPolar(Vector3 cartesian, BasePlane plane = BasePlane.XZ) { Polar polar = new Polar(cartesian, plane); return(polar); }
void OnEnable() { np = target as BasePlane; Init(); }
public override void GenerateHash( ) { base.GenerateHash(); this.GeometryHash += GetMd5FromObject(BasePlane.ToJson() + XSize.ToJson() + YSize.ToJson() + ZSize.ToJson()); this.Hash = GetMd5FromObject(this); }
void Start() { plane = GetComponent <BasePlane>(); }
public void OnPlaneDead(BasePlane _plane) { // GameObject.Destroy(_plane.gameObject); }