Ticket #221 (new patch)
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
