Bullet Convex sweep test API #34989
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#34989
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%1.This patch exposes a function from the bullet API: ConvexSweepTest(). It returns first hit object position, hitpoint, hit normal.
It was implemented to enable bullet collision testing from Python.
It is formulated as closely as possible as object.ray_cast() function, which is allready there, but this function is able to test any convex rigidbody against the whole RigidBodyWorld.
Because the simulation needs to be run or updated before tests can be performed, there is also a new function rigidbody_world.update() which calls the update simulation function from Python. This function has to be run just once.
If the simulation is not initialized, the convex_sweep_test() function returns an error.
I tested the patch quite a lot and didn't find any problems so far.
I have implemented the patch for better collision detection in the CAM addon which I am developing( http://blendercam.blogspot.cz/ ) , but I hope this could potentially be usefull to many python scripters.
%%%
Changed status to: 'Open'
%%%Uploaded a test file:
http://www.pasteall.org/blend/20770%%%
%%%Hey, sorry I didn't notice this earlier.
Usually it's best to ping people via irc or email after adding patches to the tracker, otherwise they might be overlooked :)
I'll try to look at it over the weekend.%%%
%%%Actually never mind, just missed your mail :)%%%
%%%I uploaded a newer patch - sweep08.patch - it updates some tooltips, and corrects the return value of the has_hit parameter of the api function - now it returns 1 in case of a hit, 0 in case of no hit.
Also now throws an error if a non convex shape is passed to the function since otherwise it would return no hits and the user's couldn't know why.
Still didn't resolve how to access scene data from the rigidbodyworld data. - that's why to the update function the scene has to be passed.%%%
%%%Applied in svn r56195.%%%
Changed status from 'Open' to: 'Resolved'