1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #221 (new patch)

Opened 3 years ago

Last modified 3 years ago

Per-triangle intersection tests and mouse picking demo

Reported by: andris11 Owned by: borrillis
Priority: major Milestone:
Component: Core Library Version: 0.8.0.0 (crickhollow)
Keywords: Cc:

Description

Initiated here: http://www.axiom3d.net/forum/viewtopic.php?f=1&t=413&start=26

Note: the TriangleBuilder?.cs could be renamed to TriangleListBuilder?.cs (similar to EdgeListBuilder?.cs), afaik files cannot be renamed in a .patch file right away.

Overview of the changes:

* MovableObject?.cs

DefaultQueryFlags? is now a static field and not a dynamic property, removed the backing field of it. I think that was previously defined just incorrectly

* Utility.cs

added struct IntersectResultTriMesh?

added methods for per-triangle intersection tests

public static bool Intersects(PlaneBoundedVolume? volume, Triangle t)
public static bool Intersects(PlaneBoundedVolumeList? volumes, Triangle t, bool requireAll)
public static bool Intersects(PlaneBoundedVolumeList? volumes, Triangle t)
public static bool Intersects(Plane p, Triangle t)
public static FaceSide? IntersectsDblSide?(ref Segment seg, ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 areaWhere)
public static bool IntersectsBkSide?(ref Segment seg, ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 areaWhere)
public static bool Intersects(ref Segment seg, ref Vector3 a, ref Vector3 b, ref Vector3 c, ref Vector3 areaWhere)
public static Vector3 CalcSpatialFromAreaCoords?(ref Vector3 areaCoords, ref Vector3 a, ref Vector3 b, ref Vector3 c)

* TriangleBuilder?.cs

updated TriangleListBuilder? class

removed TriangleVertices? and TriangleIntersector? from the file

* (new file) Axiom/Graphics/TriangleData.cs

Contains the TriangleData? class (formerly TriangleIntersector?) and per-triangle intersection strategies

* (new file) Axiom/Math/Segment.cs

the Segment class

* (new file) Axiom/Math/Triangle.cs

the Triangle class

* Mesh.cs

renamed Mesh.TriangleIntersector? property to Mesh.TriangleList?

renamed Mesh.CreateTriangleIntersector?() -> Mesh.BuildTriangleList?()

added Mesh.FreeTriangleList?()

* Enums.cs

added TriangleSide? enumeration

Attachments

Axiom.MousePicking.patch (106.2 KB) - added by andris11 3 years ago.

Change History

Changed 3 years ago by andris11

Changed 3 years ago by andris11

The patch contains breaking changes, but it's only the signatures of two members of Mesh that have changed (Mesh.TriangleIntersector? property -> Mesh.TriangleList?, Mesh.CreateTriangleIntersector?() -> Mesh.BuildTriangleList?()). Their usage is just the same it was before, so that shouldn't be making much problems.

Note: See TracTickets for help on using tickets.