I'm currently trying to write a little game engine in C# using SlimDX just for fun.
I want my world to be destructable, so I have to be able to modify my map. My map is currently vector based, represented by an ID2D1PathGeometry (PathGeometry in SlimDX) object. This object is modified, using the CombineWithGeometry method of ID2D1Geometry (Geometry in SlimDX).
For reasonable collision detection, I need knowledge about the exact shape of my ID2D1PathGeometry object, for instance for calculating angles of balls bouncing of the walls.
So, is it possible to access all or specific (per location) segements/lines/points of my ID2D1PathGeometry object? Or are there other, better ways to accomplish my goals, e.g. storing all lines and shapes additionaly in another data structure?
Please note that bitmap based maps are not the way to go here, since I don't want to have memory as a constraint on the map size.
with best regards, Emi
There is no way to retrieve just the geometry segments that are close to a certain point, but there is a way to retrieve all geometry segments.
More info and example are here How to Retrieve Geometry Data by Extending ID2D1SimplifiedGeometrySink
If you are interested in retrieving only portion close to a certain point, perhaps you'd like to:
ID2D1Geometry::CombineWithGeometry
using D2D1_COMBINE_MODE==D2D1_COMBINE_MODE_INTERSECT.More info: ID2D1Geometry::CombineWithGeometry method