Python collision callback #35460

Closed
opened 2013-05-22 00:43:46 +02:00 by Angus Hollands · 14 comments

%%%This patch adds support for a collision callback.
Currently it only informs you of the object you collide with.
This patch leverages the existing collision callbacks for the Touch sensors.

In order to add more information one would need to expand the touch system.%%%

%%%This patch adds support for a collision callback. Currently it only informs you of the object you collide with. This patch leverages the existing collision callbacks for the Touch sensors. In order to add more information one would need to expand the touch system.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Added demo file and newer, fixed release (to support properly sensor objects)%%%

%%%Added demo file and newer, fixed release (to support properly sensor objects)%%%

%%%First off, you've got some whitespace/clean/style changes in your patch; those should really be in a separate patch (e.g., the .style changes to CcdPhysicsEnvironment.cpp). Also, should we be able to register more than on callback like we can with KX_Scene.pre_draw and post_draw? Lastly, isn't the KX_TouchEventManager mostly just used for logic bricks? I seem to remember a different place where I added in calling the callback when I played around with this...%%%

%%%First off, you've got some whitespace/clean/style changes in your patch; those should really be in a separate patch (e.g., the .style changes to CcdPhysicsEnvironment.cpp). Also, should we be able to register more than on callback like we can with KX_Scene.pre_draw and post_draw? Lastly, isn't the KX_TouchEventManager mostly just used for logic bricks? I seem to remember a different place where I added in calling the callback when I played around with this...%%%
Author

%%%Added new file that removes CcdPhysicsEnvironment.cpp from patch.
Added list-style callbacks
Using touch manager. This is because the collision behaviour rules that the user is used to are implemented on top of bullet using callbacks defined in TouchManager. Without using touch manager, you'd be writing the same code, and a lot of work would be required to ensure that the two systems remain exclusive to one another.
The reason you didn't use it before was that you used directly the Bullet update, however, in the event of sensor objects, they only involve themselves in collisions if they have registered sensors, so we have to extend that to treat callbacks as "sensors"%%%

%%%Added new file that removes CcdPhysicsEnvironment.cpp from patch. Added list-style callbacks Using touch manager. This is because the collision behaviour rules that the user is used to are implemented on top of bullet using callbacks defined in TouchManager. Without using touch manager, you'd be writing the same code, and a lot of work would be required to ensure that the two systems remain exclusive to one another. The reason you didn't use it before was that you used directly the Bullet update, however, in the event of sensor objects, they only involve themselves in collisions if they have registered sensors, so we have to extend that to treat callbacks as "sensors"%%%

%%%Are we always guaranteed to have a touch manager, even if we don't have logic bricks that use them? I haven't dug into the managers too much...%%%

%%%Are we always guaranteed to have a touch manager, even if we don't have logic bricks that use them? I haven't dug into the managers too much...%%%

%%%Assigning this to Benoit for final review/okay.%%%

%%%Assigning this to Benoit for final review/okay.%%%
Author

%%%Added fix for unusual physics usage%%%

%%%Added fix for unusual physics usage%%%
Author

%%%Added support for the contact points from Bullet. These are also provided to the sensors now. Had to add a struct container to support forward declaring a vector type.%%%

%%%Added support for the contact points from Bullet. These are also provided to the sensors now. Had to add a struct container to support forward declaring a vector type.%%%
Member

%%%This patch is since r60132 14.09.2013 (r60208) in the trunk.
I think this patch can be closed.

%%%

%%%This patch is since r60132 14.09.2013 (r60208) in the trunk. I think this patch can be closed. %%%
Author

%%%Added new file with support for contact point information. This is available from the sensor as well as the callbacks.%%%

%%%Added new file with support for contact point information. This is available from the sensor as well as the callbacks.%%%
Author

%%%Fixed refcount error.%%%

%%%Fixed refcount error.%%%
Author

Modified previous patches to avoid random containers and use correct dt.
This now is a final patch.

However, it doesn't seem sensible that the Impulse values change with substep changes, I can't produce reliable information. Best to avoid this for now.

Modified previous patches to avoid random containers and use correct dt. This now is a final patch. However, it doesn't seem sensible that the Impulse values change with substep changes, I can't produce reliable information. Best to avoid this for now.

If the patch is "final," maybe it would be best to put it through Differential?

If the patch is "final," maybe it would be best to put it through Differential?
Benoit Bolsee was unassigned by Angus Hollands 2015-06-19 21:17:46 +02:00
Angus Hollands self-assigned this 2015-06-19 21:17:46 +02:00
Author

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#35460
No description provided.