teenageengineering / videolab

MIT License
737 stars 65 forks source link

New klak node : Particle Collision Input #44

Closed sdhuys closed 3 years ago

sdhuys commented 4 years ago

New klak node to get particle collision input. In the inspector of the node two different modes can be selected, one mode based on a collider, another mode based on a particle system.

In the Based On Collider Mode a Collider has to be selected and that Collider will send particle collision messages for any particle from any particle system colliding with this Collider to invoke the node's Particle Collision Events. Note that Unity does not send Particle Trigger messages from Colliders, so the Particle Enter/Exit/Inside/Outside Trigger Events are not available in the Based On Collider Mode.

In the Based On Particle System Mode a Particle System has to be selected and that Particle System will send particle collision messages for any of its particles colliding with any Colliders to invoke the node's Particle Collision Events. Note that the Collision module of the Particle System has to be enabled the Mode set to 3D, and the "Send Colllision Messages" box checked.

In the Based On Particle System Mode the nodes's Particle Inside/Outside/Enter/Exit Trigger Events are also available. Note that the Triggers Module has to be enabled, Colliders specified in the module and "Callback" chosen in the dropdown menu for Inside/Outside/Enter/Exit to be able to invoke the node's Trigger related events.

sdhuys commented 4 years ago

Updated the node with 3 extra outlets: Particle Collision Position, Particle Collision Rotation, and Particle Collision Velocity.

The rotation outlet outputs a quaternion that aligns the rotation to the surface normal of the collision point.

finnTE commented 4 years ago

@MysticalMonkeys I will look into this as soon as I have some time.

sdhuys commented 4 years ago

Here's a little demo video of a space invaders videopak in action, first without and then with this extra node: https://drive.google.com/file/d/1lhTQW1OpsMhI9tMC2aJ2E6uPMrZWIU98/view?usp=sharing