Jump to content

problem with the response of the physical trigger on a circular collider object.


photo

Recommended Posts

Hello everyone!

I'm doing my student project using physical triggers. I need to implement fairly simple functionality. I have a router and a bit attached to it.

A primitive is also implemented, to which a physical trigger and a script are attached, which contains an integer - its age. It is necessary to make sure that upon contact with the cutter, the cube checks the value of its age and, if it is greater than 1, it is removed and creates 8 descendants of the same cubes, but half as large and with an age of 1 less, fills the entire volume with them and leaves. If the age value is 1, then the cube is simply removed.

I have implemented a NodeReference which has a mesh and a physics trigger. There is also a script attached to the cube.

The cutter has a cylindrical collider.

On first contact everything works correctly. But the descendants react to the cutter earlier than necessary. That is, when the cutter has not yet come into contact with them. The result is holes of larger diameter and with indentations along the height of the cylinder. That is, the collider seems to be capsule and not cylindrical.

If anyone has thoughts on this, I'd love to hear them. Thank you all in advance!

I am attaching a draft of the scene, a photo of the cutter in action and a script for the workpiece.

1.png

2.png

3.png

4.png

VoxelLogic.cs QUASER MV184 Model.zip

Link to comment

vinograd2702

The only suspicions part in your code is actually located in line 43:

child[i].Scale = child[i].Scale * sizeChild / 0.128f;

Objects that are affected by physics can't be scaled (they should have scale set to 1). There is a small warning in our documentation in the Collision and Intersection detection section: https://developer.unigine.com/en/docs/2.17/principles/physics/?rlang=cpp#collision_intersection

Thanks!

  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thank you for your help!

 

Taking into account the impossibility of changing the size of objects with physics, each size of the cube had to be created separately. Now, when changing model parameters, you have to perform more actions, but the model works correctly!

  • Like 1
Link to comment
×
×
  • Create New...