[Bf-python] multi ray cast proposal

Dima Glibitsky dima.glib at gmail.com
Mon Dec 19 22:24:31 CET 2011


Hi Kesten,
thanks for the initiative and very sorry for the late answer 0:-)

I am planning to use raycasting to scanfill meshes / to determine how
volumes defined by mesh surface are related to each other (I want to
prototype some geometric algorithms). Stepping forward is undesirable,
since it can lead to wrong results in specific cases (e.g. when
overlapping faces lie in the same plane -- proper method will return
two or more intersections, but stepping will return only one).

I have taken a look at Blender's source. When not in GameEngine mode,
Blender uses its own BVH structure to do raycasting and nearest point
determination. It would be nice to have same set of features available
both to modeling scripts and game engine scripts, though I'm currently
working only with the modeling stage.

Bullet has a good range of proximity/intersection queries (e.g.
contact tests, sweep tests, etc.), so raycasting a cylinder of some
radius should be already possible in GameEngine. I had no experience
with BGE, however, so I'm just guessing =)
BTW, is it possible to make Bullet methods available to non-BGE
scripts (e.g. as a collision detection library)?

Earlier you suggested to write a request at
http://wiki.blender.org/index.php/Dev:Ref/Requests. That can be a good
starting point, but I'm somewhat unsure under which category to put it
-- the topic comprises GameEngine as well as non-GE, at both C level
and Python API level.

As for writing test scripts, I can try my hand at this after December
(though I can't predict how much time it will take U_U).

Hope I'll be able to help you somehow ^_^ Happy Christmas/New Year!

Dima



More information about the Bf-python mailing list