We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Disable physics body for collision detection

Home Forums General Questions Disable physics body for collision detection

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #87502
    Thomas Fabini
    Participant

    Hi Guys,

    I tried excluding ghost physics bodies from collision detection (if touching) and failed so far.
    Setting different states (enable / disable simulation, enable / disable contact response, activate / sleep) didn’t affect the detection of touching / not touching other physics bodies.

    Is this the expected behaviour?
    Is there maybe another way to prevent physics body collision detection?

    Thanks,
    Thomas

    #87510

    Hi,
    Please provide more info on what you’re trying to archive. The whole idea of ghost objects is to detect collisions. Are you trying to switch detection off temporary?

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #87515
    Thomas Fabini
    Participant

    Hi Alexander,

    Thank you for your reply. Yes, exactly that – I’m trying to exclude overlapping objects from detection.

    I’m using mechanics which roughly resemble those in the Snowball VR demo for grabbing the weapons. Where Weapon._setup_collisions updates the colliding weapons list from which the first colliding object is picked on left / right hand grab.

    As things get more complicated than that, I have overlapping collision objects where it is unclear which one gets returned first when the hand touches them. Each one has its own properties along with a bool enabled / disabled for this purpose, but I was looking for a way to avoid collision detection completely (from the physics engine) for any disabled object.

    Thanks,
    Thomas

    #87517

    Hi,
    I see. You might remove physics body from the inactive objects (keeping geometry) and add ghost body when it’s actually needed. Both operations should not take much time.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #87529
    Thomas Fabini
    Participant

    Hi Alexander,

    thank you for pointing that out. Then I will try this approach.

    When removing the physics body, any physics properties which where applied are removed, too, I assume. With ghost bodies that usually would be just the margin in my setup.

    Thanks,
    Thomas

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.