Skip to content
Snippets Groups Projects

feat: added visualisation for CircleFact; added Torus- and ConeGenerator

Merged Marcel Dreier requested to merge marcel into master

Added scripts for generating circle-, cone and torus shaped meshes Added fact visualisation for CircleFact as torus Moved CircleSegmentGenerator under MeshGenerator Added WrapperClasses for the new Facts Added new Prefabs and new images for the new facts Adjusted the PointerGadget Added a new Gadget to compare circles Added some more functionalities to Scroll.cs to better extract information out of SOMDoc-terms

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
3494 {
3495 return new string[] { Cid1, Cid2 };
3496 }
3497
3498 /// \copydoc Fact.instantiateDisplay(GameObject, Transform)
3499 public override GameObject instantiateDisplay(GameObject prefab, Transform transform)
3500 {
3501 var obj = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity, transform);
3502 obj.transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>().text = _Facts[this.Cid1].Label + _Facts[this.Cid2].Label;
3503 obj.GetComponent<FactWrapper>().fact = this;
3504
3505 return obj;
3506 }
3507
3508 /// \copydoc Fact.GetHashCode
3509 /// uhhh is this a problem?
  • Just something that generates a low collision int value, for checking Equality (looking good). PS: Usually nobody will find annotations like this. Add a findable token, e.g. "TODO?" and you are good; though that's the pinnacle of "My future self will curse the day I postponed this...".

  • Please register or sign in to reply
  • Marco Zimmer
    Marco Zimmer @MaZiFAU started a thread on commit 964e953b
  • 3512 return this.Cid1.GetHashCode() ^ this.Cid2.GetHashCode();
    3513 }
    3514
    3515 /// \copydoc Fact.Equivalent(Fact, Fact)
    3516 protected override bool EquivalentWrapped(CylinderVolumeFact f1, CylinderVolumeFact f2)
    3517 {
    3518 if (f1.Cid1 == f2.Cid1 && f1.Cid2 == f2.Cid2)
    3519 return true;
    3520
    3521 CircleFact c1f1 = (CircleFact)_Facts[f1.Cid1];
    3522 CircleFact c1f2 = (CircleFact)_Facts[f2.Cid1];
    3523
    3524 CircleFact c2f1 = (CircleFact)_Facts[f1.Cid2];
    3525 CircleFact c2f2 = (CircleFact)_Facts[f2.Cid2];
    3526
    3527 return (c1f1.Equivalent(c1f2) && c2f1.Equivalent(c2f2) && f1.vol == f2.vol);
    • There is a reason we are not using Equality(==) but "Equivalent()"s: floating point precision is not very great for Unity 3dVectors. Use Math3d.vectorPrecission as an acceptable difference. For Volume then ^(1/3) as any Error accumulates cubic. Though Math3d.vectorPrecission*2^10 (~10^3) should be also good and computationally much less expensive

    • Please register or sign in to reply
  • requested review from @richardmarcus

  • assigned to @ki7077

  • merged

  • Please register or sign in to reply
    Loading